Package org.jfree.chart.axis
Class MarkerAxisBand
- java.lang.Object
-
- org.jfree.chart.axis.MarkerAxisBand
-
- All Implemented Interfaces:
java.io.Serializable
public class MarkerAxisBand extends java.lang.Object implements java.io.SerializableA band that can be added to a number axis to display regions.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private NumberAxisaxisThe axis that the band belongs to.private doublebottomInnerGapThe bottom inner gap.private doublebottomOuterGapThe bottom outer gap.private java.awt.FontfontThe font.private java.util.ListmarkersStorage for the markers.private static longserialVersionUIDFor serialization.private doubletopInnerGapThe top inner gap.private doubletopOuterGapThe top outer gap.
-
Constructor Summary
Constructors Constructor Description MarkerAxisBand(NumberAxis axis, double topOuterGap, double topInnerGap, double bottomOuterGap, double bottomInnerGap, java.awt.Font font)Constructs a new axis band.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMarker(IntervalMarker marker)Adds a marker to the band.voiddraw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D dataArea, double x, double y)Draws the band.private voiddrawStringInRect(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.awt.Font font, java.lang.String text)A utility method that draws a string inside a rectangle.booleanequals(java.lang.Object obj)Tests this axis for equality with another object.doublegetHeight(java.awt.Graphics2D g2)Returns the height of the band.inthashCode()Returns a hash code for the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
axis
private NumberAxis axis
The axis that the band belongs to.
-
topOuterGap
private double topOuterGap
The top outer gap.
-
topInnerGap
private double topInnerGap
The top inner gap.
-
bottomOuterGap
private double bottomOuterGap
The bottom outer gap.
-
bottomInnerGap
private double bottomInnerGap
The bottom inner gap.
-
font
private java.awt.Font font
The font.
-
markers
private java.util.List markers
Storage for the markers.
-
-
Constructor Detail
-
MarkerAxisBand
public MarkerAxisBand(NumberAxis axis, double topOuterGap, double topInnerGap, double bottomOuterGap, double bottomInnerGap, java.awt.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 Detail
-
addMarker
public void addMarker(IntervalMarker marker)
Adds a marker to the band.- Parameters:
marker- the marker.
-
getHeight
public double getHeight(java.awt.Graphics2D g2)
Returns the height of the band.- Parameters:
g2- the graphics device.- Returns:
- The height of the band.
-
drawStringInRect
private void drawStringInRect(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.awt.Font font, java.lang.String text)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
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D dataArea, double x, double y)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
public boolean equals(java.lang.Object obj)
Tests this axis for equality with another object. Note that the axis that the band belongs to is ignored in the test.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
trueorfalse.
-
hashCode
public int hashCode()
Returns a hash code for the object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- A hash code.
-
-