uk.ac.starlink.ttools.plot2
Class Anchor.HorizontalAnchor
java.lang.Object
uk.ac.starlink.ttools.plot2.Anchor
uk.ac.starlink.ttools.plot2.Anchor.HorizontalAnchor
- Enclosing class:
- Anchor
public abstract static class Anchor.HorizontalAnchor
- extends Anchor
Anchor for drawing horizontal text.
Fields inherited from class uk.ac.starlink.ttools.plot2.Anchor |
E, N, S, W |
Method Summary |
void |
drawCaption(String label,
int px,
int py,
Captioner captioner,
Graphics g)
Draws a text label onto a given graphics context. |
Rectangle |
getCaptionBounds(String label,
int px,
int py,
Captioner captioner)
Returns a rectangle within which all of the given label will fall. |
protected abstract int[] |
getOffset(Rectangle bounds,
int pad)
Returns the positional offset from the reference point to
position the graphics context at before calling drawCaption. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Anchor.HorizontalAnchor
public Anchor.HorizontalAnchor()
getCaptionBounds
public Rectangle getCaptionBounds(String label,
int px,
int py,
Captioner captioner)
- Description copied from class:
Anchor
- Returns a rectangle within which all of the given label will fall.
- Specified by:
getCaptionBounds
in class Anchor
- Parameters:
label
- textpx
- reference point X positionpy
- reference point Y positioncaptioner
- object that can turn text into graphics
- Returns:
- plotted text bounding box
drawCaption
public void drawCaption(String label,
int px,
int py,
Captioner captioner,
Graphics g)
- Description copied from class:
Anchor
- Draws a text label onto a given graphics context.
- Specified by:
drawCaption
in class Anchor
- Parameters:
label
- textpx
- reference point X positionpy
- reference point Y positioncaptioner
- object that can turn text into graphicsg
- graphics context
getOffset
protected abstract int[] getOffset(Rectangle bounds,
int pad)
- Returns the positional offset from the reference point to
position the graphics context at before calling drawCaption.
- Parameters:
bounds
- caption boundspad
- captioner-specific pad value
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.