Example usage for org.jfree.util Rotation CLOCKWISE

List of usage examples for org.jfree.util Rotation CLOCKWISE

Introduction

In this page you can find the example usage for org.jfree.util Rotation CLOCKWISE.

Prototype

Rotation CLOCKWISE

To view the source code for org.jfree.util Rotation CLOCKWISE.

Click Source Link

Document

Clockwise.

Usage

From source file:net.nosleep.superanalyzer.analysis.views.EncodingKindView.java

private void createChart() {

    _chart = ChartFactory.createPieChart3D(Misc.getString("KINDS_OF_MUSIC_FILES"), _dataset, false, true,
            false);/*from  w ww. ja v  a  2 s. com*/

    PiePlot3D plot = (PiePlot3D) _chart.getPlot();
    plot.setDarkerSides(true);
    plot.setStartAngle(PieRotator.angle);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");
    plot.setInsets(new RectangleInsets(10, 10, 10, 10));
    plot.setOutlineVisible(false);
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})"));

    _chart.addSubtitle(HomePanel.createSubtitle(Misc.getString("KINDS_OF_MUSIC_FILES_SUBTITLE")));

    ChartUtilities.applyCurrentTheme(_chart);
    plot.setBackgroundPaint(Color.white);
    _chart.setBorderVisible(false);

    plot.setIgnoreZeroValues(true);

    // plot.setAutoPopulateSectionPaint(false);

    // Misc.formatChart(plot);
}

From source file:edu.ucla.stat.SOCR.chart.demo.PieChart3DDemo1.java

/**
 * Creates a sample chart./*from   ww w  .  j a  v a 2  s  .  c om*/
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
protected JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart3D(chartTitle, // chart title
            dataset, // data
            !legendPanelOn, // include legend
            true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);

    /*   for (int i=0; i<pulloutFlag.length; i++){
          //System.out.println("\""+pulloutFlag[i]+"\"");
          if (pulloutFlag[i].equals("1")){
      Comparable key = dataset.getKey(i);
      plot.setExplodePercent(key, 0.30);
          }
       }*/

    plot.setNoDataMessage("No data to display");

    if (rotateOn) {
        Rotator rotator = new Rotator(plot);
        rotator.start();
    }

    setCategorySummary(dataset);
    return chart;

}

From source file:gui.images.CodebookVectorProfilePanel.java

/**
 * Sets the data to be shown./*from  w w w.j a v a  2s  .c  o  m*/
 *
 * @param occurrenceProfile Double array that is the neighbor occurrence
 * profile of this visual word.
 * @param codebookIndex Integer that is the index of this visual word.
 * @param classColors Color[] of class colors.
 * @param classNames String[] of class names.
 */
public void setResults(double[] occurrenceProfile, int codebookIndex, Color[] classColors,
        String[] classNames) {
    int numClasses = Math.min(classNames.length, occurrenceProfile.length);
    this.codebookIndex = codebookIndex;
    this.occurrenceProfile = occurrenceProfile;
    DefaultPieDataset pieData = new DefaultPieDataset();
    for (int cIndex = 0; cIndex < numClasses; cIndex++) {
        pieData.setValue(classNames[cIndex], occurrenceProfile[cIndex]);
    }
    JFreeChart chart = ChartFactory.createPieChart3D("codebook vect " + codebookIndex, pieData, true, true,
            false);
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    PieRenderer prend = new PieRenderer(classColors);
    prend.setColor(plot, pieData);
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new Dimension(140, 140));
    chartPanel.setVisible(true);
    chartPanel.revalidate();
    chartPanel.repaint();
    JPanel jp = new JPanel();
    jp.setPreferredSize(new Dimension(140, 140));
    jp.setMinimumSize(new Dimension(140, 140));
    jp.setMaximumSize(new Dimension(140, 140));
    jp.setSize(new Dimension(140, 140));
    jp.setLayout(new FlowLayout());
    jp.add(chartPanel);
    jp.setVisible(true);
    jp.validate();
    jp.repaint();

    JFrame frame = new JFrame();
    frame.setBackground(Color.WHITE);
    frame.setUndecorated(true);
    frame.getContentPane().add(jp);
    frame.pack();
    BufferedImage bi = new BufferedImage(jp.getWidth(), jp.getHeight(), BufferedImage.TYPE_INT_ARGB);
    Graphics2D graphics = bi.createGraphics();
    jp.print(graphics);
    graphics.dispose();
    frame.dispose();
    imPanel.removeAll();
    imPanel.setImage(bi);
    imPanel.setVisible(true);
    imPanel.revalidate();
    imPanel.repaint();
}

From source file:de.main.sessioncreator.ReportingHelper.java

/**
 * Creates a chart//from  w ww.j  a  va  2 s.co  m
 */
private JFreeChart createChart(PieDataset dataset, String title) {

    //        JFreeChart chart = ChartFactory.createPieChart3D(
    JFreeChart chart = ChartFactory.createPieChart(title, // chart title
            dataset, // data
            false, // include legend
            true, false);

    //        PiePlot3D plot = (PiePlot3D) chart.getPlot();
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} = {2}", NumberFormat.getNumberInstance(),
            NumberFormat.getPercentInstance()));
    plot.setStartAngle(90);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    return chart;

}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.UserDiskSpace.java

/** Builds and lays out the GUI. */
void buildGUI() {
    data.removeAll();/*from  w w w . ja v a 2 s.c  om*/
    DiskQuota quota = view.isDiskSpaceLoaded();
    if (quota != null) {
        DefaultPieDataset dataset = new DefaultPieDataset();
        long free = quota.getAvailableSpace();
        long used = quota.getUsedSpace();
        if (free < 0 || used < 0) {
            buildChartNotAvailable();
            return;
        }
        dataset.setValue("Free " + UIUtilities.formatFileSize(free), free);
        dataset.setValue("Used " + UIUtilities.formatFileSize(used), used);
        try {
            JFreeChart chart = ChartFactory.createPieChart3D("", dataset, false, true, false);
            PiePlot3D plot = (PiePlot3D) chart.getPlot();
            plot.setDirection(Rotation.CLOCKWISE);
            plot.setForegroundAlpha(0.55f);
            data.add(new ChartPanel(chart), BorderLayout.CENTER);
        } catch (Exception e) {
            buildChartNotAvailable();
        }

    } else {
        JXBusyLabel busyLabel = new JXBusyLabel();
        busyLabel.setBackground(UIUtilities.BACKGROUND_COLOR);
        busyLabel.setEnabled(true);
        busyLabel.setBusy(true);
        JPanel p = UIUtilities.buildComponentPanelCenter(busyLabel);
        p.setBackground(UIUtilities.BACKGROUND_COLOR);
        data.add(p, BorderLayout.CENTER);
    }
    revalidate();
    repaint();
}

From source file:edu.ucla.stat.SOCR.chart.demo.PieChart3DDemo3.java

/**
 * Creates a sample chart.//ww  w . j a v a  2s  . c  om
 * 
 * @param dataset  the dataset.
 * 
 * @return A chart.
 */
protected JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart3D(chartTitle, // chart title
            dataset, // data
            !legendPanelOn, // include legend
            true, false);

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");
    plot.setLabelGenerator(new CustomPieSectionLabelGenerator());

    for (int i = 0; i < pulloutFlag.length; i++) {
        //System.out.println("\""+pulloutFlag[i]+"\"");
        if (pulloutFlag[i].equals("1")) {
            Comparable key = dataset.getKey(i);
            plot.setExplodePercent(key, 0.30);
        }
    }
    if (rotateOn) {
        Rotator rotator = new Rotator(plot);
        rotator.start();
    }
    setCategorySummary(dataset);
    return chart;

}

From source file:net.nosleep.superanalyzer.analysis.views.RatingView.java

private void createChart() {
    _chart = ChartFactory.createPieChart3D(Misc.getString("SONG_RATINGS"), _dataset, false, true, false);

    PiePlot3D plot = (PiePlot3D) _chart.getPlot();
    plot.setDarkerSides(true);/*from   w  w  w  .  j a v a  2  s. c o  m*/
    plot.setStartAngle(PieRotator.angle);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage(Misc.getString("NO_DATA_TO_DISPLAY"));
    plot.setInsets(new RectangleInsets(10, 10, 10, 10));
    plot.setOutlineVisible(false);
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})"));

    _chart.addSubtitle(HomePanel.createSubtitle(Misc.getString("SONG_RATINGS_SUBTITLE")));

    ChartUtilities.applyCurrentTheme(_chart);
    plot.setBackgroundPaint(Color.white);
    _chart.setBorderVisible(false);
}

From source file:org.openmicroscopy.shoola.util.ui.graphutils.PieChart.java

/** 
 * Creates the chart./* w  w w . j a va 2s .c o  m*/
 * @see ChartObject#createChar()
 */
void createChart() {
    chart = ChartFactory.createPieChart3D(title, dataset, false, true, false);
    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    if (backgroundImage != null) {
        plot.setBackgroundImage(backgroundImage);
    }
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.55f);
}

From source file:net.nosleep.superanalyzer.analysis.views.QualityView.java

private void createChart() {

    _chart = ChartFactory.createPieChart3D(Misc.getString("SONG_QUALITY"), _dataset, false, true, false);

    PiePlot3D plot = (PiePlot3D) _chart.getPlot();
    plot.setDarkerSides(true);/*  w ww  .  ja v a  2 s  .com*/
    plot.setStartAngle(PieRotator.angle);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage(Misc.getString("NO_DATA_TO_DISPLAY"));
    plot.setInsets(new RectangleInsets(10, 10, 10, 10));
    plot.setOutlineVisible(false);
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})"));

    _chart.addSubtitle(HomePanel.createSubtitle(Misc.getString("SONG_QUALITY_SUBTITLE")));

    ChartUtilities.applyCurrentTheme(_chart);
    plot.setBackgroundPaint(Color.white);
    _chart.setBorderVisible(false);
}

From source file:com.orange.atk.atkUI.coregui.StatisticTool.java

/**
 * Creates the chart.//from w  w  w  .ja  va 2 s .  c  om
 * 
 * @param piedataset
 *            the data set
 * @return the created chart
 */
private JFreeChart createChart(PieDataset piedataset) {
    JFreeChart jfreechart = ChartFactory.createPieChart3D("", piedataset, true, true, false);
    jfreechart.setBackgroundPaint(Color.lightGray);
    PiePlot pie3dplot = (PiePlot) jfreechart.getPlot();
    pie3dplot.setStartAngle(0);
    pie3dplot.setDirection(Rotation.CLOCKWISE);
    pie3dplot.setForegroundAlpha(0.5F);
    pie3dplot.setNoDataMessage("No data to display");
    pie3dplot.setSectionPaint(0, Color.GREEN);// passed
    pie3dplot.setSectionPaint(1, Color.RED);// failed
    pie3dplot.setSectionPaint(2, Color.ORANGE);// skipped
    pie3dplot.setSectionPaint(3, Color.LIGHT_GRAY);// not analysed
    pie3dplot.setToolTipGenerator(new MyToolTipGenerator());
    pie3dplot.setLabelGenerator(new MySectionLabelGenerator());
    pie3dplot.setLegendLabelGenerator(new MySectionLabelGenerator());
    return jfreechart;
}