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:ch.epfl.leb.sass.ijplugin.SimulatorStatusFrame.java

/** 
 * Creates a new status frame.//from   ww w  .  j  a  v  a2 s. c  o  m
 * 
 * @param groundTruthYLabel The y-axis label for the ground truth signal.
 * @param analyzerYLabel The units output by the analyzer.
 * @param setpointYLabel The units of the controller setpoint.
 * @param outputYLabel The units output by the controller.
 */
public SimulatorStatusFrame(String groundTruthYLabel, String analyzerYLabel, String setpointYLabel,
        String outputYLabel) {
    String seriesLabel = "";
    String yLabel = "";
    CombinedDomainXYPlot combineddomainxyplot = new CombinedDomainXYPlot(new NumberAxis("Simulation Outputs"));
    Font yLabelFont = new Font("Dialog", Font.PLAIN, 10);
    datasets = new XYSeriesCollection[4];
    for (int i = 0; i < SUBPLOT_COUNT; i++) {
        switch (i) {
        case 0:
            seriesLabel = "True density";
            yLabel = groundTruthYLabel;
            break;
        case 1:
            seriesLabel = "Analyzer output";
            yLabel = analyzerYLabel;
            break;
        case 2:
            seriesLabel = "Setpoint";
            yLabel = setpointYLabel;
            break;
        case 3:
            seriesLabel = "Controller output";
            yLabel = outputYLabel;
            break;
        }

        XYSeries timeseries = new XYSeries(seriesLabel);
        datasets[i] = new XYSeriesCollection(timeseries);

        NumberAxis numberaxis = new NumberAxis(yLabel);
        numberaxis.setAutoRangeIncludesZero(false);
        numberaxis.setNumberFormatOverride(new DecimalFormat("###0.00"));
        XYPlot xyplot = new XYPlot(datasets[i], null, numberaxis, new StandardXYItemRenderer());
        xyplot.setBackgroundPaint(Color.lightGray);
        xyplot.setDomainGridlinePaint(Color.white);
        xyplot.setRangeGridlinePaint(Color.white);
        xyplot.getRangeAxis().setLabelFont(yLabelFont);
        combineddomainxyplot.add(xyplot);
    }

    JFreeChart jfreechart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, combineddomainxyplot, true);
    jfreechart.setBorderPaint(Color.black);
    jfreechart.setBorderVisible(true);
    jfreechart.setBackgroundPaint(Color.white);
    combineddomainxyplot.setBackgroundPaint(Color.lightGray);
    combineddomainxyplot.setDomainGridlinePaint(Color.white);
    combineddomainxyplot.setRangeGridlinePaint(Color.white);
    ValueAxis valueaxis = combineddomainxyplot.getDomainAxis();
    valueaxis.setAutoRange(true);
    // Number of frames to display
    valueaxis.setFixedAutoRange(2000D);

    ChartPanel chartpanel = new ChartPanel(jfreechart);

    chartpanel.setPreferredSize(new Dimension(800, 500));
    chartpanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    chartpanel.setVisible(true);

    JPanel jPanel = new JPanel();
    jPanel.setLayout(new BorderLayout());
    jPanel.add(chartpanel, BorderLayout.NORTH);

    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    add(jPanel);
    pack();
    setVisible(true);

}

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

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

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

    final NumberAxis yAxis = new NumberAxis("AvgDaysRuns_OfEnsembleAverageOfTotalExpenditures");
    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:fitmon.PieChart.java

/**
 * Creates a chart./*from   w ww. j a v  a  2  s. c om*/
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
public static JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart("Food Stat of the Week", // 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:ImageLabel.java

public ImageLabel(BufferedImage img, String text) {
    this.img = img;
    this.text = text;
    font = new Font("Serif", Font.PLAIN, 36);
}

From source file:Interface.FoodDistributionWorkArea.FoodDistributionWorkArea.java

public FoodDistributionWorkArea(JPanel userProcessContainer, UserAccount account) {
    initComponents();// w w w  . ja v  a  2 s.c o  m
    this.userProcessContainer = userProcessContainer;
    this.account = account;
    community = account.getEmployee().getCommunityAssociated();
    organization = community.getFoodDistributionOrg();
    distributionEmp = (FoodDistributionSupervisorEmployee) account.getEmployee();
    lblNumber.setVisible(false);
    txtNumber.setVisible(false);
    btnSubmit.setVisible(false);
    tblFoodDistribution.getTableHeader().setFont(new Font("Tahoma", Font.PLAIN, 18));
    tblFoodDistributionHistory.getTableHeader().setFont(new Font("Tahoma", Font.PLAIN, 18));
    populateTable();
    populateHistoryTable();
}

From source file:org.jfree.demo.TextBlockDemo.java

/**
 * Creates the content pane for the demo frame.
 *
 * @return The content pane.//from   w ww  .ja va  2 s  .c om
 */
private JPanel createContentPane() {
    final JPanel content = new TextBlockPanel(
            "This is some really long text that we will use "
                    + "for testing purposes.  You'll need to resize the window to see how the TextBlock "
                    + "is dynamically updated.  Also note what happens when there is a really long "
                    + "word like ABCDEFGHIJKLMNOPQRSTUVWXYZ (OK, that's not really a word).",
            new Font("Serif", Font.PLAIN, 14));
    return content;
}

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

public ChartPanel createChartPanel() {
    XYDataset dataset = createDataset();
    NumberAxis numberaxis = new NumberAxis("EMAILS");
    numberaxis.setAutoRangeIncludesZero(true);
    numberaxis.setRange(0, dataset.getItemCount(1));
    numberaxis.setVisible(false);//from  w w w  .  j a v a2  s  . c  o m
    NumberAxis numberaxis1 = new NumberAxis("TIME CONSUMED");
    numberaxis1.setAutoRangeIncludesZero(false);
    XYSplineRenderer xysplinerenderer = new XYSplineRenderer();
    XYPlot xyplot = new XYPlot(dataset, numberaxis, numberaxis1, xysplinerenderer);
    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    //xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));
    JFreeChart jfreechart = new JFreeChart("PLAN VALUES FOR '" + sName + "' SCHEDULER",
            new Font(Font.SANS_SERIF, Font.PLAIN, 11), xyplot, true);
    chartPanel = new ChartPanel(jfreechart, true);

    //Creating listener
    chartPanel.addChartMouseListener(new ChartMouseListener() {
        @Override
        public void chartMouseClicked(ChartMouseEvent e) {
            ChartEntity entity = e.getEntity();
            if (entity != null && (entity instanceof XYItemEntity)) {
                XYItemEntity item = (XYItemEntity) entity;
                String chartTitle = "RULE ARRANGEMENT INFORMATION FOR EMAIL \""
                        + dataSource.get(item.getItem()).getEmailName() + "\"";
                createSubChart(
                        new CreateStackedBarChart3D(dataSource.get(item.getItem()), pluginColor, chartTitle)
                                .createChartPanel());
            }
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent e) {
            //DO NOTHING
        }

    });
    return chartPanel;
}

From source file:StreamConverter.java

ShowString(String target, String title) {

    setTitle(title);//from  ww w.  ja v  a  2  s  .c  o  m
    outString = target;

    Font font = new Font("Monospaced", Font.PLAIN, 36);
    fontM = getFontMetrics(font);
    setFont(font);

    int size = 0;
    for (int i = 0; i < outString.length(); i++) {
        size += fontM.charWidth(outString.charAt(i));
    }
    size += 24;

    setSize(size, fontM.getHeight() + 60);
    setLocation(getSize().width / 2, getSize().height / 2);
    show();
}

From source file:mediamatrix.gui.JVMMemoryProfilerPanel.java

public JVMMemoryProfilerPanel() {
    initComponents();/*from   w  w  w  .  j a  va2 s .  c  o m*/
    profiler = new JVMMemoryProfiler(frequency);
    profiler.addListener(new JVMMemoryProfilerListener() {

        @Override
        public void addScore(long t, long f) {
            total.add(new Millisecond(), t);
            free.add(new Millisecond(), f);
        }
    });

    total = new TimeSeries("Total Memory");
    total.setMaximumItemCount(historyCount);
    free = new TimeSeries("Free Memory");
    free.setMaximumItemCount(historyCount);

    final TimeSeriesCollection dataset = new TimeSeriesCollection();
    dataset.addSeries(total);
    dataset.addSeries(free);

    final DateAxis domain = new DateAxis("Time");
    final NumberAxis range = new NumberAxis("Memory");
    domain.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    domain.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
    range.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    range.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
    range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    final XYItemRenderer renderer = new DefaultXYItemRenderer();
    renderer.setSeriesPaint(0, Color.red);
    renderer.setSeriesPaint(1, Color.green);
    renderer.setBaseStroke(new BasicStroke(3f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));

    final XYPlot plot = new XYPlot(dataset, domain, range, renderer);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    domain.setAutoRange(true);
    domain.setLowerMargin(0.0);
    domain.setUpperMargin(0.0);
    domain.setTickLabelsVisible(true);

    final JFreeChart chart = new JFreeChart("JVM Memory Usage", new Font("SansSerif", Font.BOLD, 24), plot,
            true);
    chart.setBackgroundPaint(Color.white);
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4),
            BorderFactory.createLineBorder(Color.black)));
    chart.getLegend().setItemFont(new Font("SansSerif", Font.PLAIN, 12));

    add(chartPanel, BorderLayout.CENTER);
}

From source file:org.epsilonlabs.workflow.execution.example.GraphOutput.java

public GraphOutput(String appname, String graphname, String x, String y) {
    super(appname);
    barChart = ChartFactory.createBarChart(graphname, x, y, dataset, PlotOrientation.VERTICAL, false, true,
            false);/* w w  w.j  av a  2s  .  c o  m*/

    ChartPanel chartPanel = new ChartPanel(barChart);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    int width = new Double(screenSize.getWidth()).intValue() - 100;
    chartPanel.setMaximumDrawHeight(500);
    chartPanel.setMaximumDrawWidth(width);
    chartPanel.setPreferredSize(new java.awt.Dimension(width, 500));
    setContentPane(chartPanel);

    Font font = new Font("Dialog", Font.PLAIN, 15);
    barChart.getCategoryPlot().getDomainAxis().setTickLabelFont(font);
    barChart.getCategoryPlot().setColumnRenderingOrder(SortOrder.DESCENDING);

}