|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.Line2D org.geotools.axis.Axis2D
An axis as a graduated line. objets are really Line2D
objects with a Graduation
. Because axis are Line2D
, they can be
located anywhere in a widget with any orientation. Lines are drawn from starting
point
(x1,y1)
to end point
(x2,y2),
using a graduation from minimal value Graduation.getMinimum()
to maximal
value Graduation.getMaximum()
.
Note the line's coordinates (x1,y1) and
(x2,y2) are completly independant of
graduation minimal and maximal values. Line's coordinates should be expressed in
some units convenient for rendering, as pixels or point (1/72 of inch). On the
opposite, graduation can have any arbitrary units, which is given by
Graduation.getUnit()
. The static method createAffineTransform(org.geotools.axis.Axis2D, org.geotools.axis.Axis2D)
can
be used for mapping logical coordinates to pixels coordinates for an arbitrary
pair of objects, which doesn't need to be perpendicular.
DefaultCoordinateSystemAxis
,
AxisDirection
,
Graduation
,
Serialized FormNested Class Summary | |
class |
Axis2D.TickIterator
Iterates along the graduation ticks and provides access to the graduation values. |
Nested classes inherited from class java.awt.geom.Line2D |
java.awt.geom.Line2D.Double, java.awt.geom.Line2D.Float |
Constructor Summary | |
Axis2D()
Constructs an axis with a default NumberGraduation . |
|
Axis2D(Graduation graduation)
Constructs an axis with the specified graduation. |
Method Summary | |
static java.awt.geom.AffineTransform |
createAffineTransform(Axis2D xAxis,
Axis2D yAxis)
Creates an affine transform mapping logical to pixels coordinates for a pair of axis. |
java.awt.geom.Rectangle2D |
getBounds2D()
Returns a bounding box for this axis. |
Graduation |
getGraduation()
Returns the axis's graduation. |
double |
getLength()
Returns the axis length. |
java.awt.geom.Point2D |
getP1()
Returns the (x,y) coordinates of the start point. |
java.awt.geom.Point2D |
getP2()
Returns the (x,y) coordinates of the end point. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform transform)
Returns an iterator object that iterates along the boundary and provides access to the geometry of the shape outline. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform transform,
double flatness)
Returns an iterator object that iterates along the boundary and provides access to the geometry of the shape outline. |
java.lang.Object |
getRenderingHint(java.awt.RenderingHints.Key key)
Returns the value of a single preference for the rendering algorithms. |
double |
getX1()
Returns the x coordinate of the start point. |
double |
getX2()
Returns the x coordinate of the end point. |
double |
getY1()
Returns the y coordinate of the start point. |
double |
getY2()
Returns the y coordinate of the end point. |
boolean |
isLabelClockwise()
Returns if the axis would have to rotate clockwise in order to overlaps its graduation. |
void |
paint(java.awt.Graphics2D graphics)
Draw this axis in the specified graphics context. |
void |
setLabelClockwise(boolean c)
Sets the label's locations relative to this axis. |
void |
setLine(double x1,
double y1,
double x2,
double y2)
Sets the location of the endpoints of this to the specified coordinates. |
void |
setRenderingHint(java.awt.RenderingHints.Key key,
java.lang.Object value)
Sets the value of a single preference for the rendering algorithms. |
DefaultCoordinateSystemAxis |
toCoordinateSystemAxis()
Returns this axis name and direction. |
java.lang.String |
toString()
Returns a string representation of this axis. |
Methods inherited from class java.awt.geom.Line2D |
clone, contains, contains, contains, contains, getBounds, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.util.Cloneable |
clone |
Constructor Detail |
public Axis2D()
NumberGraduation
.
public Axis2D(Graduation graduation)
Method Detail |
public Graduation getGraduation()
public double getX1()
getY1()
,
getX2()
,
setLine(double, double, double, double)
public double getX2()
getY2()
,
getX1()
,
setLine(double, double, double, double)
public double getY1()
getX1()
,
getY2()
,
setLine(double, double, double, double)
public double getY2()
getX2()
,
getY1()
,
setLine(double, double, double, double)
public java.awt.geom.Point2D getP1()
public java.awt.geom.Point2D getP2()
public double getLength()
P2
). This length is usually measured in pixels or points
(1/72 of inch).
public java.awt.geom.Rectangle2D getBounds2D()
P1
) to (P2
), the axis's ticks and all labels.
getBounds2D
in interface java.awt.Shape
getX1()
,
getY1()
,
getX2()
,
getY2()
public void setLine(double x1, double y1, double x2, double y2) throws java.lang.IllegalArgumentException
x1
- Coordinate x of starting point.y1
- Coordinate y of starting pointx2
- Coordinate x of end point.y2
- Coordinate y of end point.
java.lang.IllegalArgumentException
- If a coordinate is or infinite.getX1()
,
getY1()
,
getX2()
,
getY2()
public boolean isLabelClockwise()
public void setLabelClockwise(boolean c)
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform transform)
AffineTransform
is specified, the coordinates returned in the iteration are transformed accordingly.
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform transform, double flatness)
AffineTransform
is specified, the coordinates returned in the iteration are transformed accordingly.
getPathIterator
in interface java.awt.Shape
public void paint(java.awt.Graphics2D graphics)
graphics
- The graphics context to use for drawing.public java.lang.Object getRenderingHint(java.awt.RenderingHints.Key key)
Graduation
interface.
key
- The key corresponding to the hint to get.
Graduation.TICK_LABEL_FONT
,
Graduation.AXIS_TITLE_FONT
public void setRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)
Graduation
interface.
key
- The key of the hint to be set.value
- The value indicating preferences for the specified hint category.
A value removes any hint for the specified key.Graduation.TICK_LABEL_FONT
,
Graduation.AXIS_TITLE_FONT
public java.lang.String toString()
public DefaultCoordinateSystemAxis toCoordinateSystemAxis()
public static java.awt.geom.AffineTransform createAffineTransform(Axis2D xAxis, Axis2D yAxis)
xAxis
- The x axis. This axis doesn't have to be horizontal;
it can have any orientation, including vertical.yAxis
- The y axis. This axis doesn't have to be vertical;
it can have any orientation, including horizontal.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |