public class PaintScaleLegend extends Title implements AxisChangeListener, org.jfree.util.PublicCloneable
PaintScale implementation.| Modifier and Type | Field and Description |
|---|---|
private ValueAxis |
axis
The value axis (never
null). |
private AxisLocation |
axisLocation
The axis location (handles both orientations, never
null). |
private double |
axisOffset
The offset between the axis and the paint strip (in Java2D units).
|
private java.awt.Paint |
backgroundPaint
The background paint (never
null). |
private PaintScale |
scale
The paint scale (never
null). |
(package private) static long |
serialVersionUID
For serialization.
|
private java.awt.Paint |
stripOutlinePaint
The paint used to draw an outline around the paint strip.
|
private java.awt.Stroke |
stripOutlineStroke
The stroke used to draw an outline around the paint strip.
|
private boolean |
stripOutlineVisible
A flag that controls whether or not an outline is drawn around the
paint strip.
|
private double |
stripWidth
The thickness of the paint strip (in Java2D units).
|
private int |
subdivisions
The number of subdivisions for the scale when rendering.
|
DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_PADDING, DEFAULT_POSITION, DEFAULT_VERTICAL_ALIGNMENT, visible| Constructor and Description |
|---|
PaintScaleLegend(PaintScale scale,
ValueAxis axis)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
org.jfree.ui.Size2D |
arrange(java.awt.Graphics2D g2,
RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and
returns the block size.
|
protected org.jfree.ui.Size2D |
arrangeRR(java.awt.Graphics2D g2,
Range widthRange,
Range heightRange)
Returns the content size for the title.
|
void |
axisChanged(AxisChangeEvent event)
Receives notification of an axis change event and responds by firing
a title change event.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
Draws the legend within the specified area.
|
java.lang.Object |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.lang.Object params)
Draws the legend within the specified area.
|
boolean |
equals(java.lang.Object obj)
Tests this legend for equality with an arbitrary object.
|
ValueAxis |
getAxis()
Returns the axis for the paint scale.
|
AxisLocation |
getAxisLocation()
Returns the axis location.
|
double |
getAxisOffset()
Returns the offset between the axis and the paint strip.
|
java.awt.Paint |
getBackgroundPaint()
Returns the background paint.
|
PaintScale |
getScale()
Returns the scale used to convert values to colors.
|
java.awt.Paint |
getStripOutlinePaint()
Returns the paint used to draw the outline of the paint strip.
|
java.awt.Stroke |
getStripOutlineStroke()
Returns the stroke used to draw the outline around the paint strip.
|
double |
getStripWidth()
Returns the width of the paint strip, in Java2D units.
|
int |
getSubdivisionCount()
Returns the number of subdivisions used to draw the scale.
|
boolean |
isStripOutlineVisible()
Returns the flag that controls whether or not an outline is drawn
around the paint strip.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
void |
setAxis(ValueAxis axis)
Sets the axis for the paint scale and sends a
TitleChangeEvent
to all registered listeners. |
void |
setAxisLocation(AxisLocation location)
Sets the axis location and sends a
TitleChangeEvent to all
registered listeners. |
void |
setAxisOffset(double offset)
Sets the offset between the axis and the paint strip and sends a
TitleChangeEvent to all registered listeners. |
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint and sends a
TitleChangeEvent to all
registered listeners. |
void |
setScale(PaintScale scale)
Sets the scale and sends a
TitleChangeEvent to all registered
listeners. |
void |
setStripOutlinePaint(java.awt.Paint paint)
Sets the paint used to draw the outline of the paint strip, and sends
a
TitleChangeEvent to all registered listeners. |
void |
setStripOutlineStroke(java.awt.Stroke stroke)
Sets the stroke used to draw the outline around the paint strip and
sends a
TitleChangeEvent to all registered listeners. |
void |
setStripOutlineVisible(boolean visible)
Sets the flag that controls whether or not an outline is drawn around
the paint strip, and sends a
TitleChangeEvent to all registered
listeners. |
void |
setStripWidth(double width)
Sets the width of the paint strip and sends a
TitleChangeEvent
to all registered listeners. |
void |
setSubdivisionCount(int count)
Sets the subdivision count and sends a
TitleChangeEvent to
all registered listeners. |
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
addChangeListener, clone, getHorizontalAlignment, getNotify, getPosition, getVerticalAlignment, hashCode, isVisible, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setVerticalAlignment, setVisiblearrange, calculateTotalHeight, calculateTotalWidth, drawBorder, getBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidthstatic final long serialVersionUID
private PaintScale scale
null).private ValueAxis axis
null).private AxisLocation axisLocation
null).private double axisOffset
private double stripWidth
private boolean stripOutlineVisible
private transient java.awt.Paint stripOutlinePaint
private transient java.awt.Stroke stripOutlineStroke
private transient java.awt.Paint backgroundPaint
null).private int subdivisions
public PaintScaleLegend(PaintScale scale, ValueAxis axis)
scale - the scale (null not permitted).axis - the axis (null not permitted).public PaintScale getScale()
null).setScale(PaintScale)public void setScale(PaintScale scale)
TitleChangeEvent to all registered
listeners.scale - the scale (null not permitted).getScale()public ValueAxis getAxis()
null).setAxis(ValueAxis)public void setAxis(ValueAxis axis)
TitleChangeEvent
to all registered listeners.axis - the axis (null not permitted).getAxis()public AxisLocation getAxisLocation()
null).setAxisLocation(AxisLocation)public void setAxisLocation(AxisLocation location)
TitleChangeEvent to all
registered listeners.location - the location (null not permitted).getAxisLocation()public double getAxisOffset()
setAxisOffset(double)public void setAxisOffset(double offset)
TitleChangeEvent to all registered listeners.offset - the offset.public double getStripWidth()
setStripWidth(double)public void setStripWidth(double width)
TitleChangeEvent
to all registered listeners.width - the width.getStripWidth()public boolean isStripOutlineVisible()
setStripOutlineVisible(boolean)public void setStripOutlineVisible(boolean visible)
TitleChangeEvent to all registered
listeners.visible - the flag.isStripOutlineVisible()public java.awt.Paint getStripOutlinePaint()
null).setStripOutlinePaint(Paint)public void setStripOutlinePaint(java.awt.Paint paint)
TitleChangeEvent to all registered listeners.paint - the paint (null not permitted).getStripOutlinePaint()public java.awt.Stroke getStripOutlineStroke()
null).setStripOutlineStroke(Stroke)public void setStripOutlineStroke(java.awt.Stroke stroke)
TitleChangeEvent to all registered listeners.stroke - the stroke (null not permitted).getStripOutlineStroke()public java.awt.Paint getBackgroundPaint()
public void setBackgroundPaint(java.awt.Paint paint)
TitleChangeEvent to all
registered listeners.paint - the paint (null permitted).public int getSubdivisionCount()
public void setSubdivisionCount(int count)
TitleChangeEvent to
all registered listeners.count - the count.public void axisChanged(AxisChangeEvent event)
axisChanged in interface AxisChangeListenerevent - the event.public org.jfree.ui.Size2D arrange(java.awt.Graphics2D g2,
RectangleConstraint constraint)
arrange in interface Blockarrange in class AbstractBlockg2 - the graphics device.constraint - the constraint (null not permitted).null).protected org.jfree.ui.Size2D arrangeRR(java.awt.Graphics2D g2,
Range widthRange,
Range heightRange)
g2 - the graphics device.widthRange - the width range.heightRange - the height range.public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area)
public java.lang.Object draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
java.lang.Object params)
public boolean equals(java.lang.Object obj)
private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream.java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream.java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.