Example usage for java.awt Font SERIF

List of usage examples for java.awt Font SERIF

Introduction

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

Prototype

String SERIF

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

Click Source Link

Document

A String constant for the canonical family name of the logical font "Serif".

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

    String s = "The quick brown fox jumps over the lazy dog!";
    Font font = new Font(Font.SERIF, Font.PLAIN, 24);

    JLabel l1 = new MyLabel(s);
    l1.setFont(font);//from  ww  w .  j  a va2  s .c o m
    f.setContentPane(l1);
    f.pack();

    f.setVisible(true);
}

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  ww .  ja  v a  2  s  .  c  o m*/
    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:scheduler.benchmarker.manager.CreateCombinedCategoryPlot.java

private ValueMarker generateMarker(String title, double value) {
    ValueMarker marker = new ValueMarker(value);
    marker.setLabel(title);/*w  w  w. ja  v a2 s . c  o  m*/
    marker.setPaint(Color.RED);
    marker.setLabelPaint(Color.RED);
    marker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
    marker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
    marker.setLabelFont(new Font(Font.SERIF, Font.BOLD, 10));
    return marker;
}

From source file:org.zephyrsoft.sdb2.MainController.java

private void loadDefaultSettingsForUnsetSettings() {
    putDefaultIfKeyIsUnset(SettingKey.BACKGROUND_COLOR, Color.BLACK);
    putDefaultIfKeyIsUnset(SettingKey.TEXT_COLOR, Color.WHITE);

    putDefaultIfKeyIsUnset(SettingKey.TOP_MARGIN, Integer.valueOf(10));
    putDefaultIfKeyIsUnset(SettingKey.LEFT_MARGIN, Integer.valueOf(0));
    putDefaultIfKeyIsUnset(SettingKey.RIGHT_MARGIN, Integer.valueOf(0));
    putDefaultIfKeyIsUnset(SettingKey.BOTTOM_MARGIN, Integer.valueOf(20));
    putDefaultIfKeyIsUnset(SettingKey.DISTANCE_TITLE_TEXT, Integer.valueOf(20));
    putDefaultIfKeyIsUnset(SettingKey.DISTANCE_TEXT_COPYRIGHT, Integer.valueOf(20));

    putDefaultIfKeyIsUnset(SettingKey.SONG_LIST_FILTER, FilterTypeEnum.TITLE_AND_LYRICS);
    putDefaultIfKeyIsUnset(SettingKey.SCREEN_1_CONTENTS, ScreenContentsEnum.ONLY_LYRICS);
    putDefaultIfKeyIsUnset(SettingKey.SCREEN_1_DISPLAY, "");
    putDefaultIfKeyIsUnset(SettingKey.SCREEN_2_CONTENTS, ScreenContentsEnum.LYRICS_AND_CHORDS);
    putDefaultIfKeyIsUnset(SettingKey.SCREEN_2_DISPLAY, "");

    putDefaultIfKeyIsUnset(SettingKey.SHOW_TITLE, Boolean.TRUE);
    putDefaultIfKeyIsUnset(SettingKey.TITLE_FONT, new Font(Font.SERIF, Font.BOLD, 10));
    putDefaultIfKeyIsUnset(SettingKey.LYRICS_FONT, new Font(Font.SERIF, Font.PLAIN, 10));
    putDefaultIfKeyIsUnset(SettingKey.TRANSLATION_FONT, new Font(Font.SERIF, Font.PLAIN, 10));
    putDefaultIfKeyIsUnset(SettingKey.COPYRIGHT_FONT, new Font(Font.SERIF, Font.ITALIC, 10));
    putDefaultIfKeyIsUnset(SettingKey.LOGO_FILE, "");
    putDefaultIfKeyIsUnset(SettingKey.SECONDS_UNTIL_COUNTED, Integer.valueOf(60));

    // check that really all settings are set
    for (SettingKey key : SettingKey.values()) {
        if (!settings.isSet(key)) {
            throw new IllegalStateException("unset value for setting key: " + key);
        }//  www  .j ava 2  s .c om
    }
}