/** * Receives notification of a renderer change event. * * @param event the event. */ public void rendererChanged(RendererChangeEvent event) { Plot parent = getParent(); if (parent != null) { if (parent instanceof RendererChangeListener) { RendererChangeListener rcl = (RendererChangeListener) parent; rcl.rendererChanged(event); } else { // this should never happen with the existing code, but throw // an exception in case future changes make it possible... throw new RuntimeException( "The renderer has changed and I don't know what to do!"); } } else { configureRangeAxes(); PlotChangeEvent e = new PlotChangeEvent(this); notifyListeners(e); } }
/** * Sets the paint used to highlight negative differences. * * @param paint the paint (<code>null</code> not permitted). * * @see #getNegativePaint() */ public void setNegativePaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.negativePaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the base outline paint and, if requested, sends a {@link RendererChangeEvent} to all * registered listeners. * * @param paint the paint (<code>null</code> not permitted). * @param notify notify listeners? */ public void setBaseOutlinePaint(Paint paint, boolean notify) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.baseOutlinePaint = paint; if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Notifies all registered listeners that the renderer has been modified. * * @param event information about the change event. */ public void notifyListeners(RendererChangeEvent event) { Object[] ls = this.listenerList.getListenerList(); for (int i = ls.length - 2; i >= 0; i -= 2) { if (ls[i] == RendererChangeListener.class) { ((RendererChangeListener) ls[i + 1]).rendererChanged(event); } } }
/** * Updates the map used to assign each series to a group. * * @param map the map (<code>null</code> not permitted). */ public void setSeriesToGroupMap(KeyToGroupMap map) { if (map == null) { throw new IllegalArgumentException("Null 'map' argument."); } this.seriesToGroupMap = map; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the paint used to highlight negative differences. * * @param paint the paint (<code>null</code> not permitted). */ public void setNegativePaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.negativePaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the flag that controls whether or not a shape is plotted at each data point. * * @param flag the flag. */ public void setPlotShapes(boolean flag) { if (this.plotShapes != flag) { this.plotShapes = flag; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the flag that controls whether or not a line is plotted between each data point. * * @param flag the flag. */ public void setPlotLines(boolean flag) { if (this.plotLines != flag) { this.plotLines = flag; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the alpha transparency for the background shading, and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param alpha the alpha (in the range 0.0f to 1.0f). * * @see #getAlpha() */ public void setAlpha(float alpha) { if (alpha < 0.0f || alpha > 1.0f) { throw new IllegalArgumentException( "Requires 'alpha' in the range 0.0 to 1.0."); } this.alpha = alpha; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the legend item label generator and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param generator the generator (<code>null</code> not permitted). * * @see #getLegendItemLabelGenerator() */ public void setLegendItemLabelGenerator( CategorySeriesLabelGenerator generator) { if (generator == null) { throw new IllegalArgumentException("Null 'generator' argument."); } this.legendItemLabelGenerator = generator; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the paint used to paint the various artifacts such as outliers, * farout symbol, median line and the averages ellipse. * * @param artifactPaint the paint (<code>null</code> not permitted). */ public void setArtifactPaint(Paint artifactPaint) { if (artifactPaint == null) { throw new IllegalArgumentException( "Null 'artifactPaint' argument."); } this.artifactPaint = artifactPaint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the paint used to show the percentage incomplete and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param paint the paint (<code>null</code> not permitted). */ public void setIncompletePaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null paint not permitted."); } this.incompletePaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the dot width and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param w the new width (must be greater than zero). * * @throws IllegalArgumentException if <code>w</code> is less than one. * * @since 1.0.2 * @see #getDotWidth() */ public void setDotWidth(int w) { if (w < 1) { throw new IllegalArgumentException("Requires w > 0."); } this.dotWidth = w; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the flag that controls whether a series is visible and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index. * @param visible the flag (<code>null</code> permitted). * @param notify notify listeners? */ public void setSeriesVisible(int series, Boolean visible, boolean notify) { this.seriesVisibleList.setBoolean(series, visible); if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the paint to be used for all series and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param paint the paint (<code>null</code> permitted). * @param notify notify listeners? */ public void setPaint(Paint paint, boolean notify) { this.paint = paint; if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the paint used to draw the outline for a series and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * @param paint the paint (<code>null</code> permitted). * @param notify notify listeners? */ public void setSeriesOutlinePaint(int series, Paint paint, boolean notify) { this.outlinePaintList.setPaint(series, paint); if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the candle width. * <P> * If you set the width to a negative value, the renderer will calculate * the candle width automatically based on the space available on the chart. * * @param width The width. * @see #setAutoWidthMethod(int) * @see #setAutoWidthGap(double) * @see #setAutoWidthFactor(double) * @see #setMaxCandleWidthInMilliseconds(double) */ public void setCandleWidth(double width) { if (width != this.candleWidth) { this.candleWidth = width; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the flag that controls whether or not the base value for the bars * is included in the range calculated by * {@link #findRangeBounds(CategoryDataset)}. If the flag is changed, * a {@link RendererChangeEvent} is sent to all registered listeners. * * @param include the new value for the flag. * * @since 1.0.1 * * @see #getIncludeBaseInRange() */ public void setIncludeBaseInRange(boolean include) { if (this.includeBaseInRange != include) { this.includeBaseInRange = include; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the paint used to show the percentage incomplete and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getIncompletePaint() */ public void setIncompletePaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.incompletePaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the shape for ALL series and, if requested, sends a {@link RendererChangeEvent} to all * registered listeners. * * @param shape the shape (<code>null</code> permitted). * @param notify notify listeners? */ public void setShape(Shape shape, boolean notify) { this.shape = shape; if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the paint used to hightlight the left and bottom walls in the plot * background, and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getWallPaint() */ public void setWallPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.wallPaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the item label font for a series and, if requested, sends a {@link RendererChangeEvent} * to all registered listeners. * * @param series the series index (zero based). * @param font the font (<code>null</code> permitted). * @param notify a flag that controls whether or not listeners are notified. */ public void setSeriesItemLabelFont(int series, Font font, boolean notify) { this.itemLabelFontList.set(series, font); if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the shape used as a line in each legend item and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param line the line (<code>null</code> not permitted). * * @see #getLegendLine() */ public void setLegendLine(Shape line) { if (line == null) { throw new IllegalArgumentException("Null 'line' argument."); } this.legendLine = line; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the item label position for negative values in ALL series and (if requested) sends * a {@link RendererChangeEvent} to all registered listeners. * * @param position the position (<code>null</code> permitted). * @param notify notify registered listeners? */ public void setNegativeItemLabelPosition(ItemLabelPosition position, boolean notify) { this.negativeItemLabelPosition = position; if (notify) { notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets a token that controls how the renderer draws the end points, and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param type the end type (<code>null</code> not permitted). * * @see #getEndType() */ public void setEndType(AreaRendererEndType type) { if (type == null) { throw new IllegalArgumentException("Null 'type' argument."); } this.endType = type; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets a flag that controls whether or not volume bars are drawn in the * background and sends a {@link RendererChangeEvent} to all registered * listeners. * * @param flag the flag. * * @see #getDrawVolume() */ public void setDrawVolume(boolean flag) { if (this.drawVolume != flag) { this.drawVolume = flag; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the paint used to color the median and average markers and sends * a {@link RendererChangeEvent} to all registered listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getArtifactPaint() */ public void setArtifactPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.artifactPaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the shape used to represent bars in each legend item and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param bar the bar shape (<code>null</code> not permitted). * * @see #getLegendBar() */ public void setLegendBar(Shape bar) { if (bar == null) { throw new IllegalArgumentException("Null 'bar' argument."); } this.legendBar = bar; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the paint used to show the percentage complete and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getCompletePaint() */ public void setCompletePaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.completePaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the flag that controls whether or not the renderer draws error * bars for the x-values and, if the flag changes, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param draw the flag value. * * @see #getDrawXError() */ public void setDrawXError(boolean draw) { if (this.drawXError != draw) { this.drawXError = draw; this.notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the candle width. * <P> * If you set the width to a negative value, the renderer will calculate * the candle width automatically based on the space available on the chart. * * @param width The width. * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setAutoWidthMethod(int) * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setAutoWidthGap(double) * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setAutoWidthFactor(double) * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setMaxCandleWidthInMilliseconds(double) */ public void setCandleWidth(double width) { if (width != this.candleWidth) { this.candleWidth = width; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the factor by which the available space automatically calculated * for the candles will be multiplied to determine the actual width to use. * * @param autoWidthFactor The width factor (generally between 0.0 and 1.0). * * @see #getAutoWidthFactor() * @see #setCandleWidth(double) * @see #setAutoWidthMethod(int) * @see #setAutoWidthGap(double) * @see #setMaxCandleWidthInMilliseconds(double) */ public void setAutoWidthFactor(double autoWidthFactor) { if (this.autoWidthFactor != autoWidthFactor) { this.autoWidthFactor = autoWidthFactor; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the factor by which the available space automatically calculated for the candles will * be multiplied to determine the actual width to use. * * @param autoWidthFactor The width factor (generally between 0.0 and 1.0). * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setCandleWidth(double) * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setAutoWidthMethod(int) * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setAutoWidthGap(double) * @see org.jfree.chart.renderer.xy.CandlestickRenderer#setMaxCandleWidthInMilliseconds(double) */ public void setAutoWidthFactor(double autoWidthFactor) { if (this.autoWidthFactor != autoWidthFactor) { this.autoWidthFactor = autoWidthFactor; notifyListeners(new RendererChangeEvent(this)); } }
/** * Removes the specified annotation and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param annotation the annotation to remove (<code>null</code> not * permitted). * * @return A boolean to indicate whether or not the annotation was * successfully removed. */ public boolean removeAnnotation(XYAnnotation annotation) { boolean removed = this.foregroundAnnotations.remove(annotation); removed = removed & this.backgroundAnnotations.remove(annotation); notifyListeners(new RendererChangeEvent(this)); return removed; }
/** * Sets the flag that controls whether or not each series is drawn as a * single path. * * @param flag the flag. * * @see #getDrawSeriesLineAsPath() */ public void setDrawSeriesLineAsPath(boolean flag) { if (this.drawSeriesLineAsPath != flag) { this.drawSeriesLineAsPath = flag; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the paint used to hightlight the left and bottom walls in the plot * background, and sends a {@link RendererChangeEvent} to all registered * listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getWallPaint() */ public void setWallPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.wallPaint = paint; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the box width. * <P> * If you set the width to a negative value, the renderer will calculate * the box width automatically based on the space available on the chart. * * @param width The width. */ public void setBoxWidth(double width) { if (width != this.boxWidth) { this.boxWidth = width; notifyListeners(new RendererChangeEvent(this)); } }
/** * Sets the legend item label generator and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param generator the generator (<code>null</code> not permitted). * * @see #getLegendItemLabelGenerator() */ public void setLegendItemLabelGenerator(XYSeriesLabelGenerator generator) { if (generator == null) { throw new IllegalArgumentException("Null 'generator' argument."); } this.legendItemLabelGenerator = generator; notifyListeners(new RendererChangeEvent(this)); }
/** * Sets the flag that controls whether or not the renderer draws error * bars for the y-values and, if the flag changes, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param draw the flag value. * * @see #getDrawYError() */ public void setDrawYError(boolean draw) { if (this.drawYError != draw) { this.drawYError = draw; notifyListeners(new RendererChangeEvent(this)); } }
/** * Receives a {@link RendererChangeEvent} from a renderer. * * @param event the event. */ public void rendererChanged(RendererChangeEvent event) { this.notified = true; }