|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetcharts.pro.common.NFBaseClass
netcharts.pro.common.NFTextStyle
public class NFTextStyle
The NFTextStyle describes how text is to be rendered.
Field Summary | |
---|---|
static int |
CENTER
CENTER Alignment |
static int |
LEFT
LEFT Alignment |
static int |
LINETHROUGH_DECORATION
Line through decoration. |
static int |
NO_ASCENT
No ascent. |
static int |
NO_DECORATION
No decoration. |
static int |
NO_DESCENT
No descent. |
static int |
NO_LEADING
No leading. |
static int |
NO_MAXLINEADVANCE
No maxlineadvance. |
static int |
OVERLINE_DECORATION
Overline decoration. |
static int |
RIGHT
RIGHT Alignment |
static int |
UNDERLINE_DECORATION
Underline decoration. |
Constructor Summary | |
---|---|
NFTextStyle()
Constructs a default text style. |
|
NFTextStyle(java.awt.Color color,
java.awt.Font font)
Constructs a text style with the given color and font. |
|
NFTextStyle(java.awt.Color color,
java.awt.Font font,
int angle,
int alignment)
Constructs a text style with the given color and font. |
|
NFTextStyle(java.awt.Color color,
java.awt.Font font,
int angle,
int alignment,
int decoration)
Constructs a text style with the given color and font. |
Method Summary | |
---|---|
int |
getAlignment()
Gets the text alignment, either CENTER (default), LEFT or RIGHT. |
int |
getAngle()
Get the text angle. |
int |
getAscent()
Gets the override of the font ascent. |
java.lang.String |
getCDL()
Generate CDL parameters representing this text style |
void |
getCDL(java.lang.StringBuffer sb,
boolean includeParens)
Append CDL parameters representing this text style to the given StringBuffer. |
void |
getCDL(java.lang.StringBuffer sb,
boolean includeParens,
boolean includeAllCommas)
|
java.awt.Color |
getColor()
Get the text color |
int |
getDecoration()
Gets the text decoration. |
int |
getDescent()
Gets the override of the font descent. |
java.awt.Font |
getFont()
Get the text font |
int |
getLeading()
Gets the override of the font leading. |
int |
getMaxLineAdvance()
Gets the max line advance. |
void |
setAlignment(int alignment)
Set the text alignment, either CENTER (default), LEFT or RIGHT. |
void |
setAngle(int angle)
Set the text angle. |
void |
setAscent(int ascent)
Set the override of the font ascent. |
void |
setCDL(java.lang.String cdl)
Configures this object from a CDL parameter representation. |
void |
setCDL(java.lang.String[] elements,
int offset)
Configures this object from a CDL parameter representation. |
void |
setColor(java.awt.Color color)
Set the text color. |
void |
setDecoration(int decoration)
Set the text decoration. |
void |
setDescent(int descent)
Set the override of the font descent. |
void |
setFont(java.awt.Font font)
Set the text font. |
void |
setLeading(int leading)
Set the override of the font leading. |
void |
setMaxLineAdvance(int maxLineAdvance)
Set the max line advance. |
java.lang.String |
toString()
Returns a new String object representing this text style.. |
Methods inherited from class netcharts.pro.common.NFBaseClass |
---|
clone, getModified, getUserObject, setModified, setUserObject |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NO_ASCENT
public static final int NO_DESCENT
public static final int NO_LEADING
public static final int NO_MAXLINEADVANCE
public static final int NO_DECORATION
public static final int UNDERLINE_DECORATION
public static final int OVERLINE_DECORATION
public static final int LINETHROUGH_DECORATION
public static final int LEFT
public static final int RIGHT
public static final int CENTER
Constructor Detail |
---|
public NFTextStyle()
public NFTextStyle(java.awt.Color color, java.awt.Font font)
color
- Color of text.font
- The font the text will be rendered with.public NFTextStyle(java.awt.Color color, java.awt.Font font, int angle, int alignment)
color
- Color of text.font
- The font the text will be rendered with.angle
- Font anglealignment
- The text alignment.public NFTextStyle(java.awt.Color color, java.awt.Font font, int angle, int alignment, int decoration)
color
- Color of text.font
- The font the text will be rendered with.angle
- Font anglealignment
- The text alignment.decoration
- The text decoration.Method Detail |
---|
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- Color of text.public java.awt.Font getFont()
public void setFont(java.awt.Font font)
font
- The text font.public int getAngle()
public void setAngle(int angle)
angle
- int value between 0-359 degrees. If the value
is outside 0 and 359 a warning will be written to the debug
object.public void setCDL(java.lang.String cdl)
setCDL
in interface NFCDLGenerator
cdl
- CDL in the form: (textcolor, "fontname", fontsize, angle, alignment)
public void setCDL(java.lang.String[] elements, int offset)
elements
- Array of parameter elements. This array is expected
to contain consecutive elements containing color, font, angle and alignment information.offset
- Offset into the elements array.public java.lang.String getCDL()
getCDL
in interface NFCDLGenerator
(textcolor, fontname, fontsize, angle, alignment)
public java.lang.String toString()
toString
in interface NFCDLGenerator
toString
in class java.lang.Object
public void getCDL(java.lang.StringBuffer sb, boolean includeParens)
sb
- Target buffer to append the CDL parametersincludeParens
- If true, this will cause the parameters to be delimited
with parenthesis.public void getCDL(java.lang.StringBuffer sb, boolean includeParens, boolean includeAllCommas)
public void setAlignment(int alignment)
If the value passed is not a valid alignment type, CENTER will be used.
alignment
- One of LEFT, RIGHT or CENTER
public int getAlignment()
LEFT, RIGHT or CENTER
or CENTER if not defined.public void setDecoration(int decoration)
int
"|" operator)
two or more of the UNDERLINE_DECORATION, OVERLINE_DECORATION and LINETHROUGH_DECORATION constants.
decoration
- The text decoration valuepublic int getDecoration()
public void setAscent(int ascent)
ascent
- The ascent.public int getAscent()
public void setDescent(int descent)
descent
- The descent.public int getDescent()
public void setLeading(int leading)
leading
- The leading.public int getLeading()
public void setMaxLineAdvance(int maxLineAdvance)
maxLineAdvance
- The max line advance.public int getMaxLineAdvance()
|
NetCharts Pro | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Visual Mining, Inc. | Copyright © Visual Mining, Inc. 1996 - 2011 |
Last Modified: Jun 28, 2011 |