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:org.jfree.chart.demo.XYTickLabelDemo.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored./*from  w w w. j ava 2s.  c o  m*/
 */
public static void main(final String[] args) {

    final XYTickLabelDemo demo = new XYTickLabelDemo("Tick Label Demo");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:OverlaidXYPlotDemo2.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.//w  ww.  ja  v  a  2 s . c o m
 */
public static void main(final String[] args) {

    final OverlaidXYPlotDemo2 demo = new OverlaidXYPlotDemo2("Overlaid XYPlot Demo");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

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

public static void main(String args[]) {
    CandlestickChartDemo1 candlestickchartdemo1 = new CandlestickChartDemo1("JFreeChart : Candlestick Demo 1");
    candlestickchartdemo1.pack();/*from   w ww  .  j ava 2  s .  c  o m*/
    RefineryUtilities.centerFrameOnScreen(candlestickchartdemo1);
    candlestickchartdemo1.setVisible(true);
}

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

public static void main(String args[]) {
    HighLowChartDemo1 highlowchartdemo1 = new HighLowChartDemo1("High-Low-Open-Close Demo");
    highlowchartdemo1.pack();/*from   w w w.  j a  v  a 2s  .co m*/
    RefineryUtilities.centerFrameOnScreen(highlowchartdemo1);
    highlowchartdemo1.setVisible(true);
}

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

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.//w w w.ja  v a  2 s.c  o  m
 */
public static void main(final String[] args) {

    final MultiShapesXYDemo demo = new MultiShapesXYDemo("XYPlot With Multiple Shapes");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:gov.llnl.lc.infiniband.opensm.plugin.gui.bargraph.AnimatedBarGraph.java

/**
 * Starting point for the demonstration application.
 * //from   www .  j a v a 2 s . c  om
 * @param args
 *          ignored.
 */
public static void main(String[] args) {
    // take three arguments
    //
    // arg 1 is the filename
    // arg 2 is the portcounter 
    // arg 3, if it exists, is the node guid (if none supplied, assume entire fabric)

    //    String fileName = "/home/meier3/.smt/vrelic.hst";
    String fileName = "/home/meier3/.smt/cabHist.his";
    PortCounterName pcName = PortCounterName.xmit_data;
    //  PortCounterName pcName = PortCounterName.rcv_data;
    //  PortCounterName pcName = PortCounterName.symbol_err_cnt;
    //  PortCounterName pcName = PortCounterName.rcv_err;
    //  PortCounterName pcName = PortCounterName.link_err_recover;
    //    String fileName = "/home/meier3/.smt/BigFabricDelta.cache";
    //    String fileName = "/home/meier3/.smt/DayFabricDeltaCollection.cache";
    int mSecs = 1500;
    boolean cycle = true;
    //    IB_Guid swGuid = new IB_Guid("66a00ec003003");  // hype
    //    IB_Guid swGuid = new IB_Guid("0002:c902:0048:b718");  // vrelic vulcan leaf switch
    IB_Guid swGuid = new IB_Guid("0006:6a00:e300:4414"); // cab   0006:6a00:e300:4414

    //  /home/meier3/omsRepo/vrelic/vrelic627-2.hst rcv_data 0002:c902:0048:b718
    //  /home/meier3/.smt/cabHist.his rcv_data 0006:6a00:e300:4414

    if ((args.length > 0) && (args[0].length() > 1))
        fileName = args[0];

    //    if((args.length > 1) && (args[1].length() > 1))
    //    {
    //      PortCounterName pc = PortCounterName.getByName(args[1]);
    //      if(pc != null)
    //         pcName = pc;
    //    }
    //
    int numBins = 15;
    boolean excludeZero = true;

    BarGraphDataSeries dataSeries = null;
    if ((args.length > 1) && (args[1].length() > 1)) {
        // convert the argument to guid
        swGuid = new IB_Guid(args[1]); // vrelic vulcan leaf switch
        // just the ports of a single switch (pc rate vs port num)

        ArrayList<PortCounterName> counterNames = new ArrayList<PortCounterName>();
        counterNames.add(PortCounterName.xmit_data);
        counterNames.add(PortCounterName.rcv_data);
        counterNames.add(PortCounterName.rcv_pkts);
        counterNames.add(PortCounterName.xmit_pkts);
        dataSeries = OMS_DataSetFactory.getSwitchPortCounterSeries(fileName, swGuid, counterNames);
    } else {
        // all ports in the system (num ports vs pc rate) <= y, x
        ArrayList<PortCounterName> counterNames = new ArrayList<PortCounterName>();
        counterNames.add(PortCounterName.xmit_data);
        counterNames.add(PortCounterName.rcv_data);
        counterNames.add(PortCounterName.rcv_pkts);
        counterNames.add(PortCounterName.xmit_pkts);
        dataSeries = OMS_DataSetFactory.getPortCounterChangeSeries(fileName, counterNames, numBins,
                excludeZero);
    }

    //set up the basic bar graph
    if ((dataSeries != null) && dataSeries.isValid()) {
        AnimatedBarGraph barGraph = new AnimatedBarGraph(dataSeries, mSecs, cycle);
        barGraph.pack();
        RefineryUtilities.centerFrameOnScreen(barGraph);
        barGraph.setVisible(true);

    } else
        System.err.println("Could not fully construct the data series for the annimated bar graph");
}

From source file:org.altaprise.vawr.charts.demos.StackedBarChartDemo4.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored./*  www.j av  a2 s.  c  o  m*/
 */
public static void main(final String[] args) {
    final StackedBarChartDemo4 demo = new StackedBarChartDemo4("Stacked Bar Chart Demo 4");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}

From source file:org.hxzon.demo.jfreechart.PieDatasetDemo2.java

public static void main(String[] args) {

    PieDatasetDemo2 demo = new PieDatasetDemo2("Pie Dataset Chart Demo");
    demo.pack();/*from ww  w . j ava2  s.c o  m*/
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}

From source file:org.hxzon.demo.jfreechart.DatasetVisibleDemo2.java

public static void main(String[] args) {
    DatasetVisibleDemo2 demo = new DatasetVisibleDemo2("Dataset Visible Demo 2");
    demo.pack();/*  ww w.  j  av a  2s.co  m*/
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}

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

/**
 * The starting point for the demo.//from www .  j  a va2s . co  m
 *
 * @param args  ignored.
 */
public static void main(final String[] args) {

    final DrawStringDemo demo = new DrawStringDemo("DrawString Demo");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}