Example usage for java.awt Font PLAIN

List of usage examples for java.awt Font PLAIN

Introduction

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

Prototype

int PLAIN

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

Click Source Link

Document

The plain style constant.

Usage

From source file:rhinova.gui.dataentry.link.LinkDataEditPannel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    label1 = new JLabel();
    label2 = new JLabel();
    lblId = new JLabel();
    label3 = new JLabel();
    txtName = new JTextField();
    label8 = new JLabel();
    txtCapacity = new JTextField();
    label4 = new JLabel();
    txtSurvivalRate = new JTextField();
    label5 = new JLabel();
    comboReserve1 = new JComboBox<>();
    label6 = new JLabel();
    comboReserve2 = new JComboBox<>();

    //======== this ========
    setLayout(new GridBagLayout());
    ((GridBagLayout) getLayout()).columnWidths = new int[] { 54, 0, 0 };
    ((GridBagLayout) getLayout()).rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
    ((GridBagLayout) getLayout()).columnWeights = new double[] { 0.0, 0.0, 1.0E-4 };
    ((GridBagLayout) getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 };

    //---- label1 ----
    label1.setText("Link Properties");
    label1.setFont(new Font("Tahoma", Font.PLAIN, 16));
    add(label1, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
            new Insets(0, 0, 15, 0), 0, 0));

    //---- label2 ----
    label2.setText("id");
    add(label2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 15, 15), 0, 0));
    add(lblId, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
            new Insets(0, 0, 15, 0), 0, 0));

    //---- label3 ----
    label3.setText("name");
    add(label3, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 15, 15), 0, 0));
    add(txtName, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 15, 0), 0, 0));

    //---- label8 ----
    label8.setText("capacity");
    add(label8, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 15, 15), 0, 0));
    add(txtCapacity, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 15, 0), 0, 0));

    //---- label4 ----
    label4.setText("survival rate");
    add(label4, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 15, 15), 0, 0));
    add(txtSurvivalRate, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 15, 0), 0, 0));

    //---- label5 ----
    label5.setText("reserve 1");
    add(label5, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 15, 15), 0, 0));
    add(comboReserve1, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 15, 0), 0, 0));

    //---- label6 ----
    label6.setText("reserve 2");
    add(label6, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 15), 0, 0));
    add(comboReserve2, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:com.wsn.PieChartDemo.java

/**
 * Creates a chart.//from w  w  w  . jav a  2  s  .  c o m
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart("Pie Chart Demo", // chart title
            dataset, // data
            true, // include legend
            true, false);

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    plot.setNoDataMessage("No data available");
    plot.setCircular(false);
    plot.setLabelGap(0.02);
    return chart;

}

From source file:org.jfree.chart.demo.PieChartDemo1.java

/**
 * Creates a chart./*from  ww w  .  j ava  2 s.  c  o m*/
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart("Pie Chart Demo 1", // chart title
            dataset, // data
            true, // include legend
            true, false);

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    plot.setNoDataMessage("No data available");
    plot.setCircular(false);
    plot.setLabelGap(0.02);
    return chart;

}

From source file:com.limegroup.gnutella.gui.init.LanguagePanel.java

/**
 * Constructs a LanguagePanel that will notify the given listener when the
 * language changes.//from   ww w .ja v  a  2  s. c  o m
 */
public LanguagePanel(ActionListener actionListener) {
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));

    this.actionListener = actionListener;
    this.languageLabel = new JLabel();

    languageOptions = new JComboBox<Object>();
    Font font = new Font("Dialog", Font.PLAIN, 11);
    languageOptions.setFont(font);
    Locale[] locales = LanguageUtils.getLocales(font);
    languageOptions.setModel(new DefaultComboBoxModel<Object>(locales));
    languageOptions.setRenderer(LanguageFlagFactory.getListRenderer());

    Locale locale = guessLocale(locales);
    languageOptions.setSelectedItem(locale);

    applySettings(false);

    // It is important that the listener is added after the selected item
    // is set. Otherwise the listener will call methods that are not ready
    // to be called at this point.
    languageOptions.addItemListener(new StateListener());

    add(languageLabel);
    add(Box.createHorizontalStrut(5));
    add(languageOptions);
}

From source file:com.liusoft.dlog4j.servlet.DLOG_RandomImageServlet.java

/**
 * ???,,?16,/*from  w ww. jav  a  2s  .  c  om*/
 * @param num   ??
 * @param out   ?
 * @throws IOException
 */
protected static void render(String num, boolean gif, OutputStream out) throws IOException {
    if (num.getBytes().length > 4)
        throw new IllegalArgumentException("The length of param num cannot exceed 4.");
    int width = 40;
    int height = 15;
    BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = (Graphics2D) bi.getGraphics();
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, width, height);
    Font mFont = new Font("Tahoma", Font.PLAIN, 14);
    g.setFont(mFont);
    g.setColor(Color.BLACK);
    g.drawString(num, 2, 13);
    if (gif) {
        AnimatedGifEncoder e = new AnimatedGifEncoder();
        e.setTransparent(Color.WHITE);
        e.start(out);
        e.setDelay(0);
        e.addFrame(bi);
        e.finish();
    } else {
        ImageIO.write(bi, "png", out);
    }
}

From source file:components.ButtonHtmlDemo.java

public ButtonHtmlDemo() {
    ImageIcon leftButtonIcon = createImageIcon("images/right.gif");
    ImageIcon middleButtonIcon = createImageIcon("images/middle.gif");
    ImageIcon rightButtonIcon = createImageIcon("images/left.gif");

    b1 = new JButton("<html><center><b><u>D</u>isable</b><br>" + "<font color=#ffffdd>middle button</font>",
            leftButtonIcon);/*from   w w  w  .  j a va 2 s . c  o m*/
    Font font = b1.getFont().deriveFont(Font.PLAIN);
    b1.setFont(font);
    b1.setVerticalTextPosition(AbstractButton.CENTER);
    b1.setHorizontalTextPosition(AbstractButton.LEADING); //aka LEFT, for left-to-right locales
    b1.setMnemonic(KeyEvent.VK_D);
    b1.setActionCommand("disable");

    b2 = new JButton("middle button", middleButtonIcon);
    b2.setFont(font);
    b2.setForeground(new Color(0xffffdd));
    b2.setVerticalTextPosition(AbstractButton.BOTTOM);
    b2.setHorizontalTextPosition(AbstractButton.CENTER);
    b2.setMnemonic(KeyEvent.VK_M);

    b3 = new JButton("<html><center><b><u>E</u>nable</b><br>" + "<font color=#ffffdd>middle button</font>",
            rightButtonIcon);
    b3.setFont(font);
    //Use the default text position of CENTER, TRAILING (RIGHT).
    b3.setMnemonic(KeyEvent.VK_E);
    b3.setActionCommand("enable");
    b3.setEnabled(false);

    //Listen for actions on buttons 1 and 3.
    b1.addActionListener(this);
    b3.addActionListener(this);

    b1.setToolTipText("Click this button to disable the middle button.");
    b2.setToolTipText("This middle button does nothing when you click it.");
    b3.setToolTipText("Click this button to enable the middle button.");

    //Add Components to this container, using the default FlowLayout.
    add(b1);
    add(b2);
    add(b3);
}

From source file:playground.anhorni.PLOC.analysis.RunsEnsembleBoxPlot.java

public JFreeChart createChart() {
    String title = chartTitle;//from   w w  w .ja v a  2s .  c  o  m

    final CategoryAxis xAxis = new CategoryAxis("Hour");
    xAxis.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 10));
    xAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);

    final NumberAxis yAxis = new NumberAxis("AverageDays_Expenditures");
    yAxis.setAutoRangeIncludesZero(true);

    final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setFillBox(false);
    renderer.setSeriesPaint(0, Color.blue);
    CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);

    this.chart_ = new JFreeChart(title, new Font("SansSerif", Font.BOLD, 14), plot, false);
    return this.chart_;
}

From source file:org.gumtree.vis.awt.DefaultChartTheme.java

/**
 * @param name/*  www  . j  a v  a  2  s  .co  m*/
 */
public DefaultChartTheme(String name) {
    super(name);
    setExtraLargeFont(new Font("SansSerif", Font.BOLD, 16));
    setLargeFont(new Font("SansSerif", Font.BOLD, 14));
    setRegularFont(new Font("SansSerif", Font.PLAIN, 12));
    setSmallFont(new Font("SansSerif", Font.PLAIN, 10));
    setDrawingSupplier(new DefaultDrawingSupplier(createDefaultPaintArray(),
            DefaultDrawingSupplier.DEFAULT_FILL_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));
}

From source file:net.sf.statcvs.output.xml.chart.AbstractChart.java

/**
 * create chart with titles and credit information
 */// www .j  a va 2  s.  c o  m
public void placeTitle() {
    Font font = new Font("SansSerif", Font.PLAIN, 12);
    Font creditInformationFont = new Font("SansSerif", Font.PLAIN, 9);

    TextTitle title = new TextTitle(this.title, font);
    title.setSpacer(new Spacer(Spacer.RELATIVE, 0.05, 0.05, 0.05, 0.0));
    chart.addSubtitle(title);

    if (Settings.getShowCreditInformation()) {
        TextTitle copyright = new TextTitle("generated by statcvs-xml", creditInformationFont);
        copyright.setPosition(RectangleEdge.BOTTOM);
        copyright.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        chart.addSubtitle(copyright);
    }

    chart.setBackgroundPaint(Color.white);
}

From source file:net.sf.mzmine.chartbasics.chartthemes.EStandardChartTheme.java

public EStandardChartTheme(THEME themeID, String name) {
    super(name);/*  w  w w  .j a  va  2  s.co  m*/
    this.themeID = themeID;

    setBarPainter(new StandardBarPainter());
    setXYBarPainter(new StandardXYBarPainter());

    // in theme
    setAntiAliased(false);
    setNoBackground(false);
    // general

    isAntiAliased = true;

    masterFont = new Font("Arial", Font.PLAIN, 11);
    masterFontColor = Color.black;
}