📄 abstractrenderer.java
字号:
}
/**
* Sets the item label paint for ALL series.
*
* @param paint the paint (<code>null</code> permitted).
*/
public void setItemLabelPaint(Paint paint) {
this.itemLabelPaint = paint;
}
/**
* Sets the item label paint for a series.
*
* @param series the series (zero based index).
* @param paint the paint (<code>null</code> permitted).
*/
public void setSeriesItemLabelPaint(int series, Paint paint) {
this.itemLabelPaintList.setPaint(0, series, paint);
}
/**
* Returns the base item label paint.
*
* @return The base item label paint.
*/
public Paint getBaseItemLabelPaint() {
return this.baseItemLabelPaint;
}
/**
* Sets the base item label paint.
*
* @param paint the paint.
*/
public void setBaseItemLabelPaint(Paint paint) {
this.baseItemLabelPaint = paint;
}
// ITEM LABEL ANCHOR...
/**
* Returns the item label anchor.
*
* @param row the row.
* @param column the column.
*
* @return The item label anchor.
*/
public ItemLabelAnchor getItemLabelAnchor(int row, int column) {
return getSeriesItemLabelAnchor(row);
}
/**
* Returns the item label anchor for all labels in a series.
*
* @param series the series.
*
* @return The anchor point.
*/
public ItemLabelAnchor getSeriesItemLabelAnchor(int series) {
// return the override, if there is one...
if (this.itemLabelAnchor != null) {
return this.itemLabelAnchor;
}
// otherwise look up the anchor table
ItemLabelAnchor anchor = this.itemLabelAnchorList.getAnchor(0, series);
if (anchor == null) {
anchor = this.baseItemLabelAnchor;
}
return anchor;
}
/**
* Sets the item label anchor.
*
* @param anchor the anchor.
*/
public void setItemLabelAnchor(ItemLabelAnchor anchor) {
this.itemLabelAnchor = anchor;
}
/**
* Sets the series item label anchor.
*
* @param series the series.
* @param anchor the anchor.
*/
public void setSeriesItemLabelAnchor(int series, ItemLabelAnchor anchor) {
this.itemLabelAnchorList.setAnchor(0, series, anchor);
}
/**
* Returns the base item label anchor.
*
* @return The anchor point.
*/
public ItemLabelAnchor getBaseItemLabelAnchor() {
return this.baseItemLabelAnchor;
}
/**
* Sets the base item label anchor.
*
* @param anchor the anchor.
*/
public void setBaseItemLabelAnchor(ItemLabelAnchor anchor) {
this.baseItemLabelAnchor = anchor;
}
// TEXT ANCHOR...
/**
* Returns the text anchor for an item label. This is a point relative to the label that
* will be aligned with another anchor point that is relative to the data item.
*
* @param row the row.
* @param column the column.
*
* @return The text anchor.
*/
public TextAnchor getItemLabelTextAnchor(int row, int column) {
return getSeriesItemLabelTextAnchor(row);
}
/**
* Returns the text anchor for all item labels in a series.
*
* @param series the series.
*
* @return The text anchor.
*/
public TextAnchor getSeriesItemLabelTextAnchor(int series) {
// return the override, if there is one...
if (this.itemLabelTextAnchor != null) {
return this.itemLabelTextAnchor;
}
// otherwise look up the anchor table
TextAnchor anchor = this.itemLabelTextAnchorList.getAnchor(0, series);
if (anchor == null) {
anchor = this.baseItemLabelTextAnchor;
}
return anchor;
}
/**
* Sets the item label text anchor for ALL series (optional).
*
* @param anchor the anchor (<code>null</code> permitted).
*/
public void setItemLabelTextAnchor(TextAnchor anchor) {
this.itemLabelTextAnchor = anchor;
}
/**
* Sets the item label text anchor for a series.
*
* @param series the series.
* @param anchor the anchor.
*/
public void setSeriesItemLabelTextAnchor(int series, TextAnchor anchor) {
this.itemLabelTextAnchorList.setAnchor(0, series, anchor);
}
/**
* Returns the base item label text anchor.
*
* @return The text anchor.
*/
public TextAnchor getBaseItemLabelTextAnchor() {
return this.baseItemLabelTextAnchor;
}
/**
* Sets the default item label text anchor.
*
* @param anchor the anchor.
*/
public void setBaseItemLabelTextAnchor(TextAnchor anchor) {
this.baseItemLabelTextAnchor = anchor;
}
// ROTATION ANCHOR...
/**
* Returns the rotation anchor for an item label.
*
* @param row the row.
* @param column the column.
*
* @return The rotation anchor.
*/
public TextAnchor getItemLabelRotationAnchor(int row, int column) {
return getSeriesItemLabelRotationAnchor(row);
}
/**
* Returns the rotation anchor for all item labels in a series.
*
* @param series the series.
*
* @return The rotation anchor.
*/
public TextAnchor getSeriesItemLabelRotationAnchor(int series) {
// return the override, if there is one...
if (this.itemLabelRotationAnchor != null) {
return this.itemLabelRotationAnchor;
}
// otherwise look up the anchor table
TextAnchor anchor = this.itemLabelRotationAnchorList.getAnchor(0, series);
if (anchor == null) {
anchor = this.baseItemLabelRotationAnchor;
}
return anchor;
}
/**
* Sets the rotation anchor for the item labels in ALL series.
*
* @param anchor the anchor (<code>null</code> permitted).
*/
public void setItemLabelRotationAnchor(TextAnchor anchor) {
this.itemLabelRotationAnchor = anchor;
}
/**
* Sets the item label rotation anchor point for a series.
*
* @param series the series.
* @param anchor the anchor point.
*/
public void setSeriesItemLabelRotationAnchor(int series, TextAnchor anchor) {
this.itemLabelRotationAnchorList.setAnchor(0, series, anchor);
}
/**
* Returns the base item label rotation anchor point.
*
* @return The anchor point.
*/
public TextAnchor getBaseItemLabelRotationAnchor() {
return this.baseItemLabelRotationAnchor;
}
/**
* Sets the base item label rotation anchor point.
*
* @param anchor the anchor point.
*/
public void setBaseItemLabelRotationAnchor(TextAnchor anchor) {
this.baseItemLabelRotationAnchor = anchor;
}
// ANGLE...
/**
* Returns the angle for an item label.
*
* @param row the row.
* @param column the column.
*
* @return The angle (in radians).
*/
public Number getItemLabelAngle(int row, int column) {
return getSeriesItemLabelAngle(row);
}
/**
* Returns the angle for all the item labels in a series.
*
* @param series the series.
*
* @return The angle (in radians).
*/
public Number getSeriesItemLabelAngle(int series) {
// return the override, if there is one...
if (this.itemLabelAngle != null) {
return this.itemLabelAngle;
}
// otherwise look up the angle table
Number angle = this.itemLabelAngleList.getNumber(0, series);
if (angle == null) {
angle = this.baseItemLabelAngle;
}
return angle;
}
/**
* Sets the angle for the item labels in ALL series (optional).
*
* @param angle the angle (<code>null</code> permitted).
*/
public void setItemLabelAngle(Number angle) {
this.itemLabelAngle = angle;
}
/**
* Sets the angle for all item labels in a series.
*
* @param series the series.
* @param angle the angle.
*/
public void setSeriesAngle(int series, Number angle) {
this.itemLabelAngleList.setNumber(0, series, angle);
}
/**
* Returns the base item label angle.
*
* @return The angle.
*/
public Number getBaseItemLabelAngle() {
return this.baseItemLabelAngle;
}
/**
* Sets the base item label angle.
*
* @param angle the angle.
*/
public void setBaseAngle(Number angle) {
this.baseItemLabelAngle = angle;
}
/**
* Adds a property change listener to the renderer.
*
* @param listener the listener.
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
listeners.addPropertyChangeListener(listener);
}
/**
* Removes a property change listener from the renderer.
*
* @param listener the listener.
*/
public void removePropertyChangeListener(PropertyChangeListener listener) {
listeners.removePropertyChangeListener(listener);
}
/**
* Notifies registered listeners that a property of the renderer has changed.
*
* @param propertyName the name of the property.
* @param oldValue the old value.
* @param newValue the new value.
*/
protected void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
listeners.firePropertyChange(propertyName, oldValue, newValue);
}
/**
* Tests this renderer for equality with another object.
*
* @param obj the object.
*
* @return <code>true</code> or <code>false</code>.
*/
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj instanceof AbstractRenderer) {
AbstractRenderer renderer = (AbstractRenderer) obj;
boolean b0 = true;
//ObjectUtils.equalOrBothNull(this.plot, renderer.plot);
boolean b1 = true;
//ObjectUtils.equalOrBothNull(this.supplier, renderer.supplier);
boolean b2 = ObjectUtils.equalOrBothNull(this.basePaint, renderer.basePaint);
boolean b4 = ObjectUtils.equalOrBothNull(this.paintList, renderer.paintList);
boolean b5 = ObjectUtils.equalOrBothNull(this.baseOutlinePaint,
renderer.baseOutlinePaint);
boolean b7 = ObjectUtils.equalOrBothNull(this.outlinePaintList,
renderer.outlinePaintList);
boolean b8 = ObjectUtils.equalOrBothNull(this.baseStroke, renderer.baseStroke);
boolean b10 = ObjectUtils.equalOrBothNull(this.strokeList, renderer.strokeList);
boolean b11 = ObjectUtils.equalOrBothNull(this.baseOutlineStroke,
renderer.baseOutlineStroke);
boolean b13 = ObjectUtils.equalOrBothNull(this.outlineStrokeList,
renderer.outlineStrokeList);
boolean b14 = ObjectUtils.equalOrBothNull(this.baseShape, renderer.baseShape);
boolean b16 = ObjectUtils.equalOrBothNull(this.shapeList, renderer.shapeList);
//boolean b17 = ObjectUtils.equalOrBothNull(this.valueLabelFont, renderer.valueLabelFont);
// boolean b18 = ObjectUtils.equalOrBothNull(
// this.valueLabelPaint, renderer.valueLabelPaint
// );
return b0 && b1 && b2 && b4 && b5 && b7 && b8
&& b10 && b11 && b13 && b14 && b16;
}
return false;
}
/**
* Provides serialization support.
*
* @param stream the output stream.
*
* @throws IOException if there is an I/O error.
*/
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
SerialUtilities.writePaint(this.basePaint, stream);
SerialUtilities.writePaint(this.baseOutlinePaint, stream);
SerialUtilities.writeStroke(this.baseStroke, stream);
SerialUtilities.writeStroke(this.baseOutlineStroke, stream);
SerialUtilities.writeShape(this.baseShape, stream);
}
/**
* 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.basePaint = SerialUtilities.readPaint(stream);
this.baseOutlinePaint = SerialUtilities.readPaint(stream);
this.baseStroke = SerialUtilities.readStroke(stream);
this.baseOutlineStroke = SerialUtilities.readStroke(stream);
this.baseShape = SerialUtilities.readShape(stream);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -