Package hec.gfx2d

Class G2dLabelDrawProp

java.lang.Object
hec.gfx2d.PlotProperties
hec.gfx2d.G2dLabelDrawProp
All Implemented Interfaces:
FontProperties, PatternProperties, AsciiSerializable, FieldAccessor, Serializable, Cloneable
Direct Known Subclasses:
AxisLabelDrawProp, TitleDrawProp

public class G2dLabelDrawProp extends PlotProperties implements Cloneable, PatternProperties, FontProperties, AsciiSerializable
Drawing properties for gfx2d labels.
See Also:
  • Field Details

    • MULTI_LINE_CHARACTER

      protected static final char MULTI_LINE_CHARACTER
      See Also:
    • text

      public String text
      label text
    • SAVE_TEXT_PROPERTY

      protected boolean SAVE_TEXT_PROPERTY
    • TEXT

      protected static final String TEXT
      default values
      See Also:
    • FONT_SIZE

      protected static final String FONT_SIZE
      See Also:
    • TINY_FONT_SIZE

      protected static final String TINY_FONT_SIZE
      See Also:
    • MIN_FONT_SIZE

      protected static final String MIN_FONT_SIZE
      See Also:
    • MAX_FONT_SIZE

      protected static final String MAX_FONT_SIZE
      See Also:
    • FONT_STYLE

      protected static final String FONT_STYLE
      See Also:
    • FONT_FAMILY

      protected static final String FONT_FAMILY
      See Also:
    • TEXT_COLOR

      protected static final String TEXT_COLOR
      See Also:
    • fontSize

      public int fontSize
      Font size
    • tinyFontSize

      public int tinyFontSize
    • minFontSize

      public int minFontSize
    • maxFontSize

      public int maxFontSize
    • fontStyle

      public int fontStyle
      Font Style
    • fontFamily

      public String fontFamily
      Font Family
    • font

      public Font font
    • textColor

      public Color textColor
    • align

      public int align
      Alignment value should equal G2dLabel.LEFT/CENTER/RIGHT
    • rotation

      public int rotation
      Rotation
    • space

      public int space
      Line Spacing
    • showLabel

      public boolean showLabel
    • drawBorder

      public boolean drawBorder
    • drawBackground

      public boolean drawBackground
    • borderStyle

      public float[] borderStyle
    • borderWeight

      public float borderWeight
    • borderColor

      public Color borderColor
    • backgroundColor

      public Color backgroundColor
    • fillPattern

      public int fillPattern
    • iconPath

      public String iconPath
    • alphaComposite

      public float alphaComposite
    • useFontScaling

      public boolean useFontScaling
    • LABEL_BEGIN

      public static final String LABEL_BEGIN
      See Also:
    • LABEL_END

      public static final String LABEL_END
      See Also:
  • Constructor Details

    • G2dLabelDrawProp

      public G2dLabelDrawProp()
      Default Constructor
    • G2dLabelDrawProp

      protected G2dLabelDrawProp(String cls)
    • G2dLabelDrawProp

      public G2dLabelDrawProp(G2dLabelDrawProp dp)
      Copy Constructor
  • Method Details

    • getMaxFontSize

      public int getMaxFontSize()
      Specified by:
      getMaxFontSize in interface FontProperties
    • getMinFontSize

      public int getMinFontSize()
      Specified by:
      getMinFontSize in interface FontProperties
    • setMaxFontSize

      public void setMaxFontSize(int size)
      Specified by:
      setMaxFontSize in interface FontProperties
    • setMinFontSize

      public void setMinFontSize(int size)
      Specified by:
      setMinFontSize in interface FontProperties
    • setFontSize

      public void setFontSize(int i)
    • setTinyFontSize

      public void setTinyFontSize(int i)
    • setFontStyle

      public void setFontStyle(int i)
    • setFontFamily

      public void setFontFamily(String s)
    • setAlign

      public void setAlign(int i)
      Sets the alignment for the label. Alignment value should equal G2dLabel.LEFT/CENTER/RIGHT
    • setRotation

      public void setRotation(int i)
    • setSpace

      public void setSpace(int i)
    • setShowLabel

      public void setShowLabel(boolean b)
    • setDrawLine

      public void setDrawLine(boolean b)
      Specified by:
      setDrawLine in interface PatternProperties
    • setDrawBackground

      public void setDrawBackground(boolean b)
      Specified by:
      setDrawBackground in interface PatternProperties
    • setLineColor

      public void setLineColor(Color c)
      Specified by:
      setLineColor in interface PatternProperties
    • setLineStyle

      public void setLineStyle(float[] s)
      Specified by:
      setLineStyle in interface PatternProperties
    • setLineWeight

      public void setLineWeight(float f)
      Specified by:
      setLineWeight in interface PatternProperties
    • setBackgroundColor

      public void setBackgroundColor(Color c)
      Specified by:
      setBackgroundColor in interface PatternProperties
    • setBackgroundFill

      public void setBackgroundFill(int ft)
      Specified by:
      setBackgroundFill in interface PatternProperties
    • setAlphaComposite

      public void setAlphaComposite(float alpha)
      Specified by:
      setAlphaComposite in interface PatternProperties
    • setUseFontScaling

      public void setUseFontScaling(boolean b)
    • getLineColor

      public Color getLineColor()
      Specified by:
      getLineColor in interface PatternProperties
    • getLineStyle

      public float[] getLineStyle()
      Specified by:
      getLineStyle in interface PatternProperties
    • getLineWeight

      public float getLineWeight()
      Specified by:
      getLineWeight in interface PatternProperties
    • getBackgroundColor

      public Color getBackgroundColor()
      Specified by:
      getBackgroundColor in interface PatternProperties
    • getShowLabel

      public boolean getShowLabel()
    • getDrawLine

      public boolean getDrawLine()
      Specified by:
      getDrawLine in interface PatternProperties
    • getDrawBackground

      public boolean getDrawBackground()
      Specified by:
      getDrawBackground in interface PatternProperties
    • getBackgroundFill

      public int getBackgroundFill()
      Specified by:
      getBackgroundFill in interface PatternProperties
    • getFontSize

      public int getFontSize(int i)
    • getTinyFontSize

      public int getTinyFontSize(int i)
    • getMinFontSize

      public int getMinFontSize(int i)
    • getMaxFontSize

      public int getMaxFontSize(int i)
    • getFontStyle

      public int getFontStyle(int i)
    • getFontFamily

      public String getFontFamily(String s)
    • getAlign

      public int getAlign(int i)
    • getRotation

      public int getRotation(int i)
    • getSpace

      public int getSpace(int i)
    • getAlphaComposite

      public float getAlphaComposite()
      Specified by:
      getAlphaComposite in interface PatternProperties
    • useFontScaling

      public boolean useFontScaling()
    • getFileName

      public static String getFileName()
    • getClone

      public Object getClone()
    • set

      public void set(G2dLabelDrawProp dp)
    • writeProperties

      public void writeProperties(BufferedWriter writer, String endTag)
    • readProperties

      public void readProperties(BufferedReader in, String endTag)
    • assignValue

      protected void assignValue(String type, String param)
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful
    • loadDefaults

      public static boolean loadDefaults(BufferedReader in)
    • loadDefaults

      protected static boolean loadDefaults(BufferedReader in, String endTag, String cls)
    • parseDefaultLine

      protected static void parseDefaultLine(String type, String param, String cls)
    • writeDefaults

      public static boolean writeDefaults()
    • writeDefaults

      public static boolean writeDefaults(BufferedWriter writer)
    • writeDefaults

      protected static boolean writeDefaults(String cls, BufferedWriter writer)
    • setDefaults

      public static void setDefaults(G2dLabelDrawProp defaultProps)
    • setDefaults

      protected static void setDefaults(G2dLabelDrawProp defaultProps, String cls)
    • getFont

      public Font getFont()
      Specified by:
      getFont in interface FontProperties
    • setFont

      public void setFont(Font f)
      Specified by:
      setFont in interface FontProperties
    • getTextColor

      public Color getTextColor()
      Specified by:
      getTextColor in interface FontProperties
    • setTextColor

      public void setTextColor(Color c)
      Specified by:
      setTextColor in interface FontProperties