Example usage for java.awt Font BOLD

List of usage examples for java.awt Font BOLD

Introduction

In this page you can find the example usage for java.awt Font BOLD.

Prototype

int BOLD

To view the source code for java.awt Font BOLD.

Click Source Link

Document

The bold style constant.

Usage

From source file:wef.articulab.view.ui.BNCategoryPlot.java

/**
 * Creates a chart.//from   w w  w  .  ja va 2  s  .  c om
 *
 * @return A chart.
 */
private static JFreeChart createChart() {

    dataset = createDataset();
    NumberAxis rangeAxis1 = new NumberAxis("Value");
    rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    LineAndShapeRenderer renderer = new LineAndShapeRenderer();
    renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    CategoryPlot subplot = new CategoryPlot(dataset, null, rangeAxis1, renderer);
    subplot.setDomainGridlinesVisible(true);

    CategoryAxis domainAxis = new CategoryAxis("Time");
    CombinedCategoryPlot plot = new CombinedCategoryPlot(domainAxis, new NumberAxis("Activation"));
    plot.add(subplot);

    return new JFreeChart("Social Reasoner Plot", new Font("SansSerif", Font.BOLD, 12), plot, true);
}

From source file:edu.ucla.stat.SOCR.analyses.gui.Survival.java

/**Initialize the Analysis*/
public void init() {
    showInput = false;//from ww w. ja va  2 s.  co  m
    showSelect = false;
    showVisualize = false;
    super.init();

    //System.err.println("Test11");

    analysisType = AnalysisType.SURVIVAL;
    analysisName = "Survival Analysis";
    useInputExample = false;
    useLocalExample = false;
    useRandomExample = false;
    useServerExample = false;
    useStaticExample = SurvivalExamples.availableExamples;

    //System.err.println("Test12");

    depMax = 1; // max number of dependent var
    indMax = 1; // max number of independent var
    resultPanelTextArea.setFont(new Font(outputFontFace, Font.BOLD, outputFontSize));
    frame = getFrame(this);
    setName(analysisName);
    // Create the toolBar
    toolBar = new JToolBar();
    createActionComponents(toolBar);
    this.getContentPane().add(toolBar, BorderLayout.NORTH);
    validate();
    reset();
}

From source file:edu.ucla.stat.SOCR.analyses.gui.KruskalWallis.java

/**Initialize the Analysis*/
public void init() {
    showInput = false;/*  w  w w .  ja v  a  2 s.com*/
    showGraph = false;
    showSelect = false;
    showVisualize = false;
    super.init();
    analysisType = AnalysisType.TWO_INDEPENDENT_KRUSKAL_WALLIS;
    useInputExample = false;
    useLocalExample = true;
    useRandomExample = false;
    useServerExample = true;
    useStaticExample = TwoIndependentKruskalWalliesExamples.availableExamples;

    onlineDescription = "http://en.wikipedia.org/wiki/Kruskal-Wallis_one-way_analysis_of_variance";
    depMax = 1; // max number of dependent var
    indMax = 9; // max number of independent var
    resultPanelTextArea.setFont(new Font(outputFontFace, Font.BOLD, outputFontSize));
    frame = getFrame(this);
    setName("Regression & Correlation Analysis");
    // Create the toolBar
    toolBar = new JToolBar();
    createActionComponents(toolBar);
    this.getContentPane().add(toolBar, BorderLayout.NORTH);

    // use the new JFreeChar function. annie che 20060312
    chartFactory = new Chart();
    //depLabel.setText("Variable 1");
    indLabel.setText("SELECT AT LEAST TWO GROUPS:");
    validate();
}

From source file:MenuItemChooser.java

private void initGUI() {
    JPanel itemDetailsPanel = new JPanel();
    itemDetailsPanel.setLayout(new GridLayout(4, 2));
    itemDetailsPanel.setBackground(Color.WHITE);

    JLabel lbl = new JLabel("Item: ");
    itemDetailsPanel.add(lbl);//from  ww  w  .j av a2 s. c om

    itemName = new JLabel("");
    itemDetailsPanel.add(itemName);

    lbl = new JLabel("Type: ");
    itemDetailsPanel.add(lbl);

    itemType = new JLabel("");
    itemDetailsPanel.add(itemType);

    lbl = new JLabel("Price: $ ");
    itemDetailsPanel.add(lbl);

    price = new JLabel("");
    itemDetailsPanel.add(price);

    lbl = new JLabel("Quantity: ");
    itemDetailsPanel.add(lbl);

    qty = new JTextField("0", 1);
    qty.addActionListener(this);
    qty.addFocusListener(this);
    itemDetailsPanel.add(qty);

    JPanel imgDescPanel = new JPanel(new BorderLayout());
    imgDescPanel.setBackground(Color.WHITE);
    image = new JLabel("");
    image.setHorizontalAlignment(SwingConstants.CENTER);
    image.setVerticalAlignment(SwingConstants.CENTER);

    imgDescPanel.add(image, BorderLayout.NORTH);

    desc = new JLabel("desc");
    imgDescPanel.add(desc, BorderLayout.SOUTH);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(Color.WHITE);
    next = new JButton("Next");
    next.addActionListener(this);
    buttonPanel.add(next);

    prev = new JButton("Previous");
    prev.addActionListener(this);
    buttonPanel.add(prev);

    order = new JButton("Order");
    order.addActionListener(this);
    buttonPanel.add(order);

    cancel = new JButton("Cancel / New");
    cancel.addActionListener(this);
    buttonPanel.add(cancel);

    close = new JButton("Close");
    close.addActionListener(this);
    close.setEnabled(false);
    buttonPanel.add(close);

    totalLbl = new JLabel("");
    totalLbl.setFont(new Font("Serif", Font.BOLD, 14));
    totalLbl.setForeground((Color.GREEN).darker());
    buttonPanel.add(totalLbl);

    BorderLayout bl = new BorderLayout();
    bl.setHgap(30);
    bl.setVgap(20);
    setLayout(bl);
    setBackground(Color.WHITE);
    add(itemDetailsPanel, BorderLayout.WEST);
    add(imgDescPanel, BorderLayout.EAST);
    add(buttonPanel, BorderLayout.SOUTH);
    TitledBorder title = BorderFactory.createTitledBorder("Choose Menu Items And Place Order");
    setBorder(title);

    loadMenuItem();
}

From source file:scheduler.benchmarker.manager.CreateStackedBarChart3D.java

public ChartPanel createChartPanel() {
    JFreeChart jfreechart = ChartFactory.createStackedBarChart3D(title, "Category", "Value", createDataset(),
            PlotOrientation.HORIZONTAL, true, true, false);
    jfreechart.setBackgroundPaint(new Color(214, 217, 223));

    CustomBarRenderer cRenderer = new CustomBarRenderer(pluginColors);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();

    ValueMarker marker = new ValueMarker(dataSource.getSumTotalTime());

    marker.setLabel("CLASSIFICATION FINISH");
    marker.setPaint(Color.RED);/*from w w w  . j  a v  a  2s  . c  om*/
    marker.setLabelPaint(Color.RED);
    marker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
    marker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
    marker.setLabelOffsetType(LengthAdjustmentType.EXPAND);
    marker.setLabelFont(new Font(Font.SERIF, Font.BOLD, 12));

    categoryplot.addRangeMarker(marker, Layer.FOREGROUND);
    categoryplot.setFixedLegendItems(createCustomLegend());
    categoryplot.setRenderer(cRenderer);
    cPanel = new ChartPanel(jfreechart, true);
    return cPanel;
}

From source file:com.jcraft.weirdx.DDXFont.java

public Font getFont() {
    if (font != null)
        return font;
    int size = 12;
    try {//from   ww w. j av  a2  s.co m
        int tmp = Integer.parseInt(getFontSize());
        if (tmp != 0) {
            size = tmp;
        }
    } catch (Exception e) {
        LOG.error(e);
    }

    int style = Font.PLAIN;
    if (getWeight().equals("bold"))
        style |= Font.BOLD;
    if (getStyle().equals("i"))
        style |= Font.ITALIC;
    if (getFamily().equals("times") || getFamily().equals("times new roman")
            || getFamily().equals("new century schoolbook")) {
        font = getFont("Serif", style, size);
    } else if (getFamily().equals("helvetica") || getFamily().equals("helvetic")
            || getFamily().equals("courier")) {
        font = getFont("SansSerif", style, size);
    } else {
        font = getFont("Monospaced", style, size);
    }

    metric = java.awt.Toolkit.getDefaultToolkit().getFontMetrics(font);

    String reg = getCharsetRegistry();
    String enc = getCharsetEncoding();

    for (Font_CharSet foo : XFont.charSets) {
        if (reg.equals(foo.getCharset()) || enc.equals(foo.getCharset())) {
            min_byte1 = foo.getMinByte1();
            max_byte1 = foo.getMaxByte1();
            min_char_or_byte2 = foo.getMinCharOrByte2();
            max_char_or_byte2 = foo.getMaxCharOrByte2();
            default_char = foo.getDefaultChar();
            encoding = foo.getEncoding();
            charset = foo;
            break;
        }
    }

    min_width = getMaxAdvance();
    max_width = getMaxAdvance();

    if (encoding != null) {
        int tmp = default_char;
        int i = 0;
        while (tmp != 0) {
            i++;
            tmp >>= 8;
            tmp &= 0xffffff;
        }
        byte[] btmp = new byte[i];
        tmp = default_char;
        i--;
        while (tmp != 0) {
            btmp[i] = (byte) (tmp & 0xff);
            tmp >>= 8;
            tmp &= 0xffffff;
            i--;
        }
        char[] ctmp = new char[1];
        if (charset != null)
            charset.encode(btmp, 0, btmp.length, ctmp);
        max_width = min_width = metric.charWidth(ctmp[0]);
        if (getSpace().equals("p")) {
            min_width = 0;
        }
    } else {
        char[] ctmp = new char[1];
        ctmp[0] = '@';
        max_width = metric.charsWidth(ctmp, 0, 1);
        ctmp[0] = ' ';
        min_width = metric.charsWidth(ctmp, 0, 1);
    }
    return font;
}

From source file:org.jfree.experimental.chart.plot.dial.DialValueIndicator.java

/** 
 * Creates a new instance of <code>DialValueIndicator</code>.
 * //  w ww  .ja  va  2  s.  c om
 * @param datasetIndex  the dataset index.
 * @param label  the label.
 */
public DialValueIndicator(int datasetIndex, String label) {
    this.datasetIndex = datasetIndex;
    this.angle = -90.0;
    this.radius = 0.3;
    this.frameAnchor = RectangleAnchor.CENTER;
    this.templateValue = new Double(100.0);
    this.formatter = new DecimalFormat("0.0");
    this.font = new Font("Dialog", Font.BOLD, 14);
    this.paint = Color.black;
    this.backgroundPaint = Color.white;
    this.outlineStroke = new BasicStroke(1.0f);
    this.outlinePaint = Color.blue;
    this.insets = new RectangleInsets(4, 4, 4, 4);
    this.valueAnchor = RectangleAnchor.RIGHT;
    this.textAnchor = TextAnchor.CENTER_RIGHT;
}

From source file:com.mxgraph.examples.swing.chart.TimeSeriesChartDemo1.java

/**
 * Creates a chart.//from  w  w w .  j  a  v a2 s . c o m
 *
 * @param dataset  a dataset.
 *
 * @return A chart.
 */
public static JFreeChart createChart(XYDataset dataset, String name) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(name, // title
            "Date", // x-axis label
            "Value", // y-axis label
            dataset, // data
            true, // create legend?
            true, // generate tooltips?
            false // generate URLs?
    );

    chart.setBackgroundPaint(Color.white);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
        renderer.setDrawSeriesLineAsPath(true);
        renderer.setItemLabelGenerator(new StandardXYItemLabelGenerator());
        renderer.setBaseItemLabelsVisible(true);
        // 
        renderer.setItemLabelsVisible(true);
        // 
        renderer.setBaseShapesVisible(true);
        // 
        renderer.setBaseShapesFilled(true);

        //  renderer.setLegendItemLabelGenerator(new StandardPieSectionLabelGenerator("{0}={1}({2})"));

    }

    DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss"/*"yyyy-MM-dd HH:mm:ss"*/));

    chart.getTitle().setFont(new Font("", Font.BOLD, 15));
    chart.getLegend().setItemFont(new Font("", Font.BOLD, 15));
    //
    plot.getRangeAxis().setLabelFont(new Font("", Font.BOLD, 15));
    //
    chart.getLegend().setItemFont(new Font("", Font.ITALIC, 15));
    //
    plot.getDomainAxis().setTickLabelFont(new Font("", 1, 15));
    //
    plot.getDomainAxis().setLabelFont(new Font("", 1, 12));

    return chart;

}

From source file:dpcs.About.java

public About() {
    setIconImage(Toolkit.getDefaultToolkit().getImage(About.class.getResource("/graphics/Icon.png")));
    setResizable(false);// ww w . j a v a  2 s. com
    setType(Type.UTILITY);
    setTitle("About");
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 540, 400);
    contentPane = new JPanel();
    contentPane.setBackground(Color.WHITE);
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);
    try {
        InputStreamReader reader2 = new InputStreamReader(
                getClass().getResourceAsStream("/others/app-version.txt"));
        String tmp = IOUtils.toString(reader2);
        AppVersion = Double.parseDouble(tmp);
    } catch (IOException e1) {
        e1.printStackTrace();
    }
    JButton btnGitHub = new JButton("GitHub");
    btnGitHub.setToolTipText("Access Droid PC Suite github repository");
    btnGitHub.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            try {
                Desktop.getDesktop().browse(new URL("https://github.com/kvsjxd/Droid-PC-Suite/").toURI());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    btnGitHub.setBounds(369, 295, 111, 25);
    contentPane.add(btnGitHub);

    JLabel lblMyFriend4 = new JLabel("Gulati-kun");
    lblMyFriend4.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend4.setBounds(25, 266, 242, 24);
    contentPane.add(lblMyFriend4);

    JLabel lblMyFriend3 = new JLabel("Anil-kun");
    lblMyFriend3.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend3.setBounds(25, 242, 242, 24);
    contentPane.add(lblMyFriend3);

    JLabel lblMyFriend2 = new JLabel("Suri-kun");
    lblMyFriend2.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend2.setBounds(25, 217, 242, 24);
    contentPane.add(lblMyFriend2);

    JLabel lblApplicationVersion = new JLabel("Version: " + AppVersion);
    lblApplicationVersion.setFont(new Font("Dialog", Font.BOLD, 14));
    lblApplicationVersion.setBounds(382, 16, 132, 18);
    contentPane.add(lblApplicationVersion);

    JLabel lblForMyOther = new JLabel("For my other Android stuff visit me on XDA - Developers (@kvsjxd)");
    lblForMyOther.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent arg0) {
            try {
                Desktop.getDesktop().browse(new URL(
                        "http://forum.xda-developers.com/member.php?s=82fb1dacfee601c8f79084b30d57d5a2&u=5640594")
                                .toURI());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        @Override
        public void mouseEntered(MouseEvent e) {
            lblForMyOther.setForeground(Color.BLUE);
        }

        @Override
        public void mouseExited(MouseEvent e) {
            lblForMyOther.setForeground(Color.BLACK);
        }
    });
    lblForMyOther.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblForMyOther.setBounds(25, 321, 502, 24);
    contentPane.add(lblForMyOther);

    JLabel lblMySensei2 = new JLabel("Karun Sensei");
    lblMySensei2.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMySensei2.setBounds(25, 120, 242, 24);
    contentPane.add(lblMySensei2);

    JLabel lblMySensei1 = new JLabel("Prashotam Sensei");
    lblMySensei1.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMySensei1.setBounds(25, 98, 242, 24);
    contentPane.add(lblMySensei1);

    JLabel lblDaretobe = new JLabel("D4r3T0B3");
    lblDaretobe.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblDaretobe.setBounds(25, 194, 242, 24);
    contentPane.add(lblDaretobe);

    JLabel label_9 = new JLabel("");
    label_9.setToolTipText("This variation of android robot is created using Androidify");
    label_9.setIcon(new ImageIcon(About.class.getResource("/graphics/Droidrobot.png")));
    label_9.setBounds(334, 50, 180, 270);
    contentPane.add(label_9);

    JLabel lblDeveloper = new JLabel("Developer");
    lblDeveloper.setFont(new Font("Dialog", Font.BOLD, 16));
    lblDeveloper.setBounds(25, 12, 233, 24);
    contentPane.add(lblDeveloper);

    JLabel lblMrAleksandarDespotovski_shi = new JLabel("Aleksandar Despotovski-shi");
    lblMrAleksandarDespotovski_shi.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMrAleksandarDespotovski_shi.setBounds(25, 169, 242, 24);
    contentPane.add(lblMrAleksandarDespotovski_shi);

    JLabel lblMyname = new JLabel("Karanvir Singh");
    lblMyname.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                Desktop.getDesktop().browse(new URL(
                        "http://forum.xda-developers.com/member.php?s=82fb1dacfee601c8f79084b30d57d5a2&u=5640594")
                                .toURI());
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }

        @Override
        public void mouseEntered(MouseEvent e) {
            lblMyname.setForeground(Color.BLUE);
        }

        @Override
        public void mouseExited(MouseEvent e) {
            lblMyname.setForeground(Color.RED);
        }
    });
    lblMyname.setForeground(Color.RED);
    lblMyname.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 16));
    lblMyname.setBounds(25, 36, 242, 24);
    contentPane.add(lblMyname);

    JLabel lblMyFriend1 = new JLabel("My friend - Chetan-kun");
    lblMyFriend1.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend1.setBounds(25, 145, 242, 24);
    contentPane.add(lblMyFriend1);

    JLabel label_6 = new JLabel("Special thanks to");
    label_6.setForeground(UIManager.getColor("OptionPane.questionDialog.titlePane.shadow"));
    label_6.setFont(new Font("Dialog", Font.BOLD, 16));
    label_6.setBounds(25, 71, 240, 25);
    contentPane.add(label_6);

    JLabel lblGoogle = new JLabel(
            "Android, android green colored robot are trademarks of Google, Inc. We are not affliated with Google, Inc. in any way.");
    lblGoogle.setHorizontalAlignment(SwingConstants.LEFT);
    lblGoogle.setFont(new Font("Dialog", Font.PLAIN, 8));
    lblGoogle.setBounds(25, 341, 514, 24);
    contentPane.add(lblGoogle);
}

From source file:net.sf.dynamicreports.test.jasper.chart.ScatterChartTest.java

@Override
public void test() {
    super.test();

    numberOfPagesTest(1);/*from   w  w  w  .  j av a  2  s . c  om*/

    JFreeChart chart = getChart("summary.chart1", 0);
    XYItemRenderer renderer = chart.getXYPlot().getRenderer();
    Assert.assertEquals("renderer", XYLineAndShapeRenderer.class, renderer.getClass());
    Assert.assertFalse("show shapes", ((XYLineAndShapeRenderer) renderer).getBaseShapesVisible());
    Assert.assertFalse("show lines", ((XYLineAndShapeRenderer) renderer).getBaseLinesVisible());
    xyChartDataTest(chart, 0, "Column2", new Number[][] { { 1d, 2d }, { 2d, 3d }, { 3d, 4d }, { 4d, 5d } });
    xyChartDataTest(chart, 1, "Column1", new Number[][] { { 2d, 1d }, { 3d, 2d }, { 4d, 3d }, { 5d, 4d } });

    chart = getChart("summary.chart2", 0);
    Axis axis = chart.getXYPlot().getDomainAxis();
    Assert.assertEquals("category label", "category", axis.getLabel());
    Assert.assertEquals("category label color", Color.BLUE, axis.getLabelPaint());
    Assert.assertEquals("category label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
    Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
    Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
    Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());

    chart = getChart("summary.chart3", 0);
    axis = chart.getXYPlot().getRangeAxis();
    Assert.assertEquals("value label", "value", axis.getLabel());
    Assert.assertEquals("value label color", Color.BLUE, axis.getLabelPaint());
    Assert.assertEquals("value label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
    Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
    Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
    Assert.assertEquals("tick label mask", "10.00", ((NumberAxis) axis).getNumberFormatOverride().format(10));
    Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());
}