jcckit.graphic
Class BasicGraphicAttributes

java.lang.Object
  extended byjcckit.graphic.ShapeAttributes
      extended byjcckit.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.

Author:
Franz-Josef Elmer

Field Summary
static java.lang.String FONT_NAME_KEY
          Configuration parameter key.
static java.lang.String FONT_SIZE_KEY
          Configuration parameter key.
static java.lang.String FONT_STYLE_KEY
          Configuration parameter key.
static java.lang.String HORIZONTAL_ANCHOR_KEY
          Configuration parameter key.
static java.lang.String ORIENTATION_ANGLE_KEY
          Configuration parameter key.
static java.lang.String TEXT_COLOR_KEY
          Configuration parameter key.
static java.lang.String VERTICAL_ANCHOR_KEY
          Configuration parameter key.
 
Fields inherited from class jcckit.graphic.ShapeAttributes
FILL_COLOR_KEY, LINE_COLOR_KEY, LINE_PATTERN_KEY, LINE_THICKNESS_KEY
 
Constructor Summary
BasicGraphicAttributes(java.awt.Color fillColor, java.awt.Color lineColor, double lineThickness, double[] linePattern, java.awt.Color textColor, java.lang.String fontName, FontStyle fontStyle, double fontSize, double orientationAngle, Anchor horizontalAnchor, Anchor verticalAnchor)
          Creates a new instance.
BasicGraphicAttributes(ConfigParameters config)
          Creates a new instance based on the specified configuration parameters.
 
Method Summary
 java.lang.String getFontName()
          Returns the font name.
 double getFontSize()
          Returns the font size in units of the device-independent coordinates.
 FontStyle getFontStyle()
          Returns the font style.
 Anchor getHorizontalAnchor()
          Returns the anchor for horizontal position of the text.
 double getOrientationAngle()
          Returns the orientation angle in degree.
 java.awt.Color getTextColor()
          Returns the text color.
 Anchor getVerticalAnchor()
          Returns the anchor for vertical position of the text.
 
Methods inherited from class jcckit.graphic.ShapeAttributes
getFillColor, getLineColor, getLinePattern, getLineThickness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_COLOR_KEY

public static final java.lang.String TEXT_COLOR_KEY
Configuration parameter key.

See Also:
Constant Field Values

FONT_NAME_KEY

public static final java.lang.String FONT_NAME_KEY
Configuration parameter key.

See Also:
Constant Field Values

FONT_STYLE_KEY

public static final java.lang.String FONT_STYLE_KEY
Configuration parameter key.

See Also:
Constant Field Values

FONT_SIZE_KEY

public static final java.lang.String FONT_SIZE_KEY
Configuration parameter key.

See Also:
Constant Field Values

HORIZONTAL_ANCHOR_KEY

public static final java.lang.String HORIZONTAL_ANCHOR_KEY
Configuration parameter key.

See Also:
Constant Field Values

VERTICAL_ANCHOR_KEY

public static final java.lang.String VERTICAL_ANCHOR_KEY
Configuration parameter key.

See Also:
Constant Field Values

ORIENTATION_ANGLE_KEY

public static final java.lang.String ORIENTATION_ANGLE_KEY
Configuration parameter key.

See Also:
Constant Field Values
Constructor Detail

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(java.awt.Color fillColor,
                              java.awt.Color lineColor,
                              double lineThickness,
                              double[] linePattern,
                              java.awt.Color textColor,
                              java.lang.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 Detail

getTextColor

public java.awt.Color getTextColor()
Returns the text color.

Specified by:
getTextColor in interface TextAttributes
Returns:
null means default color of the renderer.

getFontName

public java.lang.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.