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:clientv2.GUI.java

/**
 * Creates a new GUI/*  ww  w  . jav  a2s .c  o m*/
 */
public GUI() {
    initComponents();
    RefineryUtilities.centerFrameOnScreen(this);

    jLabel4.setVisible(false);

    rollGraph.addSeries(roll);
    pitchGraph.addSeries(pitch);

    xGraph.addSeries(setX);
    xGraph.addSeries(actualX);

    yGraph.addSeries(setY);
    yGraph.addSeries(actualY);

    zGraph.addSeries(setZ);
    zGraph.addSeries(actualZ);
}

From source file:vista.montecarlo.GraficoEvolutivo.java

static void mostrar(double[][] costosPromedio) {
    GraficoEvolutivo chart = new GraficoEvolutivo(TITULO_FRAME, TITULO_GRAFICO, costosPromedio);

    chart.pack();//from   w w  w  .  j  a  v a  2  s  .  c  om
    RefineryUtilities.centerFrameOnScreen(chart);
    chart.setVisible(true);
}

From source file:xdevs.lib.util.ScopeView.java

public ScopeView(String windowsTitle, String title, String xTitle, String yTitle) {
    super(windowsTitle);
    XYSeriesCollection dataSet = new XYSeriesCollection();
    serie = new XYSeries(yTitle);
    dataSet.addSeries(serie);//w  ww  .j  av  a2 s. com
    JFreeChart chart = ChartFactory.createXYStepChart(title, xTitle, yTitle, dataSet, PlotOrientation.VERTICAL,
            true, false, false);
    chart.getXYPlot().setDomainAxis(new NumberAxis());
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    chartPanel.setMouseZoomable(true, false);
    setContentPane(chartPanel);
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            dispose();
        }
    });
    super.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);
}

From source file:xdevs.lib.util.ScopeMultiView.java

public ScopeMultiView(String windowsTitle, String title, String xTitle, String yTitle) {
    super(windowsTitle);
    JFreeChart chart = ChartFactory.createXYStepChart(title, xTitle, yTitle, dataSet, PlotOrientation.VERTICAL,
            true, false, false);//from  w ww  . j a  va 2  s.co m
    chart.getXYPlot().setDomainAxis(new NumberAxis());
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    chartPanel.setMouseZoomable(true, false);
    setContentPane(chartPanel);
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            dispose();
        }
    });
    super.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);
}

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

/**
 * Starting point for the demonstration application.
 *
 * @param args  command line options, launch ContourDemoPlot -? for listing of options.
 */// www  . j a va 2  s. com
public static void main(final String[] args) {

    if (!processArgs(args)) {
        System.exit(1);
    }
    final ContourPlotDemo demo = new ContourPlotDemo("ContourPlot Demo");
    demo.setContentPane(demo.panel);
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:ta4jexamples.indicators.IndicatorsToChart.java

/**
 * Displays a chart in a frame./*from   ww  w.j  a v a 2s . c o m*/
 * @param chart the chart to be displayed
 */
private static void displayChart(JFreeChart chart) {
    // Chart panel
    ChartPanel panel = new ChartPanel(chart);
    panel.setFillZoomRectangle(true);
    panel.setMouseWheelEnabled(true);
    panel.setPreferredSize(new java.awt.Dimension(500, 270));
    // Application frame
    ApplicationFrame frame = new ApplicationFrame("Ta4j example - Indicators to chart");
    frame.setContentPane(panel);
    frame.pack();
    RefineryUtilities.centerFrameOnScreen(frame);
    frame.setVisible(true);
}

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

public static void main(String args[]) {
    CrosshairDemo2 crosshairdemo2 = new CrosshairDemo2("Crosshair Demo 2");
    crosshairdemo2.pack();//from  w  w  w  .j  a v  a2s .  c  o  m
    RefineryUtilities.centerFrameOnScreen(crosshairdemo2);
    crosshairdemo2.setVisible(true);
}

From source file:net.anthonypoon.fintech.assignment.one.part2.Plotter.java

private void render(boolean showGraph) {
    chart = ChartFactory.createXYLineChart(this.title, "Index Return", "Stock Return", dataObj,
            PlotOrientation.VERTICAL, true, true, false);
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    XYPlot plot = chart.getXYPlot();/*from ww w  .j  a v a2 s .c  o m*/
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesLinesVisible(0, false);
    renderer.setSeriesShapesVisible(0, true);
    renderer.setSeriesLinesVisible(1, true);
    //renderer.setSeriesShapesVisible(1, false);
    plot.setRenderer(renderer);
    setContentPane(chartPanel);
    if (showGraph) {
        this.pack();
        RefineryUtilities.centerFrameOnScreen(this);
        this.setVisible(true);
    }
}

From source file:org.atomserver.testutils.plot.PerfPlotter.java

public void displayInFrame(int displayTime) {
    ApplicationFrame appFrame = new ApplicationFrame(title);
    appFrame.setContentPane(getChartPanel());

    appFrame.pack();/*from w ww.j  ava 2 s  .c o m*/
    RefineryUtilities.centerFrameOnScreen(appFrame);
    appFrame.setVisible(true);

    try {
        Thread.sleep(displayTime);
    } catch (java.lang.InterruptedException ee) {
    }
}

From source file:phat.audio.listeners.XYRMSAudioChart.java

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