| java.lang.Object java.awt.geom.Line2D org.geotools.axis.Axis2D
Axis2D | public class Axis2D extends Line2D implements Cloneable,Serializable(Code) | | An axis as a graduated line.
Axis2D 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
(
,
)
to end point
(
,
),
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
Axis2D.createAffineTransform can
be used for mapping logical coordinates to pixels coordinates for an arbitrary
pair of
Axis2D objects, which doesn't need to be perpendicular.
since: 2.0 version: $Id: Axis2D.java 22710 2006-11-12 18:04:54Z desruisseaux $ author: Martin Desruisseaux See Also: DefaultCoordinateSystemAxis See Also: AxisDirection See Also: Graduation |
Axis2D | public Axis2D(Graduation graduation)(Code) | | Constructs an axis with the specified graduation.
|
createAffineTransform | public static AffineTransform createAffineTransform(Axis2D xAxis, Axis2D yAxis)(Code) | | Creates an affine transform mapping logical to pixels coordinates for a pair
of axis. The affine transform will maps coordinates in the following way:
- For each input coordinates (x,y), the x and
y values are expressed in the same units than the
xAxis and
yAxis graduations, respectively.
- The output point is the pixel's coordinates for the (x,y)
values. Changing the x value move the pixel location in parallel with
the
xAxis , which may or may not be horizontal. Changing the y
value move the pixel location in parallel with the
yAxis , which may or
may not be vertical.
Parameters: xAxis - The x axis. This axis doesn't have to be horizontal;it can have any orientation, including vertical. Parameters: yAxis - The y axis. This axis doesn't have to be vertical;it can have any orientation, including horizontal. An affine transform mapping logical to pixels coordinates. |
getGraduation | public Graduation getGraduation()(Code) | | Returns the axis's graduation.
|
getLength | public synchronized double getLength()(Code) | | Returns the axis length. This is the distance between starting point (@link #getP1 P1})
and end point (
Axis2D.getP2 P2 ). This length is usually measured in pixels or points
(1/72 of inch).
|
getP1 | public synchronized Point2D getP1()(Code) | | Returns the (x,y) coordinates of the start point.
By convention, those coordinates should be in pixels or points (1/72 of
inch) for proper positionning of ticks and labels.
|
getP2 | public synchronized Point2D getP2()(Code) | | Returns the (x,y) coordinates of the end point.
By convention, those coordinates should be in pixels or points (1/72 of
inch) for proper positionning of ticks and labels.
|
getPathIterator | public java.awt.geom.PathIterator getPathIterator(AffineTransform transform)(Code) | | Returns an iterator object that iterates along the
Axis2D boundary
and provides access to the geometry of the shape outline. The shape includes
the axis line, graduation and labels. If an optional
AffineTransform is specified, the coordinates returned in the iteration are transformed accordingly.
|
getPathIterator | public synchronized java.awt.geom.PathIterator getPathIterator(AffineTransform transform, double flatness)(Code) | | Returns an iterator object that iterates along the
Axis2D boundary
and provides access to the geometry of the shape outline. The shape includes
the axis line, graduation and labels. If an optional
AffineTransform is specified, the coordinates returned in the iteration are transformed accordingly.
|
getRenderingHint | public synchronized Object getRenderingHint(RenderingHints.Key key)(Code) | | Returns the value of a single preference for the rendering algorithms. Hint categories
include controls for label fonts and colors. Some of the keys and their associated values
are defined in the
Graduation interface.
Parameters: key - The key corresponding to the hint to get. An object representing the value for the specified hint key, or null if no value is associated to the specified key. See Also: Graduation.TICK_LABEL_FONT See Also: Graduation.AXIS_TITLE_FONT |
getX1 | public double getX1()(Code) | | Returns the x coordinate of the start point. By convention,
this coordinate should be in pixels or points (1/72 of inch) for proper
positionning of ticks and labels.
See Also: Axis2D.getY1 See Also: Axis2D.getX2 See Also: Axis2D.setLine |
getX2 | public double getX2()(Code) | | Returns the x coordinate of the end point. By convention,
this coordinate should be in pixels or points (1/72 of inch) for proper
positionning of ticks and labels.
See Also: Axis2D.getY2 See Also: Axis2D.getX1 See Also: Axis2D.setLine |
getY1 | public double getY1()(Code) | | Returns the y coordinate of the start point. By convention,
this coordinate should be in pixels or points (1/72 of inch) for proper
positionning of ticks and labels.
See Also: Axis2D.getX1 See Also: Axis2D.getY2 See Also: Axis2D.setLine |
getY2 | public double getY2()(Code) | | Returns the y coordinate of the end point. By convention,
this coordinate should be in pixels or points (1/72 of inch) for proper
positionning of ticks and labels.
See Also: Axis2D.getX2 See Also: Axis2D.getY1 See Also: Axis2D.setLine |
isLabelClockwise | public boolean isLabelClockwise()(Code) | | Returns
true if the axis would have to rotate clockwise in order to
overlaps its graduation.
|
paint | public synchronized void paint(Graphics2D graphics)(Code) | | Draw this axis in the specified graphics context. This method is equivalents
to
Graphics2D.draw(this) . However, this method may be slightly
faster and produce better quality output.
Parameters: graphics - The graphics context to use for drawing. |
setLabelClockwise | public synchronized void setLabelClockwise(boolean c)(Code) | | Sets the label's locations relative to this axis. Value
true means
that the axis would have to rotate clockwise in order to overlaps its graduation.
Value
false means that the axis would have to rotate counter-clockwise
in order to overlaps its graduation.
|
setLine | public synchronized void setLine(double x1, double y1, double x2, double y2) throws IllegalArgumentException(Code) | | Sets the location of the endpoints of this
Axis2D to the specified
coordinates. Coordinates should be in pixels (for screen rendering) or points
(for paper rendering). Using points units make it easy to render labels with
a raisonable font size, no matter the screen resolution or the axis graduation.
Parameters: x1 - Coordinate x of starting point. Parameters: y1 - Coordinate y of starting point Parameters: x2 - Coordinate x of end point. Parameters: y2 - Coordinate y of end point. throws: IllegalArgumentException - If a coordinate is NaN or infinite. See Also: Axis2D.getX1 See Also: Axis2D.getY1 See Also: Axis2D.getX2 See Also: Axis2D.getY2 |
setRenderingHint | public synchronized void setRenderingHint(RenderingHints.Key key, Object value)(Code) | | Sets the value of a single preference for the rendering algorithms. Hint categories
include controls for label fonts and colors. Some of the keys and their associated
values are defined in the
Graduation interface.
Parameters: key - The key of the hint to be set. Parameters: value - The value indicating preferences for the specified hint category.A null value removes any hint for the specified key. See Also: Graduation.TICK_LABEL_FONT See Also: Graduation.AXIS_TITLE_FONT |
toCoordinateSystemAxis | public synchronized DefaultCoordinateSystemAxis toCoordinateSystemAxis()(Code) | | Returns this axis name and direction. Information include a name (usually the
) and an direction. The direction is usually
or
for vertical axis,
or
for horizontal axis, or
otherwise.
|
toString | public String toString()(Code) | | Returns a string representation of this axis.
|
Methods inherited from java.awt.geom.Line2D | public Object clone()(Code)(Java Doc) public boolean contains(double x, double y)(Code)(Java Doc) public boolean contains(Point2D p)(Code)(Java Doc) public boolean contains(double x, double y, double w, double h)(Code)(Java Doc) public boolean contains(Rectangle2D r)(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) abstract public Point2D getP1()(Code)(Java Doc) abstract public Point2D getP2()(Code)(Java Doc) public PathIterator getPathIterator(AffineTransform at)(Code)(Java Doc) public PathIterator getPathIterator(AffineTransform at, double flatness)(Code)(Java Doc) abstract public double getX1()(Code)(Java Doc) abstract public double getX2()(Code)(Java Doc) abstract public double getY1()(Code)(Java Doc) abstract public double getY2()(Code)(Java Doc) public boolean intersects(double x, double y, double w, double h)(Code)(Java Doc) public boolean intersects(Rectangle2D r)(Code)(Java Doc) public boolean intersectsLine(double x1, double y1, double x2, double y2)(Code)(Java Doc) public boolean intersectsLine(Line2D l)(Code)(Java Doc) public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)(Code)(Java Doc) public static double ptLineDist(double x1, double y1, double x2, double y2, double px, double py)(Code)(Java Doc) public double ptLineDist(double px, double py)(Code)(Java Doc) public double ptLineDist(Point2D pt)(Code)(Java Doc) public static double ptLineDistSq(double x1, double y1, double x2, double y2, double px, double py)(Code)(Java Doc) public double ptLineDistSq(double px, double py)(Code)(Java Doc) public double ptLineDistSq(Point2D pt)(Code)(Java Doc) public static double ptSegDist(double x1, double y1, double x2, double y2, double px, double py)(Code)(Java Doc) public double ptSegDist(double px, double py)(Code)(Java Doc) public double ptSegDist(Point2D pt)(Code)(Java Doc) public static double ptSegDistSq(double x1, double y1, double x2, double y2, double px, double py)(Code)(Java Doc) public double ptSegDistSq(double px, double py)(Code)(Java Doc) public double ptSegDistSq(Point2D pt)(Code)(Java Doc) public static int relativeCCW(double x1, double y1, double x2, double y2, double px, double py)(Code)(Java Doc) public int relativeCCW(double px, double py)(Code)(Java Doc) public int relativeCCW(Point2D p)(Code)(Java Doc) abstract public void setLine(double x1, double y1, double x2, double y2)(Code)(Java Doc) public void setLine(Point2D p1, Point2D p2)(Code)(Java Doc) public void setLine(Line2D l)(Code)(Java Doc)
|
|
|