NetCharts Pro

netcharts.pro.common
Class NFNoteSet

java.lang.Object
  extended by netcharts.pro.common.NFBaseClass
      extended by netcharts.pro.common.NFVector
          extended by netcharts.pro.common.NFBaseSet
              extended by netcharts.pro.common.NFSet
                  extended by netcharts.pro.common.NFNoteSet
All Implemented Interfaces:
java.lang.Cloneable

public class NFNoteSet
extends NFSet

An NFNoteSet describes a set of note data and appearance information. NoteSets provide an easy mechanism for bringing greater clarity to data areas within NetCharts charts. By being able to arbitrarily specify text and multipoint line vectors, items of interest can be easily identified, and critical regions can be highlighted. NoteSets can be used anywhere on the chart, both inside and outside of the data area. For the purposes of this documentation, a Note is defined as a single text string and an associated line vector (which may or may not be shown). A NoteSet is defined as one or more Notes that share a common justification, label type, box type, axis type, and arrow/line type.

An example of using notes is shown here:

        NFBarchart bc = new NFBarchart();
        NFNoteSet grayNoteSet = new NFNoteSet(new NFModalLabel(Color.black, new Font("Sansserif", Font.BOLD, 10)),
                                new NFRegion(Color.gray.brighter(), NFRegion.RAISED, 2),
                                new NFAxisMap(NFAxisMap.BOTTOM, NFAxisMap.LEFT));

        NFNoteSet blueNoteSet = new NFNoteSet(new NFModalLabel(Color.black, new Font("Sansserif", Font.BOLD, 10)),
                                new NFRegion(Color.blue.brighter(), NFRegion.RAISED, 2),
                                new NFAxisMap(NFAxisMap.PERCENT, NFAxisMap.PERCENT));

        bc.addNote(new NFNote("apples", new NFPoint(100, 100)), grayNoteSet);
        bc.addNote(new NFNote("oranges", new NFPoint(50, 50)), blueNoteSet);
        bc.addNote(new NFNote("pears", new NFPoint(40, 40)), blueNoteSet);

 
The notes example above causes the chart to draw three notes. The first note "apples" is drawn black on a gray background, and its location (100,100) is mapped to the bottom and left axis. The second note, "oranges" is drawn black on a blue background, and its location (50,50) is mapped as a percentage of the chart size. The third note, "pears" is drawn with the same characteristics as the oranges note, just in a different location and with different text.


Field Summary
static int BOTTOM
          Bottom note justification
static int BOTTOMLEFT
          Bottom left note justification
static int BOTTOMRIGHT
          Bottom right note justification
static int CENTER
          Center note justification
static int LEFT
          Left note justification
static java.util.Hashtable noteJustificationMap
          noteJustificationMap hashtable - contains mapping between note justification values and associated text strings.
static int RIGHT
          Right note justification
static int TOP
          Top note justification
static int TOPLEFT
          Top left note justification
static int TOPRIGHT
          Top right note justification
 
Constructor Summary
NFNoteSet()
          Constructs a default note set
NFNoteSet(NFAxisMap axisMap)
          Constructs a note set with the given axis map.
NFNoteSet(NFModalLabel label, NFRegion region)
          Constructs a note set with the given label and region.
NFNoteSet(NFModalLabel label, NFRegion region, NFAxisMap axisMap)
          Constructs a note set with the given label, region, and axis map.
 
Method Summary
 void addNote(NFNote note)
          Appends the given note into the list
 java.lang.Object clone()
          Does a deep copy of this noteset object
 java.lang.String getCDLAppearance()
          Generate the CDL that creates the appearance information.
 boolean getDragEnabled()
          Returns whether drag should be enable for the note set.
 java.awt.Color getFillColor()
          Returns the note set fill color.
 int getJustify()
          Returns the note justification
 NFModalLabel getLabel()
          Returns the label used by this set
 NFArrowLine getLine()
          Returns the line used by this set
 java.awt.Color getLineColor()
          Returns the note set line color.
 java.lang.String getNoteSetName()
          Returns the note set name
 NFRegion getRegion()
          Returns the region used by this noteset
 void setCDLAppearance(java.lang.String cdl)
          Configures the appearance information from a CDL parameter representation.
 void setDragEnabled(boolean dragEnabled)
          Sets whether drag should be enable for the note set.
 void setFillColor(java.awt.Color color)
          Set the fill color for the note regions.
 void setJustify(int justify)
          Set the note justification.
 void setLabel(NFModalLabel label)
          Set label to use for the noteset
 void setLine(NFArrowLine line)
          Set line style to use for the noteset
 void setLineColor(java.awt.Color color)
          Set the line color for the set.
 void setNoteSetName(java.lang.String noteSetName)
          Set the name of the set
 void setRegion(NFRegion region)
          Set region to use for the noteset
 
Methods inherited from class netcharts.pro.common.NFSet
getAxisMap, setAxisMap
 
Methods inherited from class netcharts.pro.common.NFBaseSet
addActiveLabel, getActiveLabels, getSetName, setActiveLabels, setSetName
 
Methods inherited from class netcharts.pro.common.NFVector
addElement, addElement, elementAt, elementAt, getCDL, getCDL, getCDL, getCDLHasTuples, getCDLKeyValues, getCDLKeyValuesHasPoints, getMaxDimensions, getQuoteStrings, getSize, isEmptyStringAsNull, loadDataModel, loadDataModel, loadDataModel, removeElementAt, reset, setCDL, setCDLHasTuples, setCDLNullString, setElementAt, setEmptyStringAsNull, setQuoteStrings, setSize, size, skipNulls, toArray, toString
 
Methods inherited from class netcharts.pro.common.NFBaseClass
getModified, getUserObject, setModified, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TOPLEFT

public static final int TOPLEFT
Top left note justification


TOP

public static final int TOP
Top note justification


TOPRIGHT

public static final int TOPRIGHT
Top right note justification


LEFT

public static final int LEFT
Left note justification


CENTER

public static final int CENTER
Center note justification


RIGHT

public static final int RIGHT
Right note justification


BOTTOMLEFT

public static final int BOTTOMLEFT
Bottom left note justification


BOTTOM

public static final int BOTTOM
Bottom note justification


BOTTOMRIGHT

public static final int BOTTOMRIGHT
Bottom right note justification


noteJustificationMap

public static java.util.Hashtable noteJustificationMap
noteJustificationMap hashtable - contains mapping between note justification values and associated text strings.

Constructor Detail

NFNoteSet

public NFNoteSet()
Constructs a default note set


NFNoteSet

public NFNoteSet(NFModalLabel label,
                 NFRegion region)
Constructs a note set with the given label and region.

Parameters:
label - Describes the text appearance of notes in this noteset.
region - Describes the background appearance of notes in the noteset.

NFNoteSet

public NFNoteSet(NFAxisMap axisMap)
Constructs a note set with the given axis map.

Parameters:
axisMap - Describes how note x/y values are mapped onto the chart.

NFNoteSet

public NFNoteSet(NFModalLabel label,
                 NFRegion region,
                 NFAxisMap axisMap)
Constructs a note set with the given label, region, and axis map.

Parameters:
label - Describes the text appearance of notes in this noteset.
region - Describes the background appearance of notes in the noteset.
axisMap - Describes how note x/y values are mapped onto the chart.
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Does a deep copy of this noteset object

Overrides:
clone in class NFSet
Returns:
Object
Throws:
java.lang.CloneNotSupportedException

setLabel

public void setLabel(NFModalLabel label)
Set label to use for the noteset

Parameters:
label - Text style to use for the note set.

getLabel

public NFModalLabel getLabel()
Returns the label used by this set

Returns:
the label

setRegion

public void setRegion(NFRegion region)
Set region to use for the noteset

Parameters:
region - to use

getRegion

public NFRegion getRegion()
Returns the region used by this noteset

Returns:
the region

setLine

public void setLine(NFArrowLine line)
Set line style to use for the noteset

Parameters:
line - to use

getLine

public NFArrowLine getLine()
Returns the line used by this set

Returns:
the line

addNote

public void addNote(NFNote note)
Appends the given note into the list

Parameters:
note - to append

setJustify

public void setJustify(int justify)
Set the note justification. The justification is the placement of the note relative to the note's location. One of TOPLEFT, TOP, TOPRIGHT, LEFT, CENTER, RIGHT, BOTTOMLEFT, BOTTOM, BOTTOMRIGHT.

If the value passed is not a valid justify type an IllegalArgumentException will be thrown.

Parameters:
justify - One of TOPLEFT, TOP, TOPRIGHT, LEFT, CENTER, RIGHT, BOTTOMLEFT, BOTTOM, BOTTOMRIGHT.

getJustify

public int getJustify()
Returns the note justification

Returns:
the justification for the note.

setNoteSetName

public void setNoteSetName(java.lang.String noteSetName)
Set the name of the set

Parameters:
setName - Name of the noteset

getNoteSetName

public java.lang.String getNoteSetName()
Returns the note set name

Returns:
the note set name

setFillColor

public void setFillColor(java.awt.Color color)
Set the fill color for the note regions. This is a convenience method that calls the set's region setFillColor method.

Parameters:
color - Note background fill color

getFillColor

public java.awt.Color getFillColor()
Returns the note set fill color. This is a convenience method that calls the set's region symbol getFillColor method.

Returns:
the fill color

setLineColor

public void setLineColor(java.awt.Color color)
Set the line color for the set. This is a convenience method that calls the set's line setLineColor method.

Parameters:
color - Line color

getLineColor

public java.awt.Color getLineColor()
Returns the note set line color. This is a convenience method that calls the set's line symbol getLineColor method.

Returns:
the line color

setDragEnabled

public void setDragEnabled(boolean dragEnabled)
Sets whether drag should be enable for the note set.

Parameters:
dragEnabled - true if enable, false otherwise

getDragEnabled

public boolean getDragEnabled()
Returns whether drag should be enable for the note set.

Returns:
dragEnabled true if enable, false otherwise.

getCDLAppearance

public java.lang.String getCDLAppearance()
Generate the CDL that creates the appearance information.

Returns:
CDL in the form: ("setName", justification)

setCDLAppearance

public void setCDLAppearance(java.lang.String cdl)
Configures the appearance information from a CDL parameter representation.

Parameters:
cdl - CDL in the form: ("setName", justification)

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