Class Anchor.HorizontalAnchor

  • Enclosing class:
    Anchor

    public abstract static class Anchor.HorizontalAnchor
    extends Anchor
    Anchor for drawing horizontal text.
    • Field Summary

      • Fields inherited from class uk.ac.starlink.ttools.plot2.Anchor

        C, E, N, S, W
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void drawCaption​(Caption label, int px, int py, Captioner captioner, java.awt.Graphics g)
      Draws a text label onto a given graphics context.
      java.awt.Rectangle getCaptionBounds​(Caption 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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HorizontalAnchor

        public HorizontalAnchor()
    • Method Detail

      • getCaptionBounds

        public java.awt.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,
                                java.awt.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​(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 bounds
        pad - captioner-specific pad value