|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectRectangularShape
Arrow2D
public class Arrow2D
Arrow oriented toward positives x values (0° arithmetic). This shape doesn't
have direct support for rotation. To rotate the arrow toward an other direction, use
AffineTransform. See also the example documented in the TransformedShape
class.
The following picture shows the default Arrow2D appearance. The relative size
of the tail can be modified by setTailProportion(double, double, double).

| display/geotk-display (download) | View source code for this class |
| Constructor Summary | |
|---|---|
Arrow2D()
Creates a new arrow with a null surface. |
|
Arrow2D(double x,
double y,
double width,
double height)
Creates new arrow in the specified frame. |
|
| Method Summary | |
|---|---|
boolean |
contains(double x,
double y)
Tests if the specified point is inside this shape. |
boolean |
contains(double x,
double y,
double width,
double height)
Tests if the interior of this arrow entirely contains the specified rectangle. |
boolean |
equals(Object object)
Compares this arrow with the specified object for equality. |
Rectangle2D |
getBounds2D()
Returns the bounding box for this arrow. |
double |
getHeight()
Returns the height of the smallest bounding box that contains fully this arrow. |
double |
getHeight(double x)
Returns the arrow height at the given x ordinate. |
PathIterator |
getPathIterator(AffineTransform at)
Returns an iterator for this arrow. |
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
Returns an iterator for this arrow. |
double |
getTailLength()
Returns the length of the arrow's tail. |
double |
getWidth()
Returns the width of the smallest bounding box that contains fully this arrow. |
double |
getX()
Returns the minimal x coordinate of the smallest bounding box that contains fully this arrow. |
double |
getY()
Returns the minimal y coordinate of the smallest bounding box that contains fully this arrow. |
int |
hashCode()
Returns a hash value for this arrow. |
boolean |
intersects(double x,
double y,
double width,
double height)
Tests if the interior of this arrow intersects the interior of the specified rectangle. |
boolean |
isEmpty()
Determines whether the arrow is empty. |
void |
setFrame(double x,
double y,
double width,
double height)
Sets the location and size of the framing rectangle of this arrow to the specified rectangular values. |
void |
setTailProportion(double sx,
double sy1,
double sy0)
Sets the tail width and height, relative to the arrow width and height. |
| Methods inherited from class RectangularShape |
|---|
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Arrow2D()
public Arrow2D(double x,
double y,
double width,
double height)
x - Minimal x value.y - Minimal y value.width - The length in x direction.height - The length in y direction.| Method Detail |
|---|
public void setTailProportion(double sx,
double sy1,
double sy0)
sx - The position where the arrow's head starts, relative to the total
arrow's width.sy1 - The height of the arrow's tail at the position where the head start
(sx), relative to the arrow's height.sy0 - The height of the arrow's tail at the leftmore position, relative to the
arrow's height.public double getTailLength()
public double getX()
getX in class RectangularShapepublic double getY()
getY in class RectangularShapepublic double getWidth()
getWidth in class RectangularShapepublic double getHeight()
getHeight in class RectangularShapepublic double getHeight(double x)
getMinX() and getMaxX(), then this method returns 0.
x - Ordinate x where to get the arrow height.
getHeight().public boolean isEmpty()
isEmpty in class RectangularShape
public void setFrame(double x,
double y,
double width,
double height)
setFrame in class RectangularShapex - The minimal x value.y - The minimal y value.width - The length in x direction.height - The length in y direction.public Rectangle2D getBounds2D()
getBounds2D in interface Shape
public boolean contains(double x,
double y)
contains in interface Shapex - The x coordinate to test.y - The y coordinate to test.
public boolean contains(double x,
double y,
double width,
double height)
contains in interface Shapex - The minimal x value.y - The minimal y value.width - The rectangle width.height - The rectangle height.
true if the interior of this arrow contains the rectangle.
public boolean intersects(double x,
double y,
double width,
double height)
intersects in interface Shapex - The minimal x value.y - The minimal y value.width - The rectangle width.height - The rectangle height.
true if the interior of this arrow intersects the interior of the rectangle.
public PathIterator getPathIterator(AffineTransform at,
double flatness)
flatness argument and delegates to
getPathIterator(at)
getPathIterator in interface ShapegetPathIterator in class RectangularShapeat - An optional affine transform to apply, or null if none.public PathIterator getPathIterator(AffineTransform at)
getPathIterator in interface Shapeat - An optional affine transform to apply, or null if none.public boolean equals(Object object)
equals in class Objectobject - The object to compare with this arrow for equality.
true if the given object is equal to this arrow.public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||