Java Code Examples for org.jfree.ui.RefineryUtilities#centerFrameOnScreen()

The following examples show how to use org.jfree.ui.RefineryUtilities#centerFrameOnScreen() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PieChartDemo1.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {

    // ******************************************************************
    //  More than 150 demo applications are included with the JFreeChart
    //  Developer Guide...for more information, see:
    //
    //  >   http://www.object-refinery.com/jfreechart/guide.html
    //
    // ******************************************************************

    PieChartDemo1 demo = new PieChartDemo1("JFreeChart: Pie Chart Demo 1");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 2
Source File: DialogFactory.java    From cst with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static Property getProperty() {

    DialogFactory dialog = new DialogFactory(null,true);
    dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    //dialog.setBounds(350, 350, 200, 200);
    dialog.setTitle("Enter Property data ...");
    dialog.jValue.setEditable(false);
    dialog.jValue.setEnabled(false);
    RefineryUtilities.centerFrameOnScreen(dialog);
    dialog.setVisible(true);
    dialog.dispose();
    if (dialog.ok == true) {
        Property output = new Property(dialog.jName.getText());
        return(output);
    }
    else return(null);
}
 
Example 3
Source File: PieChartDemo1.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {

    // ******************************************************************
    //  More than 150 demo applications are included with the JFreeChart
    //  Developer Guide...for more information, see:
    //
    //  >   http://www.object-refinery.com/jfreechart/guide.html
    //
    // ******************************************************************

    PieChartDemo1 demo = new PieChartDemo1("JFreeChart: Pie Chart Demo 1");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 4
Source File: PieChartDemo1.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {

    // ******************************************************************
    //  More than 150 demo applications are included with the JFreeChart
    //  Developer Guide...for more information, see:
    //
    //  >   http://www.object-refinery.com/jfreechart/guide.html
    //
    // ******************************************************************

    PieChartDemo1 demo = new PieChartDemo1("JFreeChart: Pie Chart Demo 1");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 5
Source File: PlotFrame.java    From hortonmachine with GNU General Public License v3.0 5 votes vote down vote up
public void plot() {
    JFreeChart chart = ichart.getChart();
    ChartPanel chartPanel = new ChartPanel(chart, true);
    chartPanel.setPreferredSize(new Dimension(chartWidth, chartHeight));
    setContentPane(chartPanel);

    pack();
    RefineryUtilities.centerFrameOnScreen(this);
    setVisible(true);
    setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
}
 
Example 6
Source File: DateChooserPanelDemo.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    DateChooserPanelDemo demo = new DateChooserPanelDemo(
        "DateChooserPanel Demo");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 7
Source File: TextBlockDemo.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * The starting point for the demo.
 *
 * @param args  ignored.
 */
public static void main(final String[] args) {

    final TextBlockDemo demo = new TextBlockDemo("TextBlock Demo");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}
 
Example 8
Source File: TimeSeriesChartDemo1.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {

    TimeSeriesChartDemo1 demo = new TimeSeriesChartDemo1(
            "Time Series Chart Demo 1");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}
 
Example 9
Source File: CombinedCategoryPlotDemo1.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    String title = "Combined Category Plot Demo 1";
    CombinedCategoryPlotDemo1 demo = new CombinedCategoryPlotDemo1(title);
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 10
Source File: CombinedCategoryPlotDemo1.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    String title = "Combined Category Plot Demo 1";
    CombinedCategoryPlotDemo1 demo = new CombinedCategoryPlotDemo1(title);
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 11
Source File: SingleTimestepRegressionExample.java    From dl4j-tutorials with MIT License 5 votes vote down vote up
/**
 * Generate an xy plot of the datasets provided.
 */
private static void plotDataset(XYSeriesCollection c) {

    String title = "Regression example";
    String xAxisLabel = "Timestep";
    String yAxisLabel = "Number of passengers";
    PlotOrientation orientation = PlotOrientation.VERTICAL;
    boolean legend = true;
    boolean tooltips = false;
    boolean urls = false;
    JFreeChart chart = ChartFactory.createXYLineChart(title, xAxisLabel, yAxisLabel, c, orientation, legend, tooltips, urls);

    // get a reference to the plot for further customisation...
    final XYPlot plot = chart.getXYPlot();

    // Auto zoom to fit time series in initial window
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setAutoRange(true);

    JPanel panel = new ChartPanel(chart);

    JFrame f = new JFrame();
    f.add(panel);
    f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    f.pack();
    f.setTitle("Training Data");

    RefineryUtilities.centerFrameOnScreen(f);
    f.setVisible(true);
}
 
Example 12
Source File: GraphPlot.java    From NSGA-II with MIT License 5 votes vote down vote up
public void plot(String xAxisTitle, String yAxisTitle) {

		if(!GraphPlot.isCompatible(this.objectives)) return;
		if(this.dataset.getSeriesCount() < 1) {
			System.out.println("\nNothing to plot!\n");
			return;
		}

		this.configure(xAxisTitle, yAxisTitle);
		this.pack();
		RefineryUtilities.centerFrameOnScreen(this);
		this.setVisible(true);
	}
 
Example 13
Source File: Algorithm.java    From NSGA-II with MIT License 5 votes vote down vote up
public static void main(String[] args) throws IOException {
    
    Configuration.configure();
    
    GraphPlot multiPlotGraph = new GraphPlot();
    
    Reporter.reportInitialParentPopulationGeneration();
    Reporter.reportGeneration(1);
    
    Population parent = NSGAII.preparePopulation(Synthesis.syntesizePopulation());
    Population child = Synthesis.synthesizeChild(parent);
    Population combinedPopulation;
    
    for(int generation = 1; generation <= Configuration.GENERATIONS; generation++) {
        
        Reporter.reportGeneration(generation + 1);
        
        combinedPopulation = NSGAII.preparePopulation(Synthesis.createCombinedPopulation(parent, child));
        parent = NSGAII.getChildFromCombinedPopulation(combinedPopulation);
        child = Synthesis.synthesizeChild(parent);
        
        multiPlotGraph.prepareMultipleDataset(child, generation, "gen. " + generation);
    }
    
    Reporter.reportGraphPlotAlert();
    Reporter.render2DGraph(child);
    
    /**
     * the plotted and rendered chart/graph is viewed to the user.
     */
    multiPlotGraph.configureMultiplePlotter(Configuration.getXaxisTitle(), Configuration.getYaxisTitle(), "All Pareto");
    multiPlotGraph.pack();
    RefineryUtilities.centerFrameOnScreen(multiPlotGraph);
    multiPlotGraph.setVisible(true);
    
    Reporter.reportAlgorithmEnd();
}
 
Example 14
Source File: CombinedXYPlotDemo1.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    CombinedXYPlotDemo1 demo = new CombinedXYPlotDemo1(
            "JFreeChart : CombinedXYPlotDemo1");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 15
Source File: BarChartDemo1.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    BarChartDemo1 demo = new BarChartDemo1("JFreeChart: BarChartDemo1.java");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 16
Source File: BarChartDemo1.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.
 */
public static void main(String[] args) {
    BarChartDemo1 demo = new BarChartDemo1("JFreeChart: BarChartDemo1.java");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}
 
Example 17
Source File: DialogFactory.java    From cst with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void editAbstractObject(AbstractObject ao) {
    DialogFactory dialog = new DialogFactory(null,true);
    dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    //dialog.setBounds(350, 350, 200, 200);
    dialog.setTitle("Edit AbstractObject data ...");
    dialog.jValue.setEditable(false);
    dialog.jValue.setEnabled(false);
    dialog.jName.setText(ao.getName());
    RefineryUtilities.centerFrameOnScreen(dialog);
    dialog.setVisible(true);
    dialog.dispose();
    if (dialog.ok == true) {
       ao.setName(dialog.jName.getText());
    }
}
 
Example 18
Source File: StlPlotter.java    From stl-java with Apache License 2.0 4 votes vote down vote up
static void plotOnScreen(final StlResult stlResult, final String title) {
  final ResultsPlot plot = new ResultsPlot(stlResult, title, Minute.class);
  plot.pack();
  RefineryUtilities.centerFrameOnScreen(plot);
  plot.setVisible(true);
}
 
Example 19
Source File: KafkaFT.java    From flink-perf with Apache License 2.0 4 votes vote down vote up
public static void main(String args[]) throws Exception {
	KafkaFT timeseriesdemo6 = new KafkaFT("Flink Exactly Once Processing", args[0], args[1]);
	timeseriesdemo6.pack();
	RefineryUtilities.centerFrameOnScreen(timeseriesdemo6);
	timeseriesdemo6.setVisible(true);
}
 
Example 20
Source File: Reporter.java    From NSGA-II with MIT License 3 votes vote down vote up
public static void render2DGraph(final Population population) {
    
    if(Configuration.objectives.size() > 2) {
        System.out.println("\n\nThis Implementation has more than 2 objectives and cannot be plotted on a 2D graph. Either minimize objectives to 2, or use other plotting implemenataions.\n\n"); return;
    }
    
    GraphPlot graph = new GraphPlot(population);
            
    graph.configurePlotter(Configuration.getXaxisTitle(), Configuration.getYaxisTitle());
    graph.pack();

    RefineryUtilities.centerFrameOnScreen(graph);

    graph.setVisible(true);
}