Class AbstractTextCellRenderer

  • All Implemented Interfaces:
    MapCellRenderer
    Direct Known Subclasses:
    TextCellRenderer

    public abstract class AbstractTextCellRenderer
    extends HexCellRenderer
    Abstract base class for text renderers. Several possibilities to change the output. New feature: Alignment.
    Version:
    1.0
    Author:
    Andreas
    • Field Detail

      • fontColor

        protected java.awt.Color fontColor
      • brighterColor

        protected java.awt.Color brighterColor
      • unscaledFont

        protected java.awt.Font unscaledFont
      • font

        protected java.awt.Font font
      • minimumFontSize

        protected int minimumFontSize
      • isScalingFont

        protected boolean isScalingFont
      • hAlign

        protected int hAlign
      • shortenStrings

        protected boolean shortenStrings
      • singleString

        protected java.lang.String[] singleString
    • Constructor Detail

      • AbstractTextCellRenderer

        protected AbstractTextCellRenderer​(CellGeometry geo,
                                           MagellanContext context)
        Creates new AbstractTextCellRenderer
    • Method Detail

      • getFontColor

        protected java.awt.Color getFontColor()
      • setFontColor

        protected void setFontColor​(java.awt.Color col)
      • getFont

        protected java.awt.Font getFont()
      • setFont

        protected void setFont​(java.awt.Font f)
      • setFont

        protected void setFont​(float scaleFactor)
      • isScalingFont

        protected boolean isScalingFont()
      • setScalingFont

        protected void setScalingFont​(boolean b)
      • getMinimumFontSize

        protected int getMinimumFontSize()
      • setMinimumFontSize

        protected void setMinimumFontSize​(int m)
      • getHAlign

        protected int getHAlign()
      • setHAlign

        protected void setHAlign​(int i)
      • isShortenStrings

        protected boolean isShortenStrings()
      • setShortenStrings

        protected void setShortenStrings​(boolean b)
      • getSingleString

        public abstract java.lang.String getSingleString​(Region r,
                                                         java.awt.Rectangle rect)
        DOCUMENT-ME
      • getText

        public abstract java.lang.String[] getText​(Region r,
                                                   java.awt.Rectangle rect)
        DOCUMENT-ME
      • render

        public void render​(java.lang.Object obj,
                           boolean active,
                           boolean selected)
        Description copied from interface: MapCellRenderer
        Renders the supplied object. The active and selected parameters influence how the object is drawn.
        Specified by:
        render in interface MapCellRenderer
        Specified by:
        render in class HexCellRenderer
        Parameters:
        obj - This object is going to be displayed (typically a region).
        active - Indicates if the object is the currently active object.
        selected - Indicates if the object is the currently selected.
        See Also:
        HexCellRenderer.render(java.lang.Object, boolean, boolean)
      • getWidth

        protected int getWidth​(java.lang.String string)
      • getWidth

        protected int getWidth​(char[] chars,
                               int begin,
                               int limit)
      • shortenStrings

        protected void shortenStrings​(java.lang.String[] str,
                                      int maxWidth)