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.SurveyResultsDemo1.java

public static void main(String args[]) {
    SurveyResultsDemo1 surveyresultsdemo1 = new SurveyResultsDemo1("Survey Results Demo 1");
    surveyresultsdemo1.pack();//ww  w. jav  a  2 s . c  o  m
    RefineryUtilities.centerFrameOnScreen(surveyresultsdemo1);
    surveyresultsdemo1.setVisible(true);
}

From source file:nodeconfig.BarChart_parameters.java

public static void putBar() {
    BarChart_parameters chart = new BarChart_parameters("Node Statistics", "Parameters");
    chart.pack();//from   w ww. j  ava 2  s.  c o  m
    RefineryUtilities.centerFrameOnScreen(chart);
    chart.setVisible(true);
}

From source file:jfree.GraficoDeBarras.java

public GraficoDeBarras(String tituloGrafico, String label, float[][] valores) {
    super(tituloGrafico);
    convertirValoresADouble(valores);/*from   www.j a  va  2  s  .  c o  m*/
    this.label = label;
    JFreeChart barChart = ChartFactory.createBarChart(tituloGrafico, "Intervalo", "Frecuencia", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);
    pack();
    RefineryUtilities.centerFrameOnScreen(this);
    setVisible(true);
}

From source file:view.PieChartDemo1.java

public PieChartDemo1(String title, double on, double off) {
    super(title);
    online = on;//from  www.  ja  v  a  2  s.c o  m
    offline = off;

    online = (online / (online + offline)) * 100;
    offline = 100 - online;

    setContentPane(createDemoPanel());
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    this.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);
}

From source file:exemploJFreeChart.TelaGrafico.java

public TelaGrafico() {
    janela = new ApplicationFrame("Exemplo JFreeChart");
    janela.setDefaultCloseOperation(ApplicationFrame.EXIT_ON_CLOSE);

    JFreeChart graficoLinha = ChartFactory.createLineChart("Titulo do Grafico", "Nome do eixo X",
            "Nome do eixo Y", criarDataset(), // mtodo que cria os dados do grfico
            PlotOrientation.VERTICAL, true, true, false); // legenda, tooltips, urls

    ChartPanel painelGrafico = new ChartPanel(graficoLinha);
    painelGrafico.setPreferredSize(new Dimension(600, 400));

    janela.setContentPane(painelGrafico);
    janela.pack();/*  w ww  .  j  a va 2s.  c om*/
    RefineryUtilities.centerFrameOnScreen(janela);
}

From source file:tools.descartes.bungee.chart.ChartFrame.java

public ChartFrame(final String title, JFreeChart chart, int width, int height, boolean visible) {
    super(title);

    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(width, height));
    chartPanel.setMouseZoomable(true, false);
    setContentPane(chartPanel);//from  ww  w  .j a v a2  s . co  m

    pack();
    RefineryUtilities.centerFrameOnScreen(this);
    setVisible(visible);
}

From source file:nodeconfig.FinalFuzzyChart.java

public static void putBar(ArrayList<String> fuzzydelay1, ArrayList<String> fuzzyploss1,
        ArrayList<String> fuzzytrate1) {
    fuzzyploss = fuzzyploss1;//from w  w w  .  j a va  2  s.c o m
    fuzzytrate = fuzzytrate1;
    fuzzydelay = fuzzydelay1;
    // System.out.println("Check: "+fuzzyploss+fuzzydelay+fuzzytrate);
    FinalFuzzyChart chart = new FinalFuzzyChart("Fuzzification", "Fuzzy Values");
    chart.pack();
    RefineryUtilities.centerFrameOnScreen(chart);
    chart.setVisible(true);
}

From source file:javatest.IndicatorsToChart.java

/**
 * Displays a chart in a frame.//from  w  w  w.j a  v  a  2s .co  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(1000, 540));
    // Application frame
    ApplicationFrame frame = new ApplicationFrame("neli - Indicators to chart");
    frame.setContentPane(panel);
    frame.pack();
    RefineryUtilities.centerFrameOnScreen(frame);
    frame.setVisible(true);
}

From source file:taller.GraficoTorta.java

public GraficoTorta(int posX, int posY, double[] datos, String[] labels, String titulo) {

    super("");
    try {//w w  w  .j ava2  s.co m

        DefaultPieDataset defaultpiedataset = new DefaultPieDataset();

        for (int i = 0; i < datos.length; i++)
            defaultpiedataset.setValue(labels[i], datos[i]);

        JFreeChart jfreechart = ChartFactory.createPieChart3D(titulo, defaultpiedataset, true, true, false);
        PiePlot3D pieplot3d = (PiePlot3D) jfreechart.getPlot();
        pieplot3d.setDarkerSides(true);
        pieplot3d.setStartAngle(0D);
        pieplot3d.setDirection(Rotation.CLOCKWISE);
        pieplot3d.setForegroundAlpha(0.75F);
        pieplot3d.setNoDataMessage("No hay Datos que Mostrar");

        jpanel = new ChartPanel(jfreechart);
        jpanel.setPreferredSize(new Dimension(300, 300));
        setContentPane(jpanel);
        pack();
        RefineryUtilities.centerFrameOnScreen(this);
    } catch (Exception e) {
    }
}

From source file:gui.Histograma.java

/**
 *
 * @param amostra//from  w  w  w  . j av  a2  s .c  o  m
 */
public Histograma(ArrayList<Double> amostra, double min, double max) {
    super("Histograma");
    this.amostra = amostra;
    this.min = min;
    this.max = max;

    //Atribuir grfico ao JPanel
    JPanel panelHist = preencherPanel();
    panelHist.setPreferredSize(new java.awt.Dimension(500, 475));
    setContentPane(panelHist);

    //Visibilidade da tela
    this.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    this.setVisible(true);

    //Adicionando cone
    setIconImage(iconeTitulo);
}