Package org.jfree.chart.axis
Class MarkerAxisBand
java.lang.Object
org.jfree.chart.axis.MarkerAxisBand
- All Implemented Interfaces:
Serializable
A band that can be added to a number axis to display regions.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate NumberAxis
The axis that the band belongs to.private double
The bottom inner gap.private double
The bottom outer gap.private Font
The font.private List
Storage for the markers.private static final long
For serialization.private double
The top inner gap.private double
The top outer gap. -
Constructor Summary
ConstructorsConstructorDescriptionMarkerAxisBand
(NumberAxis axis, double topOuterGap, double topInnerGap, double bottomOuterGap, double bottomInnerGap, Font font) Constructs a new axis band. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMarker
(IntervalMarker marker) Adds a marker to the band.void
draw
(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, double x, double y) Draws the band.private void
drawStringInRect
(Graphics2D g2, Rectangle2D bounds, Font font, String text) A utility method that draws a string inside a rectangle.boolean
Tests this axis for equality with another object.double
getHeight
(Graphics2D g2) Returns the height of the band.int
hashCode()
Returns a hash code for the object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
axis
The axis that the band belongs to. -
topOuterGap
private double topOuterGapThe top outer gap. -
topInnerGap
private double topInnerGapThe top inner gap. -
bottomOuterGap
private double bottomOuterGapThe bottom outer gap. -
bottomInnerGap
private double bottomInnerGapThe bottom inner gap. -
font
The font. -
markers
Storage for the markers.
-
-
Constructor Details
-
MarkerAxisBand
public MarkerAxisBand(NumberAxis axis, double topOuterGap, double topInnerGap, double bottomOuterGap, double bottomInnerGap, Font font) Constructs a new axis band.- Parameters:
axis
- the owner.topOuterGap
- the top outer gap.topInnerGap
- the top inner gap.bottomOuterGap
- the bottom outer gap.bottomInnerGap
- the bottom inner gap.font
- the font.
-
-
Method Details
-
addMarker
Adds a marker to the band.- Parameters:
marker
- the marker.
-
getHeight
Returns the height of the band.- Parameters:
g2
- the graphics device.- Returns:
- The height of the band.
-
drawStringInRect
A utility method that draws a string inside a rectangle.- Parameters:
g2
- the graphics device.bounds
- the rectangle.font
- the font.text
- the text.
-
draw
Draws the band.- Parameters:
g2
- the graphics device.plotArea
- the plot area.dataArea
- the data area.x
- the x-coordinate.y
- the y-coordinate.
-
equals
Tests this axis for equality with another object. Note that the axis that the band belongs to is ignored in the test. -
hashCode
public int hashCode()Returns a hash code for the object.
-