public abstract class Anchor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Anchor.HorizontalAnchor
Anchor for drawing horizontal text.
|
Modifier and Type | Field and Description |
---|---|
static Anchor |
C
Center - reference point is the center of the text.
|
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 and Description |
---|
Anchor() |
Modifier and Type | Method and Description |
---|---|
static Anchor |
createAngledAnchor(double theta,
Anchor baseAnchor)
Returns a new anchor for drawing text at a non-horizontal angle.
|
abstract void |
drawCaption(Caption label,
int px,
int py,
Captioner captioner,
Graphics g)
Draws a text label onto a given graphics context.
|
abstract Rectangle |
getCaptionBounds(Caption label,
int px,
int py,
Captioner captioner)
Returns a rectangle within which all of the given label will fall.
|
public static Anchor N
public static Anchor E
public static Anchor W
public static Anchor S
public static Anchor C
public abstract Rectangle getCaptionBounds(Caption label, int px, int py, Captioner captioner)
label
- textpx
- reference point X positionpy
- reference point Y positioncaptioner
- object that can turn text into graphicspublic abstract void drawCaption(Caption 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 textCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.