Package org.jfree.chart.title
Class PaintScaleLegend
java.lang.Object
org.jfree.chart.block.AbstractBlock
org.jfree.chart.title.Title
org.jfree.chart.title.PaintScaleLegend
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,Block,AxisChangeListener,Drawable,PublicCloneable
A legend that shows a range of values and their associated colors, driven
by an underlying
PaintScale implementation.- See Also:
-
Field Summary
Fields inherited from class org.jfree.chart.title.Title
DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_PADDING, DEFAULT_POSITION, DEFAULT_VERTICAL_ALIGNMENT, visible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarrange(Graphics2D g2, RectangleConstraint constraint) Arranges the contents of the block, within the given constraints, and returns the block size.protected Size2DarrangeRR(Graphics2D g2, Range widthRange, Range heightRange) Returns the content size for the title.voidaxisChanged(AxisChangeEvent event) Receives notification of an axis change event and responds by firing a title change event.booleanEnsures symmetry between super/subclass implementations of equals.voiddraw(Graphics2D g2, Rectangle2D area) Draws the legend within the specified area.draw(Graphics2D g2, Rectangle2D area, Object params) Draws the legend within the specified area.booleanTests this legend for equality with an arbitrary object.getAxis()Returns the axis for the paint scale.Returns the axis location.doubleReturns the offset between the axis and the paint strip.Returns the background paint.getScale()Returns the scale used to convert values to colors.Returns the paint used to draw the outline of the paint strip.Returns the stroke used to draw the outline around the paint strip.doubleReturns the width of the paint strip, in Java2D units.intReturns the number of subdivisions used to draw the scale.inthashCode()Returns a hashcode for the title.booleanReturns the flag that controls whether or not an outline is drawn around the paint strip.voidSets the axis for the paint scale and sends aTitleChangeEventto all registered listeners.voidsetAxisLocation(AxisLocation location) Sets the axis location and sends aTitleChangeEventto all registered listeners.voidsetAxisOffset(double offset) Sets the offset between the axis and the paint strip and sends aTitleChangeEventto all registered listeners.voidsetBackgroundPaint(Paint paint) Sets the background paint and sends aTitleChangeEventto all registered listeners.voidsetScale(PaintScale scale) Sets the scale and sends aTitleChangeEventto all registered listeners.voidsetStripOutlinePaint(Paint paint) Sets the paint used to draw the outline of the paint strip, and sends aTitleChangeEventto all registered listeners.voidsetStripOutlineStroke(Stroke stroke) Sets the stroke used to draw the outline around the paint strip and sends aTitleChangeEventto all registered listeners.voidsetStripOutlineVisible(boolean visible) Sets the flag that controls whether or not an outline is drawn around the paint strip, and sends aTitleChangeEventto all registered listeners.voidsetStripWidth(double width) Sets the width of the paint strip and sends aTitleChangeEventto all registered listeners.voidsetSubdivisionCount(int count) Sets the subdivision count and sends aTitleChangeEventto all registered listeners.Methods inherited from class org.jfree.chart.title.Title
addChangeListener, clone, getHorizontalAlignment, getNotify, getPosition, getVerticalAlignment, isVisible, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setVerticalAlignment, setVisibleMethods inherited from class org.jfree.chart.block.AbstractBlock
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidthMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart.block.Block
arrange, getBounds, getID, setBounds, setIDMethods inherited from interface org.jfree.chart.util.PublicCloneable
clone
-
Constructor Details
-
PaintScaleLegend
Creates a new instance.- Parameters:
scale- the scale (nullnot permitted).axis- the axis (nullnot permitted).
-
-
Method Details
-
getScale
Returns the scale used to convert values to colors.- Returns:
- The scale (never
null). - See Also:
-
setScale
Sets the scale and sends aTitleChangeEventto all registered listeners.- Parameters:
scale- the scale (nullnot permitted).- See Also:
-
getAxis
Returns the axis for the paint scale.- Returns:
- The axis (never
null). - See Also:
-
setAxis
Sets the axis for the paint scale and sends aTitleChangeEventto all registered listeners.- Parameters:
axis- the axis (nullnot permitted).- See Also:
-
getAxisLocation
Returns the axis location.- Returns:
- The axis location (never
null). - See Also:
-
setAxisLocation
Sets the axis location and sends aTitleChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).- See Also:
-
getAxisOffset
Returns the offset between the axis and the paint strip.- Returns:
- The offset between the axis and the paint strip.
- See Also:
-
setAxisOffset
Sets the offset between the axis and the paint strip and sends aTitleChangeEventto all registered listeners.- Parameters:
offset- the offset.
-
getStripWidth
Returns the width of the paint strip, in Java2D units.- Returns:
- The width of the paint strip.
- See Also:
-
setStripWidth
Sets the width of the paint strip and sends aTitleChangeEventto all registered listeners.- Parameters:
width- the width.- See Also:
-
isStripOutlineVisible
Returns the flag that controls whether or not an outline is drawn around the paint strip.- Returns:
- A boolean.
- See Also:
-
setStripOutlineVisible
Sets the flag that controls whether or not an outline is drawn around the paint strip, and sends aTitleChangeEventto all registered listeners.- Parameters:
visible- the flag.- See Also:
-
getStripOutlinePaint
Returns the paint used to draw the outline of the paint strip.- Returns:
- The paint (never
null). - See Also:
-
setStripOutlinePaint
Sets the paint used to draw the outline of the paint strip, and sends aTitleChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getStripOutlineStroke
Returns the stroke used to draw the outline around the paint strip.- Returns:
- The stroke (never
null). - See Also:
-
setStripOutlineStroke
Sets the stroke used to draw the outline around the paint strip and sends aTitleChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getBackgroundPaint
Returns the background paint.- Returns:
- The background paint.
-
setBackgroundPaint
Sets the background paint and sends aTitleChangeEventto all registered listeners.- Parameters:
paint- the paint (nullpermitted).
-
getSubdivisionCount
Returns the number of subdivisions used to draw the scale.- Returns:
- The subdivision count.
-
setSubdivisionCount
Sets the subdivision count and sends aTitleChangeEventto all registered listeners.- Parameters:
count- the count.
-
axisChanged
Receives notification of an axis change event and responds by firing a title change event.- Specified by:
axisChangedin interfaceAxisChangeListener- Parameters:
event- the event.
-
arrange
Arranges the contents of the block, within the given constraints, and returns the block size.- Specified by:
arrangein interfaceBlock- Overrides:
arrangein classAbstractBlock- Parameters:
g2- the graphics device.constraint- the constraint (nullnot permitted).- Returns:
- The block size (in Java2D units, never
null).
-
arrangeRR
Returns the content size for the title. This will reflect the fact that a text title positioned on the left or right of a chart will be rotated 90 degrees.- Parameters:
g2- the graphics device.widthRange- the width range.heightRange- the height range.- Returns:
- The content size.
-
draw
Draws the legend within the specified area. -
draw
Draws the legend within the specified area. -
equals
Tests this legend for equality with an arbitrary object. -
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance. -
hashCode
Description copied from class:TitleReturns a hashcode for the title.
-