Class OutlineCaptioner

  • All Implemented Interfaces:
    Captioner

    public class OutlineCaptioner
    extends java.lang.Object
    implements Captioner
    Wrapper Captioner implementation that draws an outline around the caption bounding box as well as actually drawing it. Only intended for debugging.
    Since:
    9 Mar 2017
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      OutlineCaptioner​(Captioner base, java.awt.Color color)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void drawCaption​(java.lang.String label, java.awt.Graphics g)
      Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.
      boolean equals​(java.lang.Object o)  
      java.awt.Rectangle getCaptionBounds​(java.lang.String label)
      Returns a bounding box for the caption drawn by a corresponding call to Captioner.drawCaption(java.lang.String, java.awt.Graphics).
      int getPad()
      Returns a suitable padding value for separating captions from the reference position or other graphical elements.
      int hashCode()  
      • Methods inherited from class java.lang.Object

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

      • OutlineCaptioner

        public OutlineCaptioner​(Captioner base,
                                java.awt.Color color)
        Constructor.
        Parameters:
        base - base captioner
        color - outline colour
    • Method Detail

      • drawCaption

        public void drawCaption​(java.lang.String label,
                                java.awt.Graphics g)
        Description copied from interface: Captioner
        Draws a caption such that the left end of the text baseline is at the origin of the supplied graphics context.
        Specified by:
        drawCaption in interface Captioner
        Parameters:
        label - caption text
        g - graphics context
      • getPad

        public int getPad()
        Description copied from interface: Captioner
        Returns a suitable padding value for separating captions from the reference position or other graphical elements.
        Specified by:
        getPad in interface Captioner
        Returns:
        pad value in pixels
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object