NetCharts Pro

netcharts.pro.common
Class NFTitle

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFTitle
All Implemented Interfaces:
java.lang.Cloneable

public class NFTitle
extends NFBaseClass

The NFTitle property describes the titles on a chart. Each title contains objects that represent the text label, the background region, and an associated active label. A typical use of this object is as follows:

        ...
        Font font = new Font("Comic Sans MS", Font.PLAIN, 10);
        NFTitle top = new NFTitle(new NFLabel("My Top Title", black, font),
                new NFRegion(Color.gray, NFRegion.RAISED, 2));

        NFTitle bottom = (NFTitle)top.clone();
        bottom.setText("My Bottom Title");

        chart.setTopTitle(top);
        chart.setBottomTitle(bottom);

        ...
  
This would create both a top and bottom title, identical except for the text.


Field Summary
static int BOTTOM
          BOTTOM Alignment
static int CENTER
          CENTER Alignment
static int LEFT
          LEFT Alignment
static int RIGHT
          RIGHT Alignment
static int TOP
          TOP Alignment
 
Constructor Summary
NFTitle()
          Constructs a default title object
NFTitle(java.util.Hashtable state, java.lang.String parameterName)
          Constructs a title using CDL parameters
NFTitle(NFLabel label, NFRegion region)
          Constructs a title object using the given NFLabel text object and background NFRegion object.
 
Method Summary
 java.lang.Object clone()
          Clone this title.
 NFActiveLabel getActiveLabel()
          Get the title active label
 boolean getBackgroundExtension()
          Gets the title's background extension, either OFF (default), or ON.
 java.util.Vector getCDLVector()
          NFTitle is a compound object representing multiple CDL parameters.
 java.util.Vector getCDLVector(java.util.Vector v)
          NFTitle is a compound object representing multiple CDL parameters.
 java.util.Vector getCDLVector(java.util.Vector v, java.lang.String prefix, java.lang.String suffix)
          NFTitle is a compound object representing multiple CDL parameters.
 int getExternalAlignment()
          Gets the title's external alignment, either CENTER (default), TOP, BOTTOM, LEFT or RIGHT.
 java.awt.Color getFillColor()
          Get the title's background color
 java.awt.Font getFont()
          Get the title font
 NFLabel getLabel()
          Return title label
 int getLabelAlignment()
          Gets the label text alignment, either CENTER (default), LEFT or RIGHT.
 NFRegion getRegion()
          Return title region
 java.lang.String getText()
          Get the title's text.
 int getTextAngle()
          Get the text angle.
 int getTextAscent()
          Gets the override of the font ascent.
 java.awt.Color getTextColor()
          Get the text color
 int getTextDecoration()
          Gets the text decoration.
 int getTextDescent()
          Gets the override of the font descent.
 int getTextLeading()
          Gets the override of the font leading.
 int getTextMaxLineAdvance()
          Gets the max line advance.
 void setActiveLabel(NFActiveLabel activeLabel)
          Set active label for this title
 void setBackgroundExtension(boolean backgroundExtension)
          Set the title's background extension, either OFF or ON.
 void setCDLParameterName(java.lang.String parameterName)
          Sets this title object's parameter name.
 void setExternalAlignment(int alignment)
          Set the title's external alignment, either CENTER (default), TOP, BOTTOM, LEFT or RIGHT.
 void setFillColor(java.awt.Color fillColor)
          Set the title's background color.
 void setFont(java.awt.Font font)
          Set the title font.
 void setLabel(NFLabel label)
          Set label for this title.
 void setLabelAlignment(int alignment)
          Set the label's text alignment, either CENTER (default), LEFT or RIGHT.
 void setParameterName(java.lang.String parameterName)
          Sets the associated parameter name for when outputting.
 void setRegion(NFRegion region)
          Set region for this title.
 void setText(java.lang.String text)
          Set the text of this title.
 void setTextAngle(int textAngle)
          Set the text angle.
 void setTextAscent(int ascent)
          Set the override of the font ascent.
 void setTextColor(java.awt.Color color)
          Set the text color.
 void setTextDecoration(int decoration)
          Set the text decoration.
 void setTextDescent(int descent)
          Set the override of the font descent.
 void setTextLeading(int leading)
          Set the override of the font leading.
 void setTextMaxLineAdvance(int maxLineAdvance)
          Set the max line advance.
 
Methods inherited from class netcharts.pro.common.NFBaseClass
getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
LEFT Alignment


RIGHT

public static final int RIGHT
RIGHT Alignment


CENTER

public static final int CENTER
CENTER Alignment


TOP

public static final int TOP
TOP Alignment


BOTTOM

public static final int BOTTOM
BOTTOM Alignment

Constructor Detail

NFTitle

public NFTitle()
Constructs a default title object


NFTitle

public NFTitle(NFLabel label,
               NFRegion region)
Constructs a title object using the given NFLabel text object and background NFRegion object.

Parameters:
label - The label object containing the text and text style.
region - The region object describing the title background.

NFTitle

public NFTitle(java.util.Hashtable state,
               java.lang.String parameterName)
Constructs a title using CDL parameters

Parameters:
state - Hashtable containing CDL parameters.
parameterName - Name of the parameter associated with this particular title (e.g. LeftTitle)
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone this title. Performs a deep copy of this object.

Overrides:
clone in class NFBaseClass
Returns:
copy of this object
Throws:
java.lang.CloneNotSupportedException

setText

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

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

getText

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

Returns:
text or null if not defined.

setFont

public void setFont(java.awt.Font font)
Set the title font.

Parameters:
font - The title font.

getFont

public java.awt.Font getFont()
Get the title font

Returns:
current font or null if not set.

setTextAngle

public void setTextAngle(int textAngle)
Set the text angle.

Parameters:
angle - int value between 0-359 degrees. If the value is outside 0 and 359 a warning will be written to the debug object.

getTextAngle

public int getTextAngle()
Get the text angle.

Returns:
int value between 0-359 degrees or 0 if not set.

setTextColor

public void setTextColor(java.awt.Color color)
Set the text color.

Parameters:
color - Color of text.

getTextColor

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

Returns:
text color or null if not set.

setTextDecoration

public void setTextDecoration(int decoration)
Set the text decoration. Valid values are either NFTextStyle.NO_DECORATION or a value built by bitwise OR'ing together (that is, using the int "|" operator) two or more of the NFTextStyle.UNDERLINE_DECORATION, NFTextStyle.OVERLINE_DECORATION and NFTextStyle.LINETHROUGH_DECORATION constants.

Parameters:
decoration - The text decoration value

getTextDecoration

public int getTextDecoration()
Gets the text decoration. The value returned is either NFTextStyle.NO_DECORATION or a value built by bitwise OR'ing together two or more of the NFTextStyle.UNDERLINE_DECORATION, NFTextStyle.OVERLINE_DECORATION and NFTextStyle.LINETHROUGH_DECORATION constants.

Returns:
The text decoration.

setFillColor

public void setFillColor(java.awt.Color fillColor)
Set the title's background color.

Parameters:
fillColor - The background color.

getFillColor

public java.awt.Color getFillColor()
Get the title's background color

Returns:
The background color.

setActiveLabel

public void setActiveLabel(NFActiveLabel activeLabel)
Set active label for this title

Parameters:
activeLabel - Active Label allowing a rollover label or drilldown operation from this title.

getActiveLabel

public NFActiveLabel getActiveLabel()
Get the title active label

Returns:
active label or null if not set

setLabel

public void setLabel(NFLabel label)
Set label for this title. This NFLabel object will override any text related methods previously called on this title object (e.g. setText, setTextColor, setFont, setTextAngle)

Parameters:
label - NFLabel object.

getLabel

public NFLabel getLabel()
Return title label

Returns:
label or null if not set

setRegion

public void setRegion(NFRegion region)
Set region for this title. This NFRegion object will override any calls to the setFillColor method in this title object.

Parameters:
region -

getRegion

public NFRegion getRegion()
Return title region

Returns:
region or null if not set

getCDLVector

public java.util.Vector getCDLVector(java.util.Vector v,
                                     java.lang.String prefix,
                                     java.lang.String suffix)
NFTitle is a compound object representing multiple CDL parameters. This method returns a vector containing CDL representations for all attributes described in this NFTitle.

Parameters:
v - vector to append NFKeyValue objects to. If null is sent in, a new Vector will be created.
prefix - Text to place before the parameterName in the key value pairs.
suffix - Text to place after the parameterName in the key value pairs.
Returns:
Vector of NFKeyValue objects

getCDLVector

public java.util.Vector getCDLVector(java.util.Vector v)
NFTitle is a compound object representing multiple CDL parameters. This method returns a vector containing CDL representations for all attributes described in this NFTitle

Parameters:
v - vector to append NFKeyValue objects to. If null is sent in, a new Vector will be created.
Returns:
Vector of NFKeyValue objects

getCDLVector

public java.util.Vector getCDLVector()
NFTitle is a compound object representing multiple CDL parameters. This method returns a vector containing CDL representations for all attributes described in this NFTitle

Returns:
Vector of NFKeyValue objects

setCDLParameterName

public void setCDLParameterName(java.lang.String parameterName)
Sets this title object's parameter name. Needed to distinguish between LeftTitle, RightTitle, and other title objects.

Parameters:
parameterName - CDL name of this title.

setExternalAlignment

public void setExternalAlignment(int alignment)
Set the title's external alignment, either CENTER (default), TOP, BOTTOM, LEFT or RIGHT.

If the value passed is not a valid alignment type, CENTER will be used.

Parameters:
orientation - One of LEFT, RIGHT, TOP, BOTTOM or CENTER

setBackgroundExtension

public void setBackgroundExtension(boolean backgroundExtension)
Set the title's background extension, either OFF or ON.

Parameters:
backgroundExtension -

getExternalAlignment

public int getExternalAlignment()
Gets the title's external alignment, either CENTER (default), TOP, BOTTOM, LEFT or RIGHT.

Returns:
axisScaleMode. One of LEFT, RIGHT, TOP, BOTTOM or CENTER or CENTER if not defined.

getBackgroundExtension

public boolean getBackgroundExtension()
Gets the title's background extension, either OFF (default), or ON.

Returns:
backgroundExtension true or false. false if not defined.

setLabelAlignment

public void setLabelAlignment(int alignment)
Set the label's text alignment, either CENTER (default), LEFT or RIGHT.

If the value passed is not a valid alignment type, CENTER will be used.

Parameters:
orientation - One of LEFT, RIGHT or CENTER

getLabelAlignment

public int getLabelAlignment()
Gets the label text alignment, either CENTER (default), LEFT or RIGHT.

Returns:
axisScaleMode. One of LEFT, RIGHT or CENTER or CENTER if not defined.

setParameterName

public void setParameterName(java.lang.String parameterName)
Sets the associated parameter name for when outputting.

Parameters:
parameterName -

setTextAscent

public void setTextAscent(int ascent)
Set the override of the font ascent.

Parameters:
ascent - The ascent.

getTextAscent

public int getTextAscent()
Gets the override of the font ascent.

Returns:
The ascent.

setTextDescent

public void setTextDescent(int descent)
Set the override of the font descent.

Parameters:
descent - The descent.

getTextDescent

public int getTextDescent()
Gets the override of the font descent.

Returns:
The descent.

setTextLeading

public void setTextLeading(int leading)
Set the override of the font leading.

Parameters:
leading - The leading.

getTextLeading

public int getTextLeading()
Gets the override of the font leading.

Returns:
The leading.

setTextMaxLineAdvance

public void setTextMaxLineAdvance(int maxLineAdvance)
Set the max line advance.

Parameters:
maxLineAdvance - The max line advance.

getTextMaxLineAdvance

public int getTextMaxLineAdvance()
Gets the max line advance.

Returns:
The max line advance.

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