NetCharts Pro

netcharts.pro.common
Class NFGraph

java.lang.Object
  |
  +--netcharts.pro.common.NFGraph
All Implemented Interfaces:
java.io.Externalizable, NFDragObserver, NFDwellObserver, NFGraphObserver, NFScrollObserver, java.io.Serializable
Direct Known Subclasses:
NFDiagramchart, NFDialchart, NFPiechart, NFRadarchart, NFZoomableChart

public abstract class NFGraph
extends java.lang.Object
implements NFDwellObserver, java.io.Externalizable, NFGraphObserver, NFDragObserver, NFScrollObserver

Abstract superclass for all chart rendering engines. Provides a number of methods and utilities that are used for all NetCharts objects.

See Also:
Serialized Form

Field Summary
static int BAR
          Indicates a bar chart type.
static int BOX
          Indicates an box chart type.
static int BUBBLE
          Indicates an bubble chart type.
static int COMBO
          Indicates an Combo chart type.
static int DIAGRAM
          Indicates an diagram chart type.
static int DIAL
          Indicates an dial chart type.
static int LINE
          Indicates an line chart type.
static int PIE
          Indicates a pie chart type.
static int RADAR
          Indicates an radar chart type.
static int STOCK
          Indicates an stock chart type.
static int STRIP
          Indicates an strip chart type.
static int TIME
          Indicates an time chart type.
static int XY
          Indicates an XY chart type.
 
Constructor Summary
NFGraph()
          Constructs a default NFGraph object.
NFGraph(javax.swing.JPanel panel)
          Constructs an NFGraph object on the given JPanel.
NFGraph(javax.swing.JPanel panel, java.util.Properties runtimeProperties)
          Constructs an NFGraph object on the given JPanel.
NFGraph(java.util.Properties runtimeProperties)
          Constructs a default NFGraph object.
 
Method Summary
 void addChartActionListener(NFChartActionListener l)
          Adds a chart action listener.
 void addGraphObserver(NFGraphObserver observer)
          Adds a graph observer to the peer rendering engine.
 void addNote(NFNote note, NFNoteSet set)
          Convenience method to add notes to the chart.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a bound property change listener for this chart.
 void display()
          Deprecated. The "display" method is only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "display" method should only be used in the interim of converting to the NetCharts Pro API. Any future development should NOT use the "display" method but should use the "sendUpdate" instead. No guarantee is given as to how long the "display" method will be included in future products.
 boolean dwellDisplay(boolean onoff, netcharts.graphics.NFActiveLabel label)
          Maps peer rendering engine events to ChartActionEvents.
 boolean dwellPress(java.awt.Event evt, int x, int y, netcharts.graphics.NFActiveLabel label)
          Maps peer rendering engine events to ChartActionEvents.
 void finalize()
          Graph finalize method.
 int getActiveClicks()
          Gets the active clicks.
 boolean getAlwaysUpdate()
          Gets the alwaysUpdate attribute.
 boolean getAntiAlias()
          Gets the state of the anti aliasing feature.
 NFFillPattern getBackgroundFillPattern()
          Gets the background fill pattern.
 NFRegion getBackgroundRegion()
          Returns the chart background region.
 java.lang.String getCDL()
          Returns the CDL representation of the chart (same as toString).
 int getChartElementSpacing()
          Gets the chart element spacing.
 java.lang.String getChartName()
          Get the chart name.
 java.awt.Dimension getChartSize()
          Gets the chart size - note that this may be meaningless if the container object does not allow the chart to resize.
 NFVector getColorTable()
          Gets the color table, This represents a default list of colors that the chart will use if certain data attribute colors are not explicitly defined.
 boolean getDataActiveLabelsEnabled()
          Get whether or not popups over data area are enabled.
abstract  java.lang.String getDefaultData()
           
 NFDwell getDwell()
          Gets the dwell, or "ActiveLabel" style.
 int getDwellOffset()
          Gets the dwell offset chart.
 java.util.Vector getErrors()
           
 NFTitle getFooter()
          Returns the chart footer.
static NFGraph getGraphFromTemplate(java.io.File template)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.io.File template, java.lang.String documentBase, java.util.Properties runtimeProperties)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.io.InputStream template)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.io.InputStream template, java.lang.String documentBase, java.util.Properties runtimeProperties)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.lang.String template)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.lang.String template, java.lang.String documentBase, java.util.Properties runtimeProperties)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.net.URL template)
          This method is a convenience function that allows any chart object to be created based on the given template.
static NFGraph getGraphFromTemplate(java.net.URL template, java.lang.String documentBase, java.util.Properties runtimeProperties)
          This method is a convenience function that allows any chart object to be created based on the given template.
 java.awt.Graphics getGraphGraphics()
          Returns the graphics object that is being used to draw the graph.
 NFTitle getHeader()
          Returns the chart header.
 NFTitle getLeftTitle()
          Returns the chart left title.
 NFLegend getLegend()
          Returns the chart legend.
 java.util.Hashtable getMetaData()
          Gets the meta data.
 java.awt.Dimension getMinimumSize()
          Gets the minimum size - this should be equivalent to the value passed in "setChartSize" or 400x400 if not defined.
 NFNoteSeries getNoteSeries()
          Gets the charts note series.
 NFNumberFormat getNumberFormat()
          Gets the number format.
 int getNumErrors()
           
 javax.swing.JPanel getPanel()
          Gets the JPanel the chart is drawn on.
 NFAreaSize getPlotArea()
          Gets the plot area.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size - this should be equivalent to the value passed in "setChartSize" or 400x400 if not defined.
 NFTitle getRightTitle()
          Returns the chart right title.
 javax.swing.JPanel getRootPanel()
          Gets the root chart panel.
 double getScaleFactor()
          Gets the scale factor.
abstract  int getType()
           
 void graphDrawn(java.awt.Graphics g)
          This method is called after the graph has been drawn.
 void graphTooSmall(java.awt.Dimension size)
          This method is called if the graph is trying to be drawn, but has not been given enough room to draw itself in.
 void initializeFromFile(java.io.File chartTemplate)
          This initializes the chart from a file object.
 void initializeFromString(java.lang.String chartTemplate)
          This initializes the chart from a CDL string.
 void initializeFromURL(java.net.URL chartTemplate)
          This initializes the chart from a URL object.
 void loadFromTemplate(java.io.File chartTemplate)
          This initializes the chart from a File object.
 void loadFromTemplate(java.lang.String chartTemplate)
          This initializes the chart from a CDL string.
 void loadFromTemplate(java.net.URL chartTemplate)
          This initializes the chart from a URL object.
static void loadLicenseFile(java.net.URL u)
          This method is called to load the given license file, using the URL provided.
 void paint(java.awt.Graphics g)
           
 void postDrag(java.lang.Object obj, double newX, double newY)
          This method is called immediately after a drag activity, allowing the observer to monitor the new settings.
 void postScroll(java.lang.Object obj, double scrollMin, double scrollMax, double scaleMin, double scaleMax)
          This method is called immediately after a scroll/zoom activity, allowing the observer to monitor the new settings.
 boolean preDrag(java.lang.Object obj, double curX, double curY, double newX, double newY)
          This method is called immediately prior to a drag operation, allowing the observer to examine the current and desired settings and to perform any custom processing.
 boolean preScroll(java.lang.Object obj, double scrollMin, double scrollMax, double curScaleMin, double curScaleMax, double newScaleMin, double newScaleMax)
          This method is called immediately prior to a scroll/zoom activity, allowing the observer to examine the current and desired settings and to perform any custom processing.
 void readExternal(java.io.ObjectInput in)
          Configures this chart object from a serialized object.
 void removeChartActionListener(NFChartActionListener l)
          Removes a chart action listener.
 void removeGraphObserver(NFGraphObserver observer)
          Removes a graph observer to the peer rendering engine.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a bound property change listener for this chart.
 void resetState()
          Resets all of the parameter values to their initial state.
 void sendData(java.lang.String key, java.lang.String value)
          Method to pass a Chart Definition Language (CDL) parameter directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
 void sendData(java.lang.String key, java.lang.String value, boolean sendUpdate)
          Method to pass a Chart Definition Language (CDL) parameter directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
 void sendData(java.util.Vector parameterVector)
          Method to pass one more Chart Definition Language (CDL) parameters directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
 void sendData(java.util.Vector parameterVector, boolean sendUpdate)
          Method to pass one more Chart Definition Language (CDL) parameters directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
 void sendUpdate()
          Tells the graph to update.
 void set(java.lang.Object expr)
          Deprecated. The "set" methods are only included to assist developers that are migrating previously developed project using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.
 void set(java.lang.String param, int itemIndex, int attrIndex, java.lang.Object val)
          Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.
 void set(java.lang.String param, int itemIndex, java.lang.Object val)
          Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.
 void set(java.lang.String param, java.lang.Object val)
          Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.
 void set(java.lang.String param, java.lang.Object itemKey, java.lang.Object val)
          Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.
 void set(java.lang.String param, java.lang.Object itemKey, java.lang.Object attrKey, java.lang.Object val)
          Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.
 void setActiveClicks(int activeClicks)
          Sets the active clicks.
 void setAlwaysUpdate(boolean alwaysUpdate)
          Sets the alwaysUpdate attribute.
 void setAntiAlias(boolean antiAlias)
          Sets the state of the anti aliasing feature.
 void setBackgroundFillPattern(NFFillPattern backgroundFillPattern)
          Sets the background fill pattern.
 void setBackgroundRegion(NFRegion backgroundRegion)
          Sets the chart background region.
 void setChartElementSpacing(int chartElementSpacing)
          Sets the chart element spacing.
 void setChartName(java.lang.String name)
          Set the chart name.
 void setChartSize(java.awt.Dimension chartSize)
          Sets the chart size - note that this may be meaningless if the container object does not allow the chart to resize.
 void setColorTable(NFVector colorTable)
          Sets the color table.
 void setDataActiveLabelsEnabled(boolean activeLabelsEnabled)
          Set enable popup labels over data areas.
 void setDocumentBase(java.lang.String documentBase)
          Sets the document base for chart generation.
 void setDwell(NFDwell dwell)
          Sets the dwell, or "ActiveLabel" style.
 void setDwellOffset(int dwellOffset)
          Sets the dwell offset for the chart.
 void setFooter(NFTitle footer)
          Sets the chart footer
 void setHeader(NFTitle header)
          Sets the chart header
 void setLeftTitle(NFTitle leftTitle)
          Sets the chart left title
 void setLegend(NFLegend legend)
          Sets the chart legend
static void setLicenseKey(java.lang.String key)
          This method can be used to programmatically set a license key.
 void setMetaData(java.util.Hashtable metaData)
          Sets the meta data.
 void setNoteSeries(NFNoteSeries noteSeries)
          Sets the charts note series.
 void setNumberFormat(NFNumberFormat numberFormat)
          Sets the number format.
 void setParentApplet(java.applet.Applet applet)
          If the chart is used in an applet-based application, the parent applet should be supplied in order to allow the rendering engine to find external files as needed.
 void setPlotArea(NFAreaSize plotArea)
          Sets the plot area.
 void setRightTitle(NFTitle rightTitle)
          Sets the chart right title
 void setScaleFactor(double scaleFactor)
          Sets the scale factor.
 void setSize(java.awt.Dimension chartSize)
          Sets the chart size.
 void setSize(int width, int height)
          Sets the chart size.
 void start()
          Starts the chart applet.
 void stop()
          Stops the chart applet.
 java.lang.String toString()
          Returns the CDL representation of the chart.
 void writeChart(java.lang.StringBuffer sb)
          Writes this chart into a string buffer
 void writeExternal(java.io.ObjectOutput out)
          Writes this chart into an object for serialization.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BAR

public static final int BAR
Indicates a bar chart type.

PIE

public static final int PIE
Indicates a pie chart type.

XY

public static final int XY
Indicates an XY chart type.

COMBO

public static final int COMBO
Indicates an Combo chart type.

DIAGRAM

public static final int DIAGRAM
Indicates an diagram chart type.

STRIP

public static final int STRIP
Indicates an strip chart type.

TIME

public static final int TIME
Indicates an time chart type.

STOCK

public static final int STOCK
Indicates an stock chart type.

BOX

public static final int BOX
Indicates an box chart type.

LINE

public static final int LINE
Indicates an line chart type.

DIAL

public static final int DIAL
Indicates an dial chart type.

BUBBLE

public static final int BUBBLE
Indicates an bubble chart type.

RADAR

public static final int RADAR
Indicates an radar chart type.
Constructor Detail

NFGraph

public NFGraph()
Constructs a default NFGraph object.

NFGraph

public NFGraph(java.util.Properties runtimeProperties)
Constructs a default NFGraph object.
Parameters:
runtimeProperties - A java.util.Properties object containing the set of runtime properties to use when generating the chart.

NFGraph

public NFGraph(javax.swing.JPanel panel)
Constructs an NFGraph object on the given JPanel.
Parameters:
panel - Panel to draw graph on.

NFGraph

public NFGraph(javax.swing.JPanel panel,
               java.util.Properties runtimeProperties)
Constructs an NFGraph object on the given JPanel.
Parameters:
panel - Panel to draw graph on.
runtimeProperties - A java.util.Properties object containing the set of runtime properties to use when generating the chart.
Method Detail

getDefaultData

public abstract java.lang.String getDefaultData()

getType

public abstract int getType()

initializeFromString

public void initializeFromString(java.lang.String chartTemplate)
This initializes the chart from a CDL string. This data will be used in order to define the chart's initial state.
Parameters:
chartTemplate. - String of CDL data

initializeFromFile

public void initializeFromFile(java.io.File chartTemplate)
This initializes the chart from a file object. This file will be used in order to define the chart's initial state.
Parameters:
chartTemplate. - File pointing to CDL data

initializeFromURL

public void initializeFromURL(java.net.URL chartTemplate)
This initializes the chart from a URL object. This file will be used in order to define the chart's initial state.
Parameters:
chartTemplate. - URL pointing to CDL data

loadFromTemplate

public void loadFromTemplate(java.io.File chartTemplate)
This initializes the chart from a File object. This data will be used in order to define the chart's state. This method differs from initializeFromFile in that no additional initialization will be performed. It is intended for use when chart objects are being reused and commonly used in conjunction with resetState.
Parameters:
chartTemplate - File pointing to CDL data.
See Also:
resetState()

loadFromTemplate

public void loadFromTemplate(java.net.URL chartTemplate)
This initializes the chart from a URL object. This data will be used in order to define the chart's state. This method differs from initializeFromURL in that no additional initialization will be performed. It is intended for use when chart objects are being reused and commonly used in conjunction with resetState.
Parameters:
chartTemplate - URL pointing to CDL data.
See Also:
resetState()

loadFromTemplate

public void loadFromTemplate(java.lang.String chartTemplate)
                      throws java.lang.Exception
This initializes the chart from a CDL string. This data will be used in order to define the chart's state. This method differs from initializeFromString in that no additional initialization will be performed. It is intended for use when chart objects are being reused and commonly used in conjunction with resetState.
Parameters:
chartTemplate - String containg the CDL data.
See Also:
resetState()

getGraphGraphics

public java.awt.Graphics getGraphGraphics()
Returns the graphics object that is being used to draw the graph.
Returns:
graphics

setDocumentBase

public void setDocumentBase(java.lang.String documentBase)
Sets the document base for chart generation.
Parameters:
documentBase. -  

setParentApplet

public void setParentApplet(java.applet.Applet applet)
If the chart is used in an applet-based application, the parent applet should be supplied in order to allow the rendering engine to find external files as needed.
Parameters:
applet - The parent applet.

finalize

public void finalize()
              throws java.lang.Throwable
Graph finalize method.

getErrors

public java.util.Vector getErrors()

getNumErrors

public int getNumErrors()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a bound property change listener for this chart. When a property of this graph is changed, a java.beans.propertyChangeEvent is sent to all the registered listeners.
Parameters:
l - the property change listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a bound property change listener for this chart.
Parameters:
l - the property change listener to be removed

stop

public void stop()
Stops the chart applet.

start

public void start()
Starts the chart applet.

display

public void display()
Deprecated. The "display" method is only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "display" method should only be used in the interim of converting to the NetCharts Pro API. Any future development should NOT use the "display" method but should use the "sendUpdate" instead. No guarantee is given as to how long the "display" method will be included in future products.

Tells the graph to update.

sendUpdate

public void sendUpdate()
Tells the graph to update.

sendData

public void sendData(java.lang.String key,
                     java.lang.String value)
Method to pass a Chart Definition Language (CDL) parameter directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
Parameters:
key - The parameter name, e.g., Background
value - The CDL value e.g., (RAISED, 2, gray)

sendData

public void sendData(java.lang.String key,
                     java.lang.String value,
                     boolean sendUpdate)
Method to pass a Chart Definition Language (CDL) parameter directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
Parameters:
key - The parameter name, e.g., Background
value - The CDL value e.g., (RAISED, 2, gray)
sendUpdate - If true, the chart is immediately updated with the new data.

sendData

public void sendData(java.util.Vector parameterVector)
Method to pass one more Chart Definition Language (CDL) parameters directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
Parameters:
parameterVector - Contains a list of NFKeyValue elements
See Also:
NFKeyValue

sendData

public void sendData(java.util.Vector parameterVector,
                     boolean sendUpdate)
Method to pass one more Chart Definition Language (CDL) parameters directly to the peer rendering engine - This will bypass any objects that have been created so should not be used unless all parameters are passed in this way.
Parameters:
parameterVector - Contains a list of NFKeyValue elements
sendUpdate - If true causes the chart to update immediately
See Also:
NFKeyValue

setAlwaysUpdate

public void setAlwaysUpdate(boolean alwaysUpdate)
Sets the alwaysUpdate attribute. When true (default), the chart will immediate update with the new data any time that a set[Attribute] method is called. If false, data will not be updated until after the sendUpdate method is called.
Parameters:
alwaysUpdate -  

getAlwaysUpdate

public boolean getAlwaysUpdate()
Gets the alwaysUpdate attribute. When true (default), the chart will immediate update with the new data any time that a set[Attribute] method is called. If false, data will not be updated until after the sendUpdate method is called.
Returns:
alwaysUpdate

setBackgroundRegion

public void setBackgroundRegion(NFRegion backgroundRegion)
Sets the chart background region.
Parameters:
backgroundRegion - Region object representing the background

getBackgroundRegion

public NFRegion getBackgroundRegion()
Returns the chart background region. Will create a new one from the state hashtable if the region has not been set.
Returns:
backgroundRegion Region object representing the background.

setFooter

public void setFooter(NFTitle footer)
Sets the chart footer
Parameters:
footer - Title object representing the footer

getFooter

public NFTitle getFooter()
Returns the chart footer. Will create a new one from the state hashtable if the footer has not been set.
Returns:
footer Title object representing the footer.

setHeader

public void setHeader(NFTitle header)
Sets the chart header
Parameters:
header - Title object representing the header

getHeader

public NFTitle getHeader()
Returns the chart header. Will create a new one from the state hashtable if the header has not been set.
Returns:
header Title object representing the header.

setLeftTitle

public void setLeftTitle(NFTitle leftTitle)
Sets the chart left title
Parameters:
leftTitle - Title object representing the left title

getLeftTitle

public NFTitle getLeftTitle()
Returns the chart left title. Will create a new one from the state hashtable if the left title has not been set.
Returns:
leftTitle Title object representing the left title.

setRightTitle

public void setRightTitle(NFTitle rightTitle)
Sets the chart right title
Parameters:
rightTitle - Title object representing the right title

getRightTitle

public NFTitle getRightTitle()
Returns the chart right title. Will create a new one from the state hashtable if the right title has not been set.
Returns:
rightTitle Title object representing the right title.

setLegend

public void setLegend(NFLegend legend)
Sets the chart legend
Parameters:
legend -  

getLegend

public NFLegend getLegend()
Returns the chart legend. Will create a new one from the state hashtable if the legend has not been set.
Returns:
legend

setChartName

public void setChartName(java.lang.String name)
Set the chart name.
Parameters:
name -  

getChartName

public java.lang.String getChartName()
Get the chart name.
Returns:
String containing the chart name.

addNote

public void addNote(NFNote note,
                    NFNoteSet set)
Convenience method to add notes to the chart.
Parameters:
note - Note to add
set - NoteSet style

setNoteSeries

public void setNoteSeries(NFNoteSeries noteSeries)
Sets the charts note series. A note series is a vector of note sets. The note set defines the style and note data.
Parameters:
noteSeries -  
See Also:
To set a property on the note series, you must first retrieve the series, then set the property (properties) and finally set the line series.
     NFBarchart chart = new NFBarchart();  // NFBarchart, NFBoxchart, etc.
     NFNoteSeries ns = chart.getNoteSeries();
     NFNoteSet set = (NFNoteSet)ss.elementAt(0);
     // Set some of the properties on the NFNoteSet
     ...
     ns.setElementAt(set, 0);
     chart.setStockSeries(ns);
 

getNoteSeries

public NFNoteSeries getNoteSeries()
Gets the charts note series. A note series is a vector of note sets. The note set defines the style and note data. This method will create a new note series from the state hashtable if the note series has not been set and no notes have been added. To set a property on the note series, you must first retrieve the series, then set the property (properties) and finally set the line series.
     NFBarchart chart = new NFBarchart();  // NFBarchart, NFBoxchart, etc.
     NFNoteSeries ns = chart.getNoteSeries();
     NFNoteSet set = (NFNoteSet)ss.elementAt(0);
     // Set some of the properties on the NFNoteSet
     ...
     ns.setElementAt(set, 0);
     chart.setStockSeries(ns);
 
Returns:
noteSeries
See Also:
addNote(netcharts.pro.common.NFNote, netcharts.pro.common.NFNoteSet)

setDwell

public void setDwell(NFDwell dwell)
Sets the dwell, or "ActiveLabel" style.
Parameters:
dwell -  

getDwell

public NFDwell getDwell()
Gets the dwell, or "ActiveLabel" style. Will create a new one from the state hashtable if the legend has not been set.
Returns:
dwell

setColorTable

public void setColorTable(NFVector colorTable)
Sets the color table. This represents a default list of colors that the chart will use if certain data attribute colors are not explicitly defined.
Parameters:
colorTable - A list of Color objects.

getColorTable

public NFVector getColorTable()
Gets the color table, This represents a default list of colors that the chart will use if certain data attribute colors are not explicitly defined. Will create a new one from the state hashtable if the colorTable has not been set.
Returns:
colorTable A list of Color objects.

setBackgroundFillPattern

public void setBackgroundFillPattern(NFFillPattern backgroundFillPattern)
Sets the background fill pattern. This attribute is only effective with JVM's 1.2 and higher.
Parameters:
backgroundFillPattern. -  

getBackgroundFillPattern

public NFFillPattern getBackgroundFillPattern()
Gets the background fill pattern. This attribute is only effective with JVM's 1.2 and higher.
Returns:
backgroundFillPattern.

setSize

public void setSize(int width,
                    int height)
Sets the chart size.
Parameters:
width - Chart width.
height - Chart height.

setSize

public void setSize(java.awt.Dimension chartSize)
Sets the chart size.
Parameters:
chartSize - Chart size

getPanel

public javax.swing.JPanel getPanel()
Gets the JPanel the chart is drawn on.

getRootPanel

public javax.swing.JPanel getRootPanel()
Gets the root chart panel. This is used for registering events occuring in the chart panel.

setChartSize

public void setChartSize(java.awt.Dimension chartSize)
Sets the chart size - note that this may be meaningless if the container object does not allow the chart to resize.
Parameters:
chartSize. -  

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size - this should be equivalent to the value passed in "setChartSize" or 400x400 if not defined.
Returns:
chartSize.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the minimum size - this should be equivalent to the value passed in "setChartSize" or 400x400 if not defined.
Returns:
chartSize.

getChartSize

public java.awt.Dimension getChartSize()
Gets the chart size - note that this may be meaningless if the container object does not allow the chart to resize.
Returns:
chartSize.

setAntiAlias

public void setAntiAlias(boolean antiAlias)
Sets the state of the anti aliasing feature. This attribute is only effective with JVM's 1.2 and higher.
Parameters:
antiAlias. -  

getAntiAlias

public boolean getAntiAlias()
Gets the state of the anti aliasing feature. This attribute is only effective with JVM's 1.2 and higher.
Returns:
antiAlias.

setScaleFactor

public void setScaleFactor(double scaleFactor)
Sets the scale factor. This is sometimes useful when fonts and other graphical elements must scale with the given chart size. 0.0 indicates no scaling
Parameters:
scaleFactor. -  

getScaleFactor

public double getScaleFactor()
Gets the scale factor. This is sometimes useful when fonts and other graphical elements must scale with the given chart size. 0.0 indicates no scaling
Returns:
scaleFactor.

setActiveClicks

public void setActiveClicks(int activeClicks)
Sets the active clicks. This is used to control the number of consecutive clicks needed to indicate a drilldown on an active label.
Parameters:
activeClicks. -  

getActiveClicks

public int getActiveClicks()
Gets the active clicks. This is used to control the number of consecutive clicks needed to indicate a drilldown on an active label.
Returns:
activeClicks.

setNumberFormat

public void setNumberFormat(NFNumberFormat numberFormat)
Sets the number format. Number format is used to determine decimal symbol to use, as well as numerical grouping. Rarely needed.
Parameters:
numberFormat -  

getNumberFormat

public NFNumberFormat getNumberFormat()
Gets the number format. Number format is used to determine decimal symbol to use, as well as numerical grouping. Rarely needed.
Returns:
numberFormat

setMetaData

public void setMetaData(java.util.Hashtable metaData)
Sets the meta data. Meta data is used to track information that is useful to keep with the chart but does not directly affect the chart rendering. For example "Author", "ModifiedDate", and so on.
Parameters:
metaData -  

getMetaData

public java.util.Hashtable getMetaData()
Gets the meta data. Meta data is used to track information that is useful to keep with the chart but does not directly affect the chart rendering. For example "Author", "ModifiedDate", and so on.
Returns:
metaData

setDwellOffset

public void setDwellOffset(int dwellOffset)
                    throws NFParamException
Sets the dwell offset for the chart. The DwellOffset specifies the length of the sides the define the square area around a "hotspot" associated with an active label. When the mouse moves into this hotspot, an active label, if defined, will be displayed. When the mouse is clicked within this hotspot, the target URL, if defined, will be "drilled" to.

By default, DwellOffset = 20, which means the hotspot for a datapoint will be a 20 by 20 pixel square centered over the data point. Set DwellOffset to something smaller to prevent overlap between the hotspots of tightly packed datapoints. To use the default DwellOffset, set to -1. Value must be greater than or equal to 0.

Parameters:
dwellOffset - The offset to use to determine the hotspot size.

getDwellOffset

public int getDwellOffset()
Gets the dwell offset chart. The DwellOffset specifies the length of the sides the definie the square area around a "hotspot" associated with an active label. When the mouse moves into this hotspot, an active label, if defined, will be displayed. When the mouse is clicked within this hotspot, the target URL, if defined, will be "drilled" to. By default, DwellOffset = 20, which means the hotspot for a datapoint will be a 20 by 20 pixel square centered over the data point. Set DwellOffset to something smaller to prevent overlap between the hotspots of tightly packed datapoints. If no dwell offset has been specified, returns -1.
Returns:
Dwell offset of the chart

setPlotArea

public void setPlotArea(NFAreaSize plotArea)
Sets the plot area. The PlotArea allows chart designers to define and bound the position of the plot area within the chart. The plot area is defined as the area where the data points and axes are displayed.
Parameters:
plotArea -  

getPlotArea

public NFAreaSize getPlotArea()
Gets the plot area. The PlotArea allows chart designers to define and bound the position of the plot area within the chart. The plot area is defined as the area where the data points and axes are displayed.
Returns:
plotArea

setChartElementSpacing

public void setChartElementSpacing(int chartElementSpacing)
Sets the chart element spacing. ChartElementSpacing defines the space between the elements of a chart. Chart elements include Titles, Legends, Axes and PlotArea.
Parameters:
chartElementSpacing - If < 0, then -1 (default) is used.

getChartElementSpacing

public int getChartElementSpacing()
Gets the chart element spacing. ChartElementSpacing defines the space between the elements of a chart. Chart elements include Titles, Legends, Axes and PlotArea.
Returns:
chartElementSpacing -1 is returned by default.

setDataActiveLabelsEnabled

public void setDataActiveLabelsEnabled(boolean activeLabelsEnabled)
Set enable popup labels over data areas.
Parameters:
activeLabelsEnabled - When popups will appear over data areas of the chart.

getDataActiveLabelsEnabled

public boolean getDataActiveLabelsEnabled()
Get whether or not popups over data area are enabled.
Returns:
activeLabelsEnabled When popups will appear over data based areas of the chart.

addChartActionListener

public void addChartActionListener(NFChartActionListener l)
Adds a chart action listener. Whenever there is a NFChartAction event is fired, the registered listeners will be notified.
Parameters:
l - the new action listener

removeChartActionListener

public void removeChartActionListener(NFChartActionListener l)
Removes a chart action listener.
Parameters:
l - the action listener to remove

addGraphObserver

public void addGraphObserver(NFGraphObserver observer)
Adds a graph observer to the peer rendering engine.
Parameters:
observer -  

removeGraphObserver

public void removeGraphObserver(NFGraphObserver observer)
Removes a graph observer to the peer rendering engine.
Parameters:
observer -  

dwellDisplay

public boolean dwellDisplay(boolean onoff,
                            netcharts.graphics.NFActiveLabel label)
Maps peer rendering engine events to ChartActionEvents. For internal use only.
Specified by:
dwellDisplay in interface NFDwellObserver
Following copied from interface: netcharts.graphics.NFDwellObserver
Parameters:
onoff - Whether the label is to be turned on or off.
label - The ActiveLabel.
Returns:
true if the label is NOT to be drawn, false otherwise.

dwellPress

public boolean dwellPress(java.awt.Event evt,
                          int x,
                          int y,
                          netcharts.graphics.NFActiveLabel label)
Maps peer rendering engine events to ChartActionEvents. For internal use only.
Specified by:
dwellPress in interface NFDwellObserver
Following copied from interface: netcharts.graphics.NFDwellObserver
Parameters:
evt - The Event.
x - The x coordinate of the event.
y - The y coordinate of the event.
label - The ActiveLabel.
Returns:
true if nothing is to be done, false if the document is to be shown.

graphDrawn

public void graphDrawn(java.awt.Graphics g)
Description copied from interface: NFGraphObserver
This method is called after the graph has been drawn.
Specified by:
graphDrawn in interface NFGraphObserver
Following copied from interface: netcharts.graphics.NFGraphObserver
Parameters:
g - The Graphics the graph was drawn on.

graphTooSmall

public void graphTooSmall(java.awt.Dimension size)
Description copied from interface: NFGraphObserver
This method is called if the graph is trying to be drawn, but has not been given enough room to draw itself in.
Specified by:
graphTooSmall in interface NFGraphObserver
Following copied from interface: netcharts.graphics.NFGraphObserver
Parameters:
size - The size the graph was given to draw itself in. This size is minus the area for the headers, legend, etc.

preDrag

public boolean preDrag(java.lang.Object obj,
                       double curX,
                       double curY,
                       double newX,
                       double newY)
Description copied from interface: NFDragObserver
This method is called immediately prior to a drag operation, allowing the observer to examine the current and desired settings and to perform any custom processing. The <obj> pointer specifies the object which is being scrolled. If a return value of "true" is specified, then the drag action will be allowed. Otherwise, it will be aborted.
Specified by:
preDrag in interface NFDragObserver
Following copied from interface: netcharts.graphics.NFDragObserver
Parameters:
obj - The object being dragged.
curX - The current X value.
curY - The current Y value.
newX - The new X value.
newY - The new Y value.
Returns:
Whether to perform the drag or not.

postDrag

public void postDrag(java.lang.Object obj,
                     double newX,
                     double newY)
Description copied from interface: NFDragObserver
This method is called immediately after a drag activity, allowing the observer to monitor the new settings. The <obj> pointer specifies the object that was affected.
Specified by:
postDrag in interface NFDragObserver
Following copied from interface: netcharts.graphics.NFDragObserver
Parameters:
obj - The object dragged.
newX - The new X value.
newY - The new Y value.

preScroll

public boolean preScroll(java.lang.Object obj,
                         double scrollMin,
                         double scrollMax,
                         double curScaleMin,
                         double curScaleMax,
                         double newScaleMin,
                         double newScaleMax)
Description copied from interface: NFScrollObserver
This method is called immediately prior to a scroll/zoom activity, allowing the observer to examine the current and desired settings and to perform any custom processing. The <obj> pointer specifies the object which is being scrolled. If a return value of "true" is specified, then the scroll action will be allowed. Otherwise, it will be aborted.
Specified by:
preScroll in interface NFScrollObserver
Following copied from interface: netcharts.graphics.NFScrollObserver
Parameters:
obj - The object being scrolled.
scrollMin - The minimum scroll value.
scrollMax - The maximum scroll value.
curScrollMin - The current minimum scroll value.
curScrollMax - The current maximum scroll value.
newScrollMin - The new minimum scroll value.
newScrollMax - The new maximum scroll value.
Returns:
Whether to proceed with the scroll or not.

postScroll

public void postScroll(java.lang.Object obj,
                       double scrollMin,
                       double scrollMax,
                       double scaleMin,
                       double scaleMax)
Description copied from interface: NFScrollObserver
This method is called immediately after a scroll/zoom activity, allowing the observer to monitor the new settings. The <obj> pointer specifies the object that was affected.
Specified by:
postScroll in interface NFScrollObserver
Following copied from interface: netcharts.graphics.NFScrollObserver
Parameters:
obj - The object scrolled.
scrollMin - The minimum scroll value.
scrollMax - The maximum scroll value.
scaleMin - The minimum scale value.
scaleMax - The maximum scale value.

resetState

public void resetState()
Resets all of the parameter values to their initial state.

set

public void set(java.lang.Object expr)
         throws NFParamException
Deprecated. The "set" methods are only included to assist developers that are migrating previously developed project using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.

Parses the given parameter expression, which may be defined using any of the types supported by NFLoadParams.loadParams().
Parameters:
expr - An expression to set on the chart.
See Also:
NFLoadParams

set

public void set(java.lang.String param,
                java.lang.Object val)
         throws NFParamException
Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.

Set the data value for the given parameter.

The VAL object should reference data according to the type of parameter specified by PARAM.

Parameter TypeData Object
Single-ValueRaw Data Object
Tuple AttributeRaw Data Object
Tuple ParameterVector of Raw Data Objects
Simple VectorVector of Raw Data Objects
Tuple VectorVector of Vector of Raw Data Objects

The following Raw Data Objects are supported for the various attribute types:

Attribute TypeRaw Data Objects
StringAny object type
NumberNumber, String
DateNFDate, NFTimeUnit, Number, String
ColorColor, String
SymbolNumber, String
ImageNFParamImage, Image, String

Examples:

 		set ("GraphType", "HORIZONTAL");
 		set ("Bar3DDepth", new Integer(15));
 
 		set ("BackgroundColor", Color.red);
 		set ("BackgroundWidth", new Integer(5));
 
 		Vector bg = new Vector();
 		bg.addElement (Color.white);
 		bg.addElement ("BOX");
 		bg.addElement (new Integer(5));
 		set ("Background", bg);
 
 		Vector labels = new Vector();
 		labels.addElement ("Engr");
 		labels.addElement ("Sales");
 		labels.addElement ("Mktg");
 		set ("BarLabels", labels);
 
 		Vector line = new Vector();

 		Vector pt = new Vector();
 		pt.addElement (new Integer(10));
 		pt.addElement (new Integer(20));
 		line.addElement (pt);

 		pt = new Vector();
 		pt.addElement (new Float(0.5));
 		pt.addElement (new Double(12.45));
 		line.addElement (pt);

 		set ("LineSet1", line);
 
Parameters:
param - Parameter to set.
object - New value for parameter.
Throws:
NFParamException -  

set

public void set(java.lang.String param,
                int itemIndex,
                java.lang.Object val)
         throws NFParamException
Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.

Set the data value for a specific attribute or item within a TUPLE or VECTOR parameter, based on the itemIndex given.

If a TUPLE parameter is specified, then the attribute with the given itemIndex will be replaced with the given data.

		set ("Background", 0, Color.red);
		set ("Background", 1, "BOX");
		set ("Background", 2, new Integer(10));
 

If a SIMPLE VECTOR parameter is specified, then the vector element with the given itemIndex will be replaced by the Raw Data Object given.

		set ("BarLabels", 2, "Marketing");

If a TUPLE VECTOR parameter is specified, then the entire vector tuple with the given itemIndex will be replaced by the Vector of Raw Data Objects given.

		Vector pt = new Vector();
		pt.addElement (new Float(13.5));
		pt.addElement (new Double(10.0));

		set ("LineSet1", 1, pt);

If a SINGLE VALUE parameter is specified, the itemIndex is ignored.

Parameters:
param - Parameter to set.
itemIndex - The target index within the TUPLE or VECTOR
object - New value for parameter.
Throws:
NFParamException -  

set

public void set(java.lang.String param,
                int itemIndex,
                int attrIndex,
                java.lang.Object val)
         throws NFParamException
Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.

Set the data value for a specific attribute within a TUPLE VECTOR.

The itemIndex is used to determine which tuple within the vector will be selected, and the attrIndex is used to determine which attribute within that tuple will be replaced by the Raw Data Object given.

If a non-vector parameter is specified, the attrIndex is ignored.

Parameters:
param - The parameter to set.
itemIndex - The index of the tuple to set.
attrIndex - The index of the attribute within the tuple to set
val - The new value.
Throws:
NFParamException - if an error occurs

set

public void set(java.lang.String param,
                java.lang.Object itemKey,
                java.lang.Object val)
         throws NFParamException
Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.

Set the data value for a specific attribute or item within a TUPLE or VECTOR parameter, based on the given itemKey.
Parameters:
param - The parameter name.
itemKey - The item key.
val - The new value for this item.
Throws:
NFParamException - if an error occurs

set

public void set(java.lang.String param,
                java.lang.Object itemKey,
                java.lang.Object attrKey,
                java.lang.Object val)
         throws NFParamException
Deprecated. The "set" methods are only included to assist developers that are migrating previously developed projects using older Visual Mining products to NetCharts Pro. The "set" methods should only be used in the interim of converting to the NetCharts Pro API. Properties modified using the "set" methods will not be mirrored in the object representation of the chart (i.e. the NetCharts Pro API representation). Any future development should NOT use the "set" methods. No guarantee is given as to how long the set API will be included in future products.

Set the data value for a specific attribute within a TUPLE VECTOR. The itemKey is used to determine which tuple is being changed and the attrKey is used to determine which attribute within that tuple should be changed.
Parameters:
param - The parameter name.
itemKey - The itemKey for the parameter.
attrKey - The attribute key for the item
val - The new value for this attribute of this tuple in this parameter.
Throws:
NFParamException - if an error occurs

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Configures this chart object from a serialized object.
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - Object input stream.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes this chart into an object for serialization.
Specified by:
writeExternal in interface java.io.Externalizable

getCDL

public java.lang.String getCDL()
Returns the CDL representation of the chart (same as toString).

toString

public java.lang.String toString()
Returns the CDL representation of the chart.
Overrides:
toString in class java.lang.Object

writeChart

public void writeChart(java.lang.StringBuffer sb)
Writes this chart into a string buffer

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.File template)
                                    throws java.lang.Exception
This method is a convenience function that allows any chart object to be created based on the given template. Based on the contents of the template, a chart object of the appropriate type will be created and initialized with the template parameters.
Parameters:
template - The template file.
Returns:
the generated graph or null if the template cannot be read or has invalid information.

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.File template,
                                           java.lang.String documentBase,
                                           java.util.Properties runtimeProperties)
                                    throws java.lang.Exception
This method is a convenience function that allows any chart object to be created based on the given template. Based on the contents of the template, a chart object of the appropriate type will be created and initialized with the template parameters.
Parameters:
template - The template file.
documentBase - The base URL to use for chart generation.
runtimeProperties - A java.util.Properties object containing the set of runtime properties to be used during chart generation.
Returns:
the generated graph or null if the template cannot be read or has invalid information.