📄 abstractrenderer.java
字号:
*/
public void setSeriesStroke(int series, Stroke stroke) {
setSeriesStroke(series, stroke, true);
}
/**
* Sets the stroke for a series and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero-based).
* @param stroke the stroke (<code>null</code> permitted).
* @param notify notify listeners?
*
* @see #getSeriesStroke(int)
*/
public void setSeriesStroke(int series, Stroke stroke, boolean notify) {
this.strokeList.setStroke(series, stroke);
if (notify) {
fireChangeEvent();
}
}
/**
* Returns the base stroke.
*
* @return The base stroke (never <code>null</code>).
*
* @see #setBaseStroke(Stroke)
*/
public Stroke getBaseStroke() {
return this.baseStroke;
}
/**
* Sets the base stroke and sends a {@link RendererChangeEvent} to all
* registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
*
* @see #getBaseStroke()
*/
public void setBaseStroke(Stroke stroke) {
// defer argument checking...
setBaseStroke(stroke, true);
}
/**
* Sets the base stroke and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
* @param notify notify listeners?
*
* @see #getBaseStroke()
*/
public void setBaseStroke(Stroke stroke, boolean notify) {
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.baseStroke = stroke;
if (notify) {
fireChangeEvent();
}
}
/**
* Returns the flag that controls whether or not the series stroke list is
* automatically populated when {@link #lookupSeriesStroke(int)} is called.
*
* @return A boolean.
*
* @since 1.0.6
*
* @see #setAutoPopulateSeriesStroke(boolean)
*/
public boolean getAutoPopulateSeriesStroke() {
return this.autoPopulateSeriesStroke;
}
/**
* Sets the flag that controls whether or not the series stroke list is
* automatically populated when {@link #lookupSeriesStroke(int)} is called.
*
* @param auto the new flag value.
*
* @since 1.0.6
*
* @see #getAutoPopulateSeriesStroke()
*/
public void setAutoPopulateSeriesStroke(boolean auto) {
this.autoPopulateSeriesStroke = auto;
}
// OUTLINE STROKE
/**
* Returns the stroke used to outline data items. The default
* implementation passes control to the
* {@link #lookupSeriesOutlineStroke(int)} method. You can override this
* method if you require different behaviour.
*
* @param row the row (or series) index (zero-based).
* @param column the column (or category) index (zero-based).
*
* @return The stroke (never <code>null</code>).
*/
public Stroke getItemOutlineStroke(int row, int column) {
return lookupSeriesOutlineStroke(row);
}
/**
* Returns the stroke used to outline the items in a series.
*
* @param series the series (zero-based index).
*
* @return The stroke (never <code>null</code>).
*
* @since 1.0.6
*/
public Stroke lookupSeriesOutlineStroke(int series) {
// return the override, if there is one...
if (this.outlineStroke != null) {
return this.outlineStroke;
}
// otherwise look up the stroke table
Stroke result = getSeriesOutlineStroke(series);
if (result == null && this.autoPopulateSeriesOutlineStroke) {
DrawingSupplier supplier = getDrawingSupplier();
if (supplier != null) {
result = supplier.getNextOutlineStroke();
setSeriesOutlineStroke(series, result, false);
}
}
if (result == null) {
result = this.baseOutlineStroke;
}
return result;
}
/**
* Sets the outline stroke for ALL series and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> permitted).
*
* @deprecated This method should no longer be used (as of version 1.0.6).
* It is sufficient to rely on {@link #setSeriesOutlineStroke(int,
* Stroke)} and {@link #setBaseOutlineStroke(Stroke)}.
*/
public void setOutlineStroke(Stroke stroke) {
setOutlineStroke(stroke, true);
}
/**
* Sets the outline stroke for ALL series and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> permitted).
* @param notify notify listeners?
*
* @deprecated This method should no longer be used (as of version 1.0.6).
* It is sufficient to rely on {@link #setSeriesOutlineStroke(int,
* Stroke, boolean)} and {@link #setBaseOutlineStroke(Stroke, boolean)}.
*/
public void setOutlineStroke(Stroke stroke, boolean notify) {
this.outlineStroke = stroke;
if (notify) {
fireChangeEvent();
}
}
/**
* Returns the stroke used to outline the items in a series.
*
* @param series the series (zero-based index).
*
* @return The stroke (possibly <code>null</code>).
*
* @see #setSeriesOutlineStroke(int, Stroke)
*/
public Stroke getSeriesOutlineStroke(int series) {
return this.outlineStrokeList.getStroke(series);
}
/**
* Sets the outline stroke used for a series and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero-based).
* @param stroke the stroke (<code>null</code> permitted).
*
* @see #getSeriesOutlineStroke(int)
*/
public void setSeriesOutlineStroke(int series, Stroke stroke) {
setSeriesOutlineStroke(series, stroke, true);
}
/**
* Sets the outline stroke for a series and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index.
* @param stroke the stroke (<code>null</code> permitted).
* @param notify notify listeners?
*
* @see #getSeriesOutlineStroke(int)
*/
public void setSeriesOutlineStroke(int series, Stroke stroke,
boolean notify) {
this.outlineStrokeList.setStroke(series, stroke);
if (notify) {
fireChangeEvent();
}
}
/**
* Returns the base outline stroke.
*
* @return The stroke (never <code>null</code>).
*
* @see #setBaseOutlineStroke(Stroke)
*/
public Stroke getBaseOutlineStroke() {
return this.baseOutlineStroke;
}
/**
* Sets the base outline stroke and sends a {@link RendererChangeEvent} to
* all registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
*
* @see #getBaseOutlineStroke()
*/
public void setBaseOutlineStroke(Stroke stroke) {
setBaseOutlineStroke(stroke, true);
}
/**
* Sets the base outline stroke and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param stroke the stroke (<code>null</code> not permitted).
* @param notify a flag that controls whether or not listeners are
* notified.
*
* @see #getBaseOutlineStroke()
*/
public void setBaseOutlineStroke(Stroke stroke, boolean notify) {
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.baseOutlineStroke = stroke;
if (notify) {
fireChangeEvent();
}
}
/**
* Returns the flag that controls whether or not the series outline stroke
* list is automatically populated when
* {@link #lookupSeriesOutlineStroke(int)} is called.
*
* @return A boolean.
*
* @since 1.0.6
*
* @see #setAutoPopulateSeriesOutlineStroke(boolean)
*/
public boolean getAutoPopulateSeriesOutlineStroke() {
return this.autoPopulateSeriesOutlineStroke;
}
/**
* Sets the flag that controls whether or not the series outline stroke list
* is automatically populated when {@link #lookupSeriesOutlineStroke(int)}
* is called.
*
* @param auto the new flag value.
*
* @since 1.0.6
*
* @see #getAutoPopulateSeriesOutlineStroke()
*/
public void setAutoPopulateSeriesOutlineStroke(boolean auto) {
this.autoPopulateSeriesOutlineStroke = auto;
}
// SHAPE
/**
* Returns a shape used to represent a data item.
* <p>
* The default implementation passes control to the getSeriesShape method.
* You can override this method if you require different behaviour.
*
* @param row the row (or series) index (zero-based).
* @param column the column (or category) index (zero-based).
*
* @return The shape (never <code>null</code>).
*/
public Shape getItemShape(int row, int column) {
return lookupSeriesShape(row);
}
/**
* Returns a shape used to represent the items in a series.
*
* @param series the series (zero-based index).
*
* @return The shape (never <code>null</code>).
*
* @since 1.0.6
*/
public Shape lookupSeriesShape(int series) {
// return the override, if there is one...
if (this.shape != null) {
return this.shape;
}
// otherwise look up the shape list
Shape result = getSeriesShape(series);
if (result == null && this.autoPopulateSeriesShape) {
DrawingSupplier supplier = getDrawingSupplier();
if (supplier != null) {
result = supplier.getNextShape();
setSeriesShape(series, result, false);
}
}
if (result == null) {
result = this.baseShape;
}
return result;
}
/**
* Sets the shape for ALL series (optional) and sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param shape the shape (<code>null</code> permitted).
*
* @deprecated This method should no longer be used (as of version 1.0.6).
* It is sufficient to rely on {@link #setSeriesShape(int, Shape)}
* and {@link #setBaseShape(Shape)}.
*/
public void setShape(Shape shape) {
setShape(shape, true);
}
/**
* 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?
*
* @deprecated This method should no longer be used (as of version 1.0.6).
* It is sufficient to rely on {@link #setSeriesShape(int, Shape,
* boolean)} and {@link #setBaseShape(Shape, boolean)}.
*/
public void setShape(Shape shape, boolean notify) {
this.shape = shape;
if (notify) {
fireChangeEvent();
}
}
/**
* Returns a shape used to represent the items in a series.
*
* @param series the series (zero-based index).
*
* @return The shape (possibly <code>null</code>).
*
* @see #setSeriesShape(int, Shape)
*/
public Shape getSeriesShape(i
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -