Package uk.ac.starlink.ttools.plot2
Class Anchor.HorizontalAnchor
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.Anchor
-
- uk.ac.starlink.ttools.plot2.Anchor.HorizontalAnchor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class uk.ac.starlink.ttools.plot2.Anchor
Anchor.HorizontalAnchor
-
-
Constructor Summary
Constructors Constructor Description HorizontalAnchor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddrawCaption(java.lang.String label, int px, int py, Captioner captioner, java.awt.Graphics g)Draws a text label onto a given graphics context.java.awt.RectanglegetCaptionBounds(java.lang.String label, int px, int py, Captioner captioner)Returns a rectangle within which all of the given label will fall.protected abstract int[]getOffset(java.awt.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 uk.ac.starlink.ttools.plot2.Anchor
createAngledAnchor
-
-
-
-
Method Detail
-
getCaptionBounds
public java.awt.Rectangle getCaptionBounds(java.lang.String label, int px, int py, Captioner captioner)Description copied from class:AnchorReturns a rectangle within which all of the given label will fall.- Specified by:
getCaptionBoundsin classAnchor- 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(java.lang.String label, int px, int py, Captioner captioner, java.awt.Graphics g)Description copied from class:AnchorDraws a text label onto a given graphics context.- Specified by:
drawCaptionin classAnchor- 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(java.awt.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
-
-