public class MarkerAxisBand
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private NumberAxis |
axis
The axis that the band belongs to.
|
private double |
bottomInnerGap
The bottom inner gap.
|
private double |
bottomOuterGap
The bottom outer gap.
|
private java.awt.Font |
font
The font.
|
private java.util.List |
markers
Storage for the markers.
|
private static long |
serialVersionUID
For serialization.
|
private double |
topInnerGap
The top inner gap.
|
private double |
topOuterGap
The top outer gap.
|
| Constructor and Description |
|---|
MarkerAxisBand(NumberAxis axis,
double topOuterGap,
double topInnerGap,
double bottomOuterGap,
double bottomInnerGap,
java.awt.Font font)
Constructs a new axis band.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMarker(IntervalMarker marker)
Adds a marker to the band.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
double x,
double y)
Draws the band.
|
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.
|
boolean |
equals(java.lang.Object obj)
Tests this axis for equality with another object.
|
double |
getHeight(java.awt.Graphics2D g2)
Returns the height of the band.
|
int |
hashCode()
Returns a hash code for the object.
|
private static final long serialVersionUID
private NumberAxis axis
private double topOuterGap
private double topInnerGap
private double bottomOuterGap
private double bottomInnerGap
private java.awt.Font font
private java.util.List markers
public MarkerAxisBand(NumberAxis axis, double topOuterGap, double topInnerGap, double bottomOuterGap, double bottomInnerGap, java.awt.Font font)
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.public void addMarker(IntervalMarker marker)
marker - the marker.public double getHeight(java.awt.Graphics2D g2)
g2 - the graphics device.private void drawStringInRect(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
java.awt.Font font,
java.lang.String text)
g2 - the graphics device.bounds - the rectangle.font - the font.text - the text.public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Rectangle2D dataArea,
double x,
double y)
g2 - the graphics device.plotArea - the plot area.dataArea - the data area.x - the x-coordinate.y - the y-coordinate.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).true or false.public int hashCode()
hashCode in class java.lang.Object