Class BasicGraphicAttributes

java.lang.Object
jcckit.graphic.ShapeAttributes
jcckit.graphic.BasicGraphicAttributes
All Implemented Interfaces:
FillAttributes, GraphicAttributes, LineAttributes, TextAttributes

public class BasicGraphicAttributes extends ShapeAttributes implements TextAttributes
The basic attributes of any BasicGraphicalElement. This is an extension of ShapeAttributes implementing TextAttributes.
  • Field Details

  • Constructor Details

    • BasicGraphicAttributes

      public BasicGraphicAttributes(ConfigParameters config)
      Creates a new instance based on the specified configuration parameters.
      Key & Default ValueTypeMandatory Description
      textColor = default foreground color of the rendererColorno The text color.
      fontName = default font name of the rendererStringno The name of the text font. The standard Java font name "Serif", "SansSerif", and "Monospaced" can be used. Other font names depend on the actual Renderer rendering the corresponding BasicGraphicalElement.
      fontStyle = normalString no The font style. Possible values are:
      • normal
      • bold
      • italic
      • bold italic
      fontSize = default font size of the rendererdoubleno The font size in units of the device-independent coordinates.
      orientationAngle = 0double no The orientation angle of the text (in degree). Zero means normal orientation whereas a positive value means a rotation in counter-clockweise direction.
      horizontalAnchor = leftString no Anchor for horizontal text position. Possible values are left, center, and right.
      verticalAnchor = centerString no Anchor for vertical text position. Possible values are top, center, and bottom.
      Additional configuration parameters are explained in the constructor of the superclass ShapeAttributes.
    • BasicGraphicAttributes

      public BasicGraphicAttributes(Color fillColor, Color lineColor, double lineThickness, double[] linePattern, Color textColor, String fontName, FontStyle fontStyle, double fontSize, double orientationAngle, Anchor horizontalAnchor, Anchor verticalAnchor)
      Creates a new instance.
      Parameters:
      fillColor - The fill color. May be null.
      lineColor - The line color. May be null.
      lineThickness - Thickness of the line. Negative numbers will be trimmed to zero.
      linePattern - Line pattern. May be null.
      textColor - The text color. May be null.
      fontName - The font name. May be null.
      fontStyle - The font style. May be null.
      fontSize - The font size in units of the device-independent coordinates. May be null.
      orientationAngle - Orientation angle of the text.
      horizontalAnchor - Horizontal text anchor.
      verticalAnchor - Vertical text anchor.
  • Method Details

    • getTextColor

      public Color getTextColor()
      Returns the text color.
      Specified by:
      getTextColor in interface TextAttributes
      Returns:
      null means default color of the renderer.
    • getFontName

      public String getFontName()
      Returns the font name.
      Specified by:
      getFontName in interface TextAttributes
      Returns:
      null means default font name of the renderer.
    • getFontStyle

      public FontStyle getFontStyle()
      Returns the font style.
      Specified by:
      getFontStyle in interface TextAttributes
      Returns:
      null means default font style of the renderer.
    • getFontSize

      public double getFontSize()
      Returns the font size in units of the device-independent coordinates.
      Specified by:
      getFontSize in interface TextAttributes
    • getOrientationAngle

      public double getOrientationAngle()
      Returns the orientation angle in degree. Zero means normal text orientation. Any positive angle means a counter-clockwise rotation of the text.
      Specified by:
      getOrientationAngle in interface TextAttributes
    • getHorizontalAnchor

      public Anchor getHorizontalAnchor()
      Returns the anchor for horizontal position of the text. Note, that the anchor is related to the text before it is rotated by the orientation angle.
      Specified by:
      getHorizontalAnchor in interface TextAttributes
      Returns:
      one of the three instances of Anchor.
    • getVerticalAnchor

      public Anchor getVerticalAnchor()
      Returns the anchor for vertical position of the text. Note, that the anchor is related to the text before it is rotated by the orientation angle.
      Specified by:
      getVerticalAnchor in interface TextAttributes
      Returns:
      one of the three instances of Anchor.