Package jcckit.graphic
Class BasicGraphicAttributes
java.lang.Object
jcckit.graphic.ShapeAttributes
jcckit.graphic.BasicGraphicAttributes
- All Implemented Interfaces:
FillAttributes
,GraphicAttributes
,LineAttributes
,TextAttributes
The basic attributes of any
BasicGraphicalElement
. This is an
extension of ShapeAttributes
implementing TextAttributes
.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Configuration parameter key.static final String
Configuration parameter key.static final String
Configuration parameter key.static final String
Configuration parameter key.static final String
Configuration parameter key.static final String
Configuration parameter key.static final String
Configuration parameter key.Fields inherited from class jcckit.graphic.ShapeAttributes
FILL_COLOR_KEY, LINE_COLOR_KEY, LINE_PATTERN_KEY, LINE_THICKNESS_KEY
-
Constructor Summary
ConstructorDescriptionBasicGraphicAttributes
(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.Creates a new instance based on the specified configuration parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns the font name.double
Returns the font size in units of the device-independent coordinates.Returns the font style.Returns the anchor for horizontal position of the text.double
Returns the orientation angle in degree.Returns the text color.Returns the anchor for vertical position of the text.Methods inherited from class jcckit.graphic.ShapeAttributes
getFillColor, getLineColor, getLinePattern, getLineThickness
-
Field Details
-
TEXT_COLOR_KEY
Configuration parameter key.- See Also:
-
FONT_NAME_KEY
Configuration parameter key.- See Also:
-
FONT_STYLE_KEY
Configuration parameter key.- See Also:
-
FONT_SIZE_KEY
Configuration parameter key.- See Also:
-
HORIZONTAL_ANCHOR_KEY
Configuration parameter key.- See Also:
-
VERTICAL_ANCHOR_KEY
Configuration parameter key.- See Also:
-
ORIENTATION_ANGLE_KEY
Configuration parameter key.- See Also:
-
-
Constructor Details
-
BasicGraphicAttributes
Creates a new instance based on the specified configuration parameters.Key & Default Value Type Mandatory Description textColor = default foreground color of the renderer Color no The text color. fontName = default font name of the renderer String no 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 correspondingBasicGraphicalElement
.fontStyle = normal String no The font style. Possible values are: - normal
- bold
- italic
- bold italic
fontSize = default font size of the renderer double no The font size in units of the device-independent coordinates. orientationAngle = 0 double 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 = left String no Anchor for horizontal text position. Possible values are left, center, and right. verticalAnchor = center String no Anchor for vertical text position. Possible values are top, center, and bottom. constructor
of the superclassShapeAttributes
. -
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
Returns the text color.- Specified by:
getTextColor
in interfaceTextAttributes
- Returns:
- null means default color of the renderer.
-
getFontName
Returns the font name.- Specified by:
getFontName
in interfaceTextAttributes
- Returns:
- null means default font name of the renderer.
-
getFontStyle
Returns the font style.- Specified by:
getFontStyle
in interfaceTextAttributes
- 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 interfaceTextAttributes
-
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 interfaceTextAttributes
-
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 interfaceTextAttributes
- Returns:
- one of the three instances of 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 interfaceTextAttributes
- Returns:
- one of the three instances of Anchor.
-