java.lang.Object
org.bzdev.obnaming.misc.GraphFontParm
Class to provide named-object-factory parameters specifying
instances of Graph.FontParms.
Parameter names will be compound names, typically using a period as a separator. When this class is used, multiple parameters will be defined, and the last component of the parameter name will be the following:
- "name" - the name of a font or font family.
- "justification" - the font justification
(
LEFT
,RIGHT
, orCENTER
). - "baselinePosition" - the position of the line used to
position a font up or down. Values may be
TOP
,CENTER
,BASE
, orBOTTOM
. - "angle" - the angle in degrees of the font from horizontal, measured counterclockwise in user space.
- "size" - the size of the font (a positive integer)
- "style" - the style of the font (
PLAIN
,ITALIC
,BOLD
, orBOLD_ITALIC
). - "color.red" - the red intensity of the font color, an integer in the range [0, 255].
- "color.green" - the green intensity of the font color, an integer in the range [0, 255].
- "color.blue" - the blue intensity of the font color, an integer in the range [0, 255].
- "color.alpha" - the alpha intensity of the font color,an integer in the range [0, 255] with 0 indicating transparent and 255 indicating opaque.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe alpha component of a color.Font baseline position.The blue component of a color.The CSS specification of a color.double
Font angle.Font style.The green component of a color.Font justification.Font name.The red component of a color.int
Font size. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.GraphFontParm
(boolean nullValue) Constructor with optional null value for the font name.GraphFontParm
(String name, GraphFontParm.FontStyle style, int size, Color color, Graph.Just justification, Graph.BLineP baselinePosition, double angle) Constructor given a complete description of parameters The parameters 'justification' and 'baselinePosition' determine the text justification and baseline Position relative to the x-y coordinate used to specify a string's location. -
Method Summary
-
Field Details
-
justification
Font justification. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
baselinePosition
Font baseline position. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
fontAngle
public double fontAngleFont angle. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
name
Font name. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
fstyle
Font style. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
size
public int sizeFont size. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
css
The CSS specification of a color. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
red
The red component of a color. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
green
The green component of a color. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
blue
The blue component of a color. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes. -
alpha
The alpha component of a color. This field is public because the parameter managers that use it are defined outside of this package. It should not be used for other purposes.
-
-
Constructor Details
-
GraphFontParm
public GraphFontParm()Constructor. -
GraphFontParm
public GraphFontParm(boolean nullValue) Constructor with optional null value for the font name.- Parameters:
nullValue
- true if the font name is null; false to use the default font name.
-
GraphFontParm
public GraphFontParm(String name, GraphFontParm.FontStyle style, int size, Color color, Graph.Just justification, Graph.BLineP baselinePosition, double angle) Constructor given a complete description of parameters The parameters 'justification' and 'baselinePosition' determine the text justification and baseline Position relative to the x-y coordinate used to specify a string's location.- Parameters:
name
- the name of the fontstyle
- the style of the fontsize
- the size of the fontcolor
- the color of the fontjustification
- LEFT for left-justified strings; CENTER for strings that are centered, and RIGHT for strings that are right justifiedbaselinePosition
- TOP for text aligned at its top; CENTER for text aligned at its center; BASE for text aligned at its baseline, and BOTTOM for text aligned at its bottom.angle
- the font angle in degrees from hoizontal, measured counterclockwise in user space
-
-
Method Details
-
createFontParms
Create font parameters- Returns:
- the font parameters
-