Class SignTextCellRenderer

  • All Implemented Interfaces:
    MapCellRenderer

    public class SignTextCellRenderer
    extends HexCellRenderer
    Basic class to draw Signs: a string within a box a first try
    Version:
    1.0
    Author:
    Fiete
    • Field Detail

      • fontColor

        protected java.awt.Color fontColor
      • backColor

        protected java.awt.Color backColor
      • 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
      • drawlines

        protected boolean drawlines
      • hAlign

        protected int hAlign
      • singleString

        protected java.lang.String[] singleString
      • LINE_TAG

        public static final java.lang.String LINE_TAG
        Identifier in Region-Tags for MapLines
        See Also:
        Constant Field Values
    • Constructor Detail

      • SignTextCellRenderer

        protected SignTextCellRenderer​(CellGeometry geo,
                                       MagellanContext context)
        Creates new SignTextCellRenderer
    • 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)
      • isDrawingLines

        protected boolean isDrawingLines()
      • setDrawingLines

        protected void setDrawingLines​(boolean b)
      • getMinimumFontSize

        protected int getMinimumFontSize()
      • setMinimumFontSize

        protected void setMinimumFontSize​(int size)
      • getHAlign

        protected int getHAlign()
      • setHAlign

        protected void setHAlign​(int i)
      • getText

        public java.util.Collection<Sign> getText​(Region r,
                                                  java.awt.Rectangle rect)
        Returns the Lines which should be on the sign max 2 Lines allowed
        Parameters:
        r - the region
        rect - a rectangle of region-hex - not needed here
        Returns:
        Collection of Strings to put on the sign
      • getWidth

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

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

        public java.awt.Color getBackColor()
        Returns:
        the backColor
      • setBackColor

        public void setBackColor​(java.awt.Color backColor)
        Parameters:
        backColor - the backColor to set
      • setLinesOnly

        public void setLinesOnly​(boolean linesOnly)