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.
  • Constructor Details

    • HorizontalAnchor

      public HorizontalAnchor()
  • Method Details

    • getCaptionBounds

      public Rectangle getCaptionBounds(Caption 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(Caption 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