NetCharts Pro

netcharts.pro.common
Class NFLabel

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFTextStyle
          extended by netcharts.pro.common.NFLabel
All Implemented Interfaces:
java.lang.Cloneable, NFCDLGenerator

public class NFLabel
extends NFTextStyle
implements NFCDLGenerator

The NFLabel object describes a element of text to include the the text and the rendering attributes of the text. It is often used to describe "static" text elements like titles, legend items, text annotations and so on.


Field Summary
 
Fields inherited from class netcharts.pro.common.NFTextStyle
CENTER, LEFT, LINETHROUGH_DECORATION, NO_ASCENT, NO_DECORATION, NO_DESCENT, NO_LEADING, NO_MAXLINEADVANCE, OVERLINE_DECORATION, RIGHT, UNDERLINE_DECORATION
 
Constructor Summary
NFLabel()
          Constructs a default text label.
NFLabel(java.lang.String text)
          Constructs a text label with the given text
NFLabel(java.lang.String text, java.awt.Color color, java.awt.Font font)
          Constructs a text label with the given text, color, and font.
NFLabel(java.lang.String text, java.awt.Color color, java.awt.Font font, int angle)
          Constructs a text label with the given text, color, font and angle.
NFLabel(java.lang.String text, java.awt.Color color, java.awt.Font font, int angle, int alignment)
          Constructs a text label with the given text, color, font, angle and alignment.
NFLabel(java.lang.String text, java.awt.Color color, java.awt.Font font, int angle, int alignment, int decoration)
          Constructs a text label with the given text, color, font, angle, alignment and decoration.
 
Method Summary
 java.lang.String getCDL()
          Generate CDL parameters representing this label
 void getCDL(java.lang.StringBuffer sb, boolean includeParens)
          Append CDL parameters representing this text label to the given StringBuffer.
 java.lang.String getText()
          Get the label's text.
 void setCDL(java.lang.Object cdlObject)
          Configures this label from a CDL parameter object.
 void setCDL(java.lang.String cdl)
          Configures this label from a CDL parameter representation.
 void setCDL(java.lang.String[] elements, int offset)
          Configures this object from a CDL parameter representation.
 void setText(java.lang.String text)
          Set the text of this label.
 
Methods inherited from class netcharts.pro.common.NFTextStyle
getAlignment, getAngle, getAscent, getCDL, getColor, getDecoration, getDescent, getFont, getLeading, getMaxLineAdvance, setAlignment, setAngle, setAscent, setColor, setDecoration, setDescent, setFont, setLeading, setMaxLineAdvance, toString
 
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
 
Methods inherited from interface netcharts.pro.common.NFCDLGenerator
toString
 

Constructor Detail

NFLabel

public NFLabel()
Constructs a default text label.


NFLabel

public NFLabel(java.lang.String text)
Constructs a text label with the given text

Parameters:
text - The text to be shown in the label. Note that multiple lines may be delimited using the '\n' character, as in: "First Line\nSecond Line".

NFLabel

public NFLabel(java.lang.String text,
               java.awt.Color color,
               java.awt.Font font)
Constructs a text label with the given text, color, and font.

Parameters:
text - The text to be shown in the label. Note that multiple lines may be delimited using the '\n' character, as in: "First Line\nSecond Line".
color - Text color
font - Text font

NFLabel

public NFLabel(java.lang.String text,
               java.awt.Color color,
               java.awt.Font font,
               int angle)
Constructs a text label with the given text, color, font and angle.

Parameters:
text - The text to be shown in the label. Note that multiple lines may be delimited using the '\n' character, as in: "First Line\nSecond Line".
color - Text color
font - Text font
angle - Font angle

NFLabel

public NFLabel(java.lang.String text,
               java.awt.Color color,
               java.awt.Font font,
               int angle,
               int alignment)
Constructs a text label with the given text, color, font, angle and alignment.

Parameters:
text - The text to be shown in the label. Note that multiple lines may be delimited using the '\n' character, as in: "First Line\nSecond Line".
color - Text color
font - Text font
angle - Font angle
alignment - The text alignment.

NFLabel

public NFLabel(java.lang.String text,
               java.awt.Color color,
               java.awt.Font font,
               int angle,
               int alignment,
               int decoration)
Constructs a text label with the given text, color, font, angle, alignment and decoration.

Parameters:
text - The text to be shown in the label. Note that multiple lines may be delimited using the '\n' character, as in: "First Line\nSecond Line".
color - Text color
font - Text font
angle - Font angle
alignment - The text alignment.
decoration - The text decoration.
Method Detail

getText

public java.lang.String getText()
Get the label's text. Multiple lines may be delimited using the '\n' character.

Returns:
text

setText

public void setText(java.lang.String text)
Set the text of this label.

Parameters:
text - The text to be shown in the label. Note that multiple lines may be delimited using the '\n' character, as in: "First Line\nSecond Line".

setCDL

public void setCDL(java.lang.Object cdlObject)
Configures this label from a CDL parameter object.

Parameters:
cdlObject - CDL in a String form or in a user object.

setCDL

public void setCDL(java.lang.String cdl)
Configures this label from a CDL parameter representation.

Specified by:
setCDL in interface NFCDLGenerator
Overrides:
setCDL in class NFTextStyle
Parameters:
cdl - CDL in the form: ("text", textcolor, "fontname", fontsize, angle, alignment)

setCDL

public void setCDL(java.lang.String[] elements,
                   int offset)
Configures this object from a CDL parameter representation.

Overrides:
setCDL in class NFTextStyle
Parameters:
elements - Array of parameter elements. This array is expected to contain consecutive elements containing text, color, font, and angle information.
offset - Offset into the elements array.

getCDL

public java.lang.String getCDL()
Generate CDL parameters representing this label

Specified by:
getCDL in interface NFCDLGenerator
Overrides:
getCDL in class NFTextStyle
Returns:
CDL in the form: ("text", textcolor, "fontname", fontsize, angle, alignment)

getCDL

public void getCDL(java.lang.StringBuffer sb,
                   boolean includeParens)
Append CDL parameters representing this text label to the given StringBuffer.

Overrides:
getCDL in class NFTextStyle
Parameters:
sb - Target buffer to append the CDL parameters
includeParens - If true, this will cause the parameters to be delimited with parenthesis.

NetCharts Pro


Visual Mining, Inc.
2099 Gaither Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2011
All Rights Reserved.

NetCharts Pro TM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 28, 2011