public class Annotation extends Point2D.Double
Point2D.Double, Point2D.Float
Modifier and Type | Field and Description |
---|---|
static int |
CENTER
The anchor point is at the center of the bounding box of the
text.
|
static int |
EAST
The anchor point is in the center of the right edge of the bounding
box of the text.
|
static int |
NORTH
The anchor point is in the center of the top edge of the bounding
box of the text.
|
static int |
NORTHEAST
The anchor point is at the upper right corner of the bounding box of the
text.
|
static int |
NORTHWEST
The anchor point is at the upper left corner of the bounding box of the
text.
|
static int |
SOUTH
The anchor point is in the center of the bottom edge of the bounding
box of the text.
|
static int |
SOUTHEAST
The anchor point is at the lower right corner of the bounding box of
the text.
|
static int |
SOUTHWEST
The anchor point is at the lower left corner of the bounding box of the
text.
|
static int |
WEST
The anchor point is in the center of the left edge of the bounding
box of the text.
|
x, y
Constructor and Description |
---|
Annotation()
Creates an annotation with no text strings.
|
Annotation(Annotation a) |
Annotation(String text,
double x,
double y,
int anchor) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getAnchor()
Tells where anchor point the text is located on the
bounding box of the text , possibly with an additional offset in the
indicated direction.
|
String |
getText()
Returns the text.
|
int |
hashCode() |
void |
setAnchor(int a)
Sets the direction where the text should be drawn
relative to the point given by its coordinates.
|
void |
setText(String s)
Sets the text.
|
void |
setX(double x) |
void |
setY(double y) |
getX, getY, setLocation, toString
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, setLocation
public static final int CENTER
public static final int EAST
public static final int NORTH
public static final int NORTHEAST
public static final int NORTHWEST
public static final int SOUTH
public static final int SOUTHEAST
public static final int SOUTHWEST
public static final int WEST
public Annotation()
public Annotation(Annotation a)
public Annotation(String text, double x, double y, int anchor)
public int getAnchor()
public String getText()
public void setAnchor(int a)
public void setText(String s)
public void setX(double x)
public void setY(double y)