|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.Anchor
public abstract class Anchor
Positioning constraint for plotted text. An anchor takes care of text alignment and positioning given a reference point.
Nested Class Summary | |
---|---|
static class |
Anchor.HorizontalAnchor
Anchor for drawing horizontal text. |
Field Summary | |
---|---|
static Anchor |
E
East - reference point is to right of horizontal text. |
static Anchor |
N
North - reference point is above centre of horizontal text. |
static Anchor |
S
South - reference point is below center of horizontal text. |
static Anchor |
W
West - reference point is to left of horizontal text. |
Constructor Summary | |
---|---|
Anchor()
|
Method Summary | |
---|---|
static Anchor |
createAngledAnchor(double theta,
Anchor baseAnchor)
Returns a new anchor for drawing text at a non-horizontal angle. |
abstract void |
drawCaption(String label,
int px,
int py,
Captioner captioner,
Graphics g)
Draws a text label onto a given graphics context. |
abstract Rectangle |
getCaptionBounds(String label,
int px,
int py,
Captioner captioner)
Returns a rectangle within which all of the given label will fall. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Anchor N
public static Anchor E
public static Anchor W
public static Anchor S
Constructor Detail |
---|
public Anchor()
Method Detail |
---|
public abstract Rectangle getCaptionBounds(String label, int px, int py, Captioner captioner)
label
- textpx
- reference point X positionpy
- reference point Y positioncaptioner
- object that can turn text into graphics
public abstract void drawCaption(String label, int px, int py, Captioner captioner, Graphics g)
label
- textpx
- reference point X positionpy
- reference point Y positioncaptioner
- object that can turn text into graphicsg
- graphics contextpublic static Anchor createAngledAnchor(double theta, Anchor baseAnchor)
theta
- rotation angle anticlockwise from X axis in radiansbaseAnchor
- anchor supplying positioning constraints for
horizontal text
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |