uk.ac.starlink.ttools.plot2
Class Anchor.HorizontalAnchor

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.Anchor
      extended by uk.ac.starlink.ttools.plot2.Anchor.HorizontalAnchor
Enclosing class:
Anchor

public abstract static class Anchor.HorizontalAnchor
extends Anchor

Anchor for drawing horizontal text.


Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ttools.plot2.Anchor
Anchor.HorizontalAnchor
 
Field Summary
 
Fields inherited from class uk.ac.starlink.ttools.plot2.Anchor
E, N, S, W
 
Constructor Summary
Anchor.HorizontalAnchor()
           
 
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 uk.ac.starlink.ttools.plot2.Anchor
createAngledAnchor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Anchor.HorizontalAnchor

public Anchor.HorizontalAnchor()
Method Detail

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 - text
px - reference point X position
py - reference point Y position
captioner - 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 - text
px - reference point X position
py - reference point Y position
captioner - object that can turn text into graphics
g - 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 bounds
pad - captioner-specific pad value


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.