/** * A static method that returns a panel that is appropriate for the axis * type. * * @param axis the axis whose properties are to be displayed/edited in the panel. * * @return a panel or <code>null</code< if axis is <code>null</code>. */ public static AxisPropertyEditPanel getInstance(Axis axis) { if (axis != null) { // figure out what type of axis we have and instantiate the // appropriate panel if (axis instanceof NumberAxis) { return new NumberAxisPropertyEditPanel((NumberAxis) axis); } else { return new AxisPropertyEditPanel(axis); } } else { return null; } }
/** * A static method that returns a panel that is appropriate for the axis * type. * * @param axis the axis whose properties are to be displayed/edited in * the panel. * * @return A panel or <code>null</code< if axis is <code>null</code>. */ public static DefaultAxisEditor getInstance(Axis axis) { if (axis != null) { // figure out what type of axis we have and instantiate the // appropriate panel if (axis instanceof NumberAxis) { return new DefaultNumberAxisEditor((NumberAxis) axis); } else { return new DefaultAxisEditor(axis); } } else { return null; } }
/** * A static method that returns a panel that is appropriate for the axis * type. * * @param axis the axis whose properties are to be displayed/edited in * the panel. * * @return A panel or {@code null} if axis is {@code null}. */ public static DefaultAxisEditor getInstance(Axis axis) { if (axis != null) { // figure out what type of axis we have and instantiate the // appropriate panel if (axis instanceof NumberAxis) { return new DefaultNumberAxisEditor((NumberAxis) axis); } if (axis instanceof LogAxis) { return new DefaultLogAxisEditor((LogAxis) axis); } else { return new DefaultAxisEditor(axis); } } else { return null; } }
protected void setAxisLine(Axis axis, Paint lineColor) { Boolean defaultAxisLineVisible = (Boolean)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_LINE_VISIBLE); if (defaultAxisLineVisible != null && defaultAxisLineVisible.booleanValue()) { Paint linePaint = lineColor != null ? lineColor : (Paint)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_LINE_PAINT); if (linePaint != null) { axis.setAxisLinePaint(linePaint); } Stroke defaultAxisLineStroke = (Stroke)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_LINE_STROKE); if (defaultAxisLineStroke != null) axis.setAxisLineStroke(defaultAxisLineStroke); } }
protected void setAxisTickMarks(Axis axis, Paint lineColor) { Boolean defaultAxisTickMarksVisible = (Boolean)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_TICK_MARKS_VISIBLE); if (defaultAxisTickMarksVisible != null && defaultAxisTickMarksVisible.booleanValue()) { Float defaultAxisTickMarksInsideLength = (Float)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_TICK_MARKS_INSIDE_LENGTH); if (defaultAxisTickMarksInsideLength != null) axis.setTickMarkInsideLength(defaultAxisTickMarksInsideLength.floatValue()); Float defaultAxisTickMarksOutsideLength = (Float)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_TICK_MARKS_OUTSIDE_LENGTH); if (defaultAxisTickMarksOutsideLength != null) axis.setTickMarkInsideLength(defaultAxisTickMarksOutsideLength.floatValue()); Paint tickMarkPaint = getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_TICK_MARKS_PAINT) != null ? (Paint)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_TICK_MARKS_PAINT) : lineColor; if (tickMarkPaint != null) { axis.setTickMarkPaint(tickMarkPaint); } Stroke defaultTickMarkStroke = (Stroke)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_TICK_MARKS_STROKE); if (defaultTickMarkStroke != null) axis.setTickMarkStroke(defaultTickMarkStroke); } }
protected void setAxisLine(Axis axis, Paint lineColor, AxisSettings axisSettings) { Boolean axisLineVisible = axisSettings.getLineVisible(); if (axisLineVisible == null || axisLineVisible.booleanValue()) { Paint linePaint = lineColor; if (linePaint == null && axisSettings.getLinePaint() != null) { linePaint = axisSettings.getLinePaint().getPaint(); } if (linePaint != null) { axis.setAxisLinePaint(linePaint); } Stroke axisLineStroke = axisSettings.getLineStroke(); if (axisLineStroke != null) axis.setAxisLineStroke(axisLineStroke); } else { axis.setAxisLineVisible(false); } }
/** * A static method that returns a panel that is appropriate for the axis * type. * * @param axis the axis whose properties are to be displayed/edited in * the panel. * * @return A panel or <code>null</code< if axis is <code>null</code>. */ public static DefaultAxisEditor getInstance(Axis axis) { if (axis != null) { // figure out what type of axis we have and instantiate the // appropriate panel if (axis instanceof NumberAxis) { return new DefaultNumberAxisEditor((NumberAxis) axis); } if (axis instanceof LogAxis) { return new DefaultLogAxisEditor((LogAxis) axis); } else { return new DefaultAxisEditor(axis); } } else { return null; } }
Axis findAxisOfPanel(JPanel panel, whichAxis wa) { for(Component c: panel.getComponents()) { if(c instanceof PanelWithChart) { PanelWithChart pwc = (PanelWithChart)c; JFreeChart jfc = pwc.getChart(); XYPlot xyp = (XYPlot)jfc.getPlot(); switch(wa) { case Domain: return xyp.getDomainAxis(); case Range: return xyp.getRangeAxis(); default: return null; } } } return null; }
public static void formatAxis(PlotConfiguration plotConfiguration, Axis axis) { Color axisColor = plotConfiguration.getAxisLineColor(); if (axis != null) { axis.setAxisLinePaint(axisColor); axis.setAxisLineStroke(new BasicStroke(plotConfiguration.getAxisLineWidth())); axis.setLabelPaint(axisColor); axis.setTickLabelPaint(axisColor); } }
/** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { axis.setLabel(getLabel()); axis.setLabelFont(getLabelFont()); axis.setLabelPaint(getLabelPaint()); axis.setTickMarksVisible(isTickMarksVisible()); // axis.setTickMarkStroke(getTickMarkStroke()); axis.setTickLabelsVisible(isTickLabelsVisible()); axis.setTickLabelFont(getTickLabelFont()); axis.setTickLabelPaint(getTickLabelPaint()); axis.setTickLabelInsets(getTickLabelInsets()); axis.setLabelInsets(getLabelInsets()); }
/** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); NumberAxis numberAxis = (NumberAxis) axis; numberAxis.setAutoRange(this.autoRange); if (!this.autoRange) { numberAxis.setRange(this.minimumValue, this.maximumValue); } // numberAxis.setGridLinesVisible(this.showGridLinesCheckBox.isSelected()); // numberAxis.setGridPaint(this.gridPaintSample.getPaint()); // numberAxis.setGridStroke(this.gridStrokeSample.getStroke()); }
/** * A static method that returns a panel that is appropriate * for the axis type. * * @param parent the parent. * @param style the style. * @param axis the axis whose properties are to be displayed/edited * in the composite. * @return A composite or <code>null</code< if axis is <code>null</code>. */ public static SWTAxisEditor getInstance(Composite parent, int style, Axis axis) { if (axis != null) { // return the appropriate axis editor if (axis instanceof NumberAxis) return new SWTNumberAxisEditor(parent, style, (NumberAxis) axis ); else return new SWTAxisEditor(parent, style, axis); } else return null; }
/** * Sets the properties of the specified axis to match * the properties defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { axis.setLabel(getLabel()); axis.setLabelFont(getLabelFont()); axis.setLabelPaint(getLabelPaint()); axis.setTickMarksVisible(showTickMarksCheckBox.getSelection()); axis.setTickLabelsVisible(showTickLabelsCheckBox.getSelection()); axis.setTickLabelFont(getTickLabelFont()); axis.setTickLabelPaint(getTickLabelPaint()); }
/** * Sets the properties of the specified axis to match * the properties defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); NumberAxis numberAxis = (NumberAxis) axis; numberAxis.setAutoRange(this.autoRange); if (! this.autoRange) numberAxis.setRange(this.minimumValue, this.maximumValue); }
/** * Two objects that are equal are required to return the same hashCode. */ public void testHashCode() { Axis a1 = new CategoryAxis("Test"); Axis a2 = new CategoryAxis("Test"); assertTrue(a1.equals(a2)); int h1 = a1.hashCode(); int h2 = a2.hashCode(); assertEquals(h1, h2); }
/** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); NumberAxis numberAxis = (NumberAxis) axis; numberAxis.setAutoRange(this.autoRange); if (!this.autoRange) { numberAxis.setRange(this.minimumValue, this.maximumValue); } }
@SuppressWarnings("unchecked") protected final <A extends Axis> A makeAxis(final JFreeChartBuilder.AxisParameters parameters) { if (parameters.isCategory()) { return (A) this.makeCategoryAxis(parameters); } else { return (A) this.makeValueAxis(parameters); } }
/** * A static method that returns a panel that is appropriate * for the axis type. * * @param parent the parent. * @param style the style. * @param axis the axis whose properties are to be displayed/edited * in the composite. * @return A composite or <code>null</code< if axis is <code>null</code>. */ public static SWTAxisEditor getInstance(Composite parent, int style, Axis axis) { if (axis != null) { // return the appropriate axis editor if (axis instanceof NumberAxis) return new SWTNumberAxisEditor(parent, style, (NumberAxis) axis); else return new SWTAxisEditor(parent, style, axis); } else return null; }
/** * Sets the properties of the specified axis to match * the properties defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { axis.setLabel(getLabel()); axis.setLabelFont(getLabelFont()); axis.setLabelPaint(getLabelPaint()); axis.setTickMarksVisible(this.showTickMarksCheckBox.getSelection()); axis.setTickLabelsVisible(this.showTickLabelsCheckBox.getSelection()); axis.setTickLabelFont(getTickLabelFont()); axis.setTickLabelPaint(getTickLabelPaint()); }
/** * Sets the properties of the specified axis to match * the properties defined on this panel. * * @param axis the axis. */ public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); NumberAxis numberAxis = (NumberAxis) axis; numberAxis.setAutoRange(this.autoRange); if (!this.autoRange) { numberAxis.setRange(this.minimumValue, this.maximumValue); } }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.angleGridlineStroke = SerialUtilities.readStroke(stream); this.angleGridlinePaint = SerialUtilities.readPaint(stream); this.radiusGridlineStroke = SerialUtilities.readStroke(stream); this.radiusGridlinePaint = SerialUtilities.readPaint(stream); this.angleLabelPaint = SerialUtilities.readPaint(stream); int rangeAxisCount = this.axes.size(); for (int i = 0; i < rangeAxisCount; i++) { Axis axis = (Axis) this.axes.get(i); if (axis != null) { axis.setPlot(this); axis.addChangeListener(this); } } int datasetCount = this.datasets.size(); for (int i = 0; i < datasetCount; i++) { Dataset dataset = (Dataset) this.datasets.get(i); if (dataset != null) { dataset.addChangeListener(this); } } int rendererCount = this.renderers.size(); for (int i = 0; i < rendererCount; i++) { PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i); if (renderer != null) { renderer.addChangeListener(this); } } }
/** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ @Override public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); ValueAxis valueAxis = (ValueAxis) axis; valueAxis.setAutoRange(this.autoRange); if (!this.autoRange) { valueAxis.setRange(this.minimumValue, this.maximumValue); } valueAxis.setAutoTickUnitSelection(this.autoTickUnitSelection); }
/** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ @Override public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); LogAxis logAxis = (LogAxis) axis; if (!isAutoTickUnitSelection()) { logAxis.setTickUnit(new NumberTickUnit(manualTickUnitValue)); } }
/** * Sets the properties of the specified axis to match the properties * defined on this panel. * * @param axis the axis. */ @Override public void setAxisProperties(Axis axis) { super.setAxisProperties(axis); NumberAxis numberAxis = (NumberAxis) axis; if (!isAutoTickUnitSelection()) { numberAxis.setTickUnit(new NumberTickUnit(manualTickUnitValue)); } }