Example usage for org.jfree.ui RefineryUtilities centerFrameOnScreen

List of usage examples for org.jfree.ui RefineryUtilities centerFrameOnScreen

Introduction

In this page you can find the example usage for org.jfree.ui RefineryUtilities centerFrameOnScreen.

Prototype

public static void centerFrameOnScreen(final Window frame) 

Source Link

Document

Positions the specified frame in the middle of the screen.

Usage

From source file:com.bbn.c2s2.pint.testdata.chart.ScatterPlot.java

public void toScreen() {
    this.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);
}

From source file:org.physionet.graphics.Plot.java

public void showPlot() {
    this.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);
}

From source file:net.sf.jclal.gui.view.components.chart.ExternalBasicChart.java

/**
 *
 * @param args NOT IN USE./*from  ww w  .java 2  s . c  om*/
 */
public static void main(String[] args) {

    SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {

            ExternalBasicChart demo = new ExternalBasicChart("Active learning " + "process", "",
                    "Number of labeled instances");
            demo.pack();
            RefineryUtilities.centerFrameOnScreen(demo);
            demo.setVisible(true);
        }
    });

}

From source file:Negocio.Produccion.Planificacion.GanttManager.java

public static ChartFrame getFrameGantt(String titulo, PlanProduccion plan, JDialog parent) {
    ChartFrame af = new ChartFrame(parent);
    final IntervalCategoryDataset dataset = createDataset(plan);
    final JFreeChart chart = createChart(dataset);

    // add the chart to a panel...
    final ChartPanel chartPanel = new ChartPanel(chart);
    af.setTitle(titulo);/*  w  w w  .  jav  a  2s. c  o m*/
    af.setContentPane(chartPanel);
    af.pack();
    RefineryUtilities.centerFrameOnScreen(af);
    return af;

}

From source file:de.kletterfreak98.xmass.ui.BMIChart.java

public void start() {
    JFrame frame = this;
    frame.setSize(new Dimension(1000, 500));
    frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    RefineryUtilities.centerFrameOnScreen(frame);
    frame.setVisible(true);//from ww  w .  j a v a2s .  c  om
}

From source file:application.logik.Logik.java

public void stats() {
    //http://www.math.hu-berlin.de/~ccafm/lehre_BZQ_Numerik/allg/JAVA_Pakete/JFreeChart/Codes/PieChart_code.html
    //JFreeChart Library (GNU License deshalb benutzen wir die MIT-Lizenz)
    long[] arr = new long[3];
    arr[0] = trT;// w  w  w  .ja  v a2s  .co m
    arr[2] = trR;
    arr[1] = trC;
    arr[step] += trackStop();
    String[] timeText = new String[3];
    for (int i = 0; i < timeText.length; i++) {
        arr[i] = arr[i] / 1000;
        long sek = arr[i] % 60;
        long min = arr[i] / 60;
        if (sek < 10) {
            timeText[i] = min + " : 0" + sek;
        } else {
            timeText[i] = min + " : " + sek;
        }
    }
    long ges = (trT + trR + trC) / 100;
    DefaultPieDataset pieDataset = new DefaultPieDataset();
    pieDataset.setValue("Red: " + timeText[0] + "min", ges * arr[0]);
    pieDataset.setValue("Refactor: " + timeText[2] + "min", ges * arr[2]);
    pieDataset.setValue("Green: " + timeText[1] + "min", ges * arr[1]);

    JFreeChart chart = ChartFactory.createPieChart("Time", pieDataset, true, false, false);
    ChartFrame frame = new ChartFrame("Chart", chart);
    frame.pack();
    RefineryUtilities.centerFrameOnScreen(frame);
    frame.setVisible(true);
}

From source file:es.bsc.autonomic.powermodeller.graphics.TotalPowerAndPredictionDifference.java

public void display() {
    this.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);
}

From source file:org.matsim.contrib.parking.parkingchoice.PC2.analysis.ParkingGroupOccupancies.java

public void showPlot() {
    final LineChart lineChart = new LineChart(xySeriesCollection, "Parking Group Occupancies");
    lineChart.pack();// www.j  a  v a 2s . c o m
    RefineryUtilities.centerFrameOnScreen(lineChart);
    lineChart.setVisible(true);
}

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

public static BNCategoryPlot startPlot(String title, String[] series) {
    BNCategoryPlot demo = new BNCategoryPlot(title, series);
    demo.pack();/*ww  w  .j a  va2 s.c  om*/
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
    return demo;
}