Search in sources :

Example 1 with ContourPlot

use of org.jfree.chart.plot.ContourPlot in project SIMVA-SoS by SESoS.

the class DefaultPlotEditor method createPlotTabs.

protected JTabbedPane createPlotTabs(Plot plot) {
    JTabbedPane tabs = new JTabbedPane();
    tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    Axis domainAxis = null;
    if (plot instanceof CategoryPlot) {
        domainAxis = ((CategoryPlot) plot).getDomainAxis();
    } else if (plot instanceof XYPlot) {
        domainAxis = ((XYPlot) plot).getDomainAxis();
    }
    this.domainAxisPropertyPanel = DefaultAxisEditor.getInstance(domainAxis);
    if (this.domainAxisPropertyPanel != null) {
        this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel);
    }
    Axis rangeAxis = null;
    if (plot instanceof CategoryPlot) {
        rangeAxis = ((CategoryPlot) plot).getRangeAxis();
    } else if (plot instanceof XYPlot) {
        rangeAxis = ((XYPlot) plot).getRangeAxis();
    } else if (plot instanceof PolarPlot) {
        rangeAxis = ((PolarPlot) plot).getAxis();
    }
    this.rangeAxisPropertyPanel = DefaultAxisEditor.getInstance(rangeAxis);
    if (this.rangeAxisPropertyPanel != null) {
        this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel);
    }
    // dmo: added this panel for colorbar control. (start dmo additions)
    ColorBar colorBar = null;
    if (plot instanceof ContourPlot) {
        colorBar = ((ContourPlot) plot).getColorBar();
    }
    this.colorBarAxisPropertyPanel = DefaultColorBarEditor.getInstance(colorBar);
    if (this.colorBarAxisPropertyPanel != null) {
        this.colorBarAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        tabs.add(localizationResources.getString("Color_Bar"), this.colorBarAxisPropertyPanel);
    }
    return tabs;
}
Also used : ContourPlot(org.jfree.chart.plot.ContourPlot) XYPlot(org.jfree.chart.plot.XYPlot) JTabbedPane(javax.swing.JTabbedPane) PolarPlot(org.jfree.chart.plot.PolarPlot) Axis(org.jfree.chart.axis.Axis) CategoryPlot(org.jfree.chart.plot.CategoryPlot) ColorBar(org.jfree.chart.axis.ColorBar)

Example 2 with ContourPlot

use of org.jfree.chart.plot.ContourPlot in project seng438-a3-R41Ryan by seng438-winter-2022.

the class DefaultPlotEditor method updatePlotProperties.

/**
 * Updates the plot properties to match the properties defined on the panel.
 *
 * @param plot  The plot.
 */
public void updatePlotProperties(Plot plot) {
    // set the plot properties...
    plot.setOutlinePaint(getOutlinePaint());
    plot.setOutlineStroke(getOutlineStroke());
    plot.setBackgroundPaint(getBackgroundPaint());
    plot.setInsets(getPlotInsets());
    // then the axis properties...
    if (this.domainAxisPropertyPanel != null) {
        Axis domainAxis = null;
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            domainAxis = p.getDomainAxis();
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            domainAxis = p.getDomainAxis();
        }
        if (domainAxis != null) {
            this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
        }
    }
    if (this.rangeAxisPropertyPanel != null) {
        Axis rangeAxis = null;
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            rangeAxis = p.getRangeAxis();
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            rangeAxis = p.getRangeAxis();
        } else if (plot instanceof PolarPlot) {
            PolarPlot p = (PolarPlot) plot;
            rangeAxis = p.getAxis();
        }
        if (rangeAxis != null) {
            this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
        }
    }
    if (this.plotOrientation != null) {
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            p.setOrientation(this.plotOrientation);
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            p.setOrientation(this.plotOrientation);
        }
    }
    if (this.drawLines != null) {
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            CategoryItemRenderer r = p.getRenderer();
            if (r instanceof LineAndShapeRenderer) {
                ((LineAndShapeRenderer) r).setLinesVisible(this.drawLines.booleanValue());
            }
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            XYItemRenderer r = p.getRenderer();
            if (r instanceof StandardXYItemRenderer) {
                ((StandardXYItemRenderer) r).setPlotLines(this.drawLines.booleanValue());
            }
        }
    }
    if (this.drawShapes != null) {
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            CategoryItemRenderer r = p.getRenderer();
            if (r instanceof LineAndShapeRenderer) {
                ((LineAndShapeRenderer) r).setShapesVisible(this.drawShapes.booleanValue());
            }
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            XYItemRenderer r = p.getRenderer();
            if (r instanceof StandardXYItemRenderer) {
                ((StandardXYItemRenderer) r).setBaseShapesVisible(this.drawShapes.booleanValue());
            }
        }
    }
    // dmo: added this panel for colorbar control. (start dmo additions)
    if (this.colorBarAxisPropertyPanel != null) {
        ColorBar colorBar = null;
        if (plot instanceof ContourPlot) {
            ContourPlot p = (ContourPlot) plot;
            colorBar = p.getColorBar();
        }
        if (colorBar != null) {
            this.colorBarAxisPropertyPanel.setAxisProperties(colorBar);
        }
    }
// dmo: (end dmo additions)
}
Also used : LineAndShapeRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer) ContourPlot(org.jfree.chart.plot.ContourPlot) XYPlot(org.jfree.chart.plot.XYPlot) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) StandardXYItemRenderer(org.jfree.chart.renderer.xy.StandardXYItemRenderer) PolarPlot(org.jfree.chart.plot.PolarPlot) StandardXYItemRenderer(org.jfree.chart.renderer.xy.StandardXYItemRenderer) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) Axis(org.jfree.chart.axis.Axis) CategoryPlot(org.jfree.chart.plot.CategoryPlot) ColorBar(org.jfree.chart.axis.ColorBar)

Example 3 with ContourPlot

use of org.jfree.chart.plot.ContourPlot in project SIMVA-SoS by SESoS.

the class DefaultPlotEditor method updatePlotProperties.

/**
 * Updates the plot properties to match the properties defined on the panel.
 *
 * @param plot  The plot.
 */
public void updatePlotProperties(Plot plot) {
    // set the plot properties...
    plot.setOutlinePaint(getOutlinePaint());
    plot.setOutlineStroke(getOutlineStroke());
    plot.setBackgroundPaint(getBackgroundPaint());
    plot.setInsets(getPlotInsets());
    // then the axis properties...
    if (this.domainAxisPropertyPanel != null) {
        Axis domainAxis = null;
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            domainAxis = p.getDomainAxis();
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            domainAxis = p.getDomainAxis();
        }
        if (domainAxis != null) {
            this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
        }
    }
    if (this.rangeAxisPropertyPanel != null) {
        Axis rangeAxis = null;
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            rangeAxis = p.getRangeAxis();
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            rangeAxis = p.getRangeAxis();
        } else if (plot instanceof PolarPlot) {
            PolarPlot p = (PolarPlot) plot;
            rangeAxis = p.getAxis();
        }
        if (rangeAxis != null) {
            this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
        }
    }
    if (this.plotOrientation != null) {
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            p.setOrientation(this.plotOrientation);
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            p.setOrientation(this.plotOrientation);
        }
    }
    if (this.drawLines != null) {
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            CategoryItemRenderer r = p.getRenderer();
            if (r instanceof LineAndShapeRenderer) {
                ((LineAndShapeRenderer) r).setLinesVisible(this.drawLines.booleanValue());
            }
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            XYItemRenderer r = p.getRenderer();
            if (r instanceof StandardXYItemRenderer) {
                ((StandardXYItemRenderer) r).setPlotLines(this.drawLines.booleanValue());
            }
        }
    }
    if (this.drawShapes != null) {
        if (plot instanceof CategoryPlot) {
            CategoryPlot p = (CategoryPlot) plot;
            CategoryItemRenderer r = p.getRenderer();
            if (r instanceof LineAndShapeRenderer) {
                ((LineAndShapeRenderer) r).setShapesVisible(this.drawShapes.booleanValue());
            }
        } else if (plot instanceof XYPlot) {
            XYPlot p = (XYPlot) plot;
            XYItemRenderer r = p.getRenderer();
            if (r instanceof StandardXYItemRenderer) {
                ((StandardXYItemRenderer) r).setBaseShapesVisible(this.drawShapes.booleanValue());
            }
        }
    }
    // dmo: added this panel for colorbar control. (start dmo additions)
    if (this.colorBarAxisPropertyPanel != null) {
        ColorBar colorBar = null;
        if (plot instanceof ContourPlot) {
            ContourPlot p = (ContourPlot) plot;
            colorBar = p.getColorBar();
        }
        if (colorBar != null) {
            this.colorBarAxisPropertyPanel.setAxisProperties(colorBar);
        }
    }
// dmo: (end dmo additions)
}
Also used : LineAndShapeRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer) ContourPlot(org.jfree.chart.plot.ContourPlot) XYPlot(org.jfree.chart.plot.XYPlot) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) StandardXYItemRenderer(org.jfree.chart.renderer.xy.StandardXYItemRenderer) PolarPlot(org.jfree.chart.plot.PolarPlot) StandardXYItemRenderer(org.jfree.chart.renderer.xy.StandardXYItemRenderer) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) Axis(org.jfree.chart.axis.Axis) CategoryPlot(org.jfree.chart.plot.CategoryPlot) ColorBar(org.jfree.chart.axis.ColorBar)

Example 4 with ContourPlot

use of org.jfree.chart.plot.ContourPlot in project seng438-a3-R41Ryan by seng438-winter-2022.

the class DefaultPlotEditor method createPlotTabs.

protected JTabbedPane createPlotTabs(Plot plot) {
    JTabbedPane tabs = new JTabbedPane();
    tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    Axis domainAxis = null;
    if (plot instanceof CategoryPlot) {
        domainAxis = ((CategoryPlot) plot).getDomainAxis();
    } else if (plot instanceof XYPlot) {
        domainAxis = ((XYPlot) plot).getDomainAxis();
    }
    this.domainAxisPropertyPanel = DefaultAxisEditor.getInstance(domainAxis);
    if (this.domainAxisPropertyPanel != null) {
        this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel);
    }
    Axis rangeAxis = null;
    if (plot instanceof CategoryPlot) {
        rangeAxis = ((CategoryPlot) plot).getRangeAxis();
    } else if (plot instanceof XYPlot) {
        rangeAxis = ((XYPlot) plot).getRangeAxis();
    } else if (plot instanceof PolarPlot) {
        rangeAxis = ((PolarPlot) plot).getAxis();
    }
    this.rangeAxisPropertyPanel = DefaultAxisEditor.getInstance(rangeAxis);
    if (this.rangeAxisPropertyPanel != null) {
        this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel);
    }
    // dmo: added this panel for colorbar control. (start dmo additions)
    ColorBar colorBar = null;
    if (plot instanceof ContourPlot) {
        colorBar = ((ContourPlot) plot).getColorBar();
    }
    this.colorBarAxisPropertyPanel = DefaultColorBarEditor.getInstance(colorBar);
    if (this.colorBarAxisPropertyPanel != null) {
        this.colorBarAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
        tabs.add(localizationResources.getString("Color_Bar"), this.colorBarAxisPropertyPanel);
    }
    return tabs;
}
Also used : ContourPlot(org.jfree.chart.plot.ContourPlot) XYPlot(org.jfree.chart.plot.XYPlot) JTabbedPane(javax.swing.JTabbedPane) PolarPlot(org.jfree.chart.plot.PolarPlot) Axis(org.jfree.chart.axis.Axis) CategoryPlot(org.jfree.chart.plot.CategoryPlot) ColorBar(org.jfree.chart.axis.ColorBar)

Aggregations

Axis (org.jfree.chart.axis.Axis)4 ColorBar (org.jfree.chart.axis.ColorBar)4 CategoryPlot (org.jfree.chart.plot.CategoryPlot)4 ContourPlot (org.jfree.chart.plot.ContourPlot)4 PolarPlot (org.jfree.chart.plot.PolarPlot)4 XYPlot (org.jfree.chart.plot.XYPlot)4 JTabbedPane (javax.swing.JTabbedPane)2 CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)2 LineAndShapeRenderer (org.jfree.chart.renderer.category.LineAndShapeRenderer)2 StandardXYItemRenderer (org.jfree.chart.renderer.xy.StandardXYItemRenderer)2 XYItemRenderer (org.jfree.chart.renderer.xy.XYItemRenderer)2