NetCharts Pro

netcharts.pro.common
Class NFGraph

java.lang.Object
  extended by netcharts.pro.common.NFGraph
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, NFDragObserver, NFDwellObserver, NFGraphObserver, NFScrollObserver
Direct Known Subclasses:
NFDiagramchart, NFHeatmapchart, NFSizedChart, 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 ANTIALIAS_OFF
          Indicates an AntiAlias mode
static int ANTIALIAS_ON
          Indicates an AntiAlias mode
static int ANTIALIAS_ONDRAW
          Indicates an AntiAlias mode
static int ANTIALIAS_ONTEXT
          Indicates an AntiAlias mode
static java.util.Hashtable antiAliasModeMap
          The set of allowed anti-alias modes.
static int BAR
          Indicates a bar chart type.
static int BAR3D
          Indicates a 3D 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 DWELL_ANIMATION_STYLE_HIGHLIGHT
          Dwell animation style highlight
static int DWELL_ANIMATION_STYLE_NONE
          No dwell animation
static int FADE
          Indicates legend animation style type
static int HEATMAP
          Indicates a heatmap chart type.
static int HIGHLIGHT
          Indicates legend dwell animation style type
static int HISTOGRAM
          Indicates a Histogram chart type.
static int LABEL_ANIMATION_STYLE_FADE
          Label animation style fade
static int LABEL_ANIMATION_STYLE_NONE
          No label animation
static int LEGEND_ANIMATION_STYLE_FADE
          Legend animation style fade
static int LEGEND_ANIMATION_STYLE_NONE
          No legend animation
static int LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT
          Legend dwell animation style highlight
static int LEGEND_DWELL_ANIMATION_STYLE_NONE
          No legend dwell animation
static int LINE
          Indicates an line chart type.
static int MULTIPIE
          Indicates a MultiPie chart type.
static int PARETO
          Indicates a pareto chart type.
static int PIE
          Indicates a pie chart type.
static int POLAR
          Indicates an radar 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()
          Tells the graph to update.
 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()
          Calls getAntiAliasMode to get the state of the anti aliasing feature.
 int getAntiAliasMode()
          Gets the state of the anti aliasing feature.
 NFActiveLabel getBackgroundActiveLabel()
          Gets the background active label.
 NFFillPattern getBackgroundFillPattern()
          Gets the background fill pattern.
 NFRegion getBackgroundRegion()
          Returns the chart background region.
 boolean getBuildAnimationEnabled()
          Determine if build animations are enabled in supported output formats.
 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()
          Returns the default data used for the chart.
 NFDwell getDwell()
          Gets the dwell, or "ActiveLabel" style.
 NFDwellAnimation getDwellAnimation()
          Get the dwell animation style.
 NFFillBorder getDwellAnimationHighlight()
          Gets the dwell animation highlight.
 int getDwellAnimationStyle()
          Get the dwell animation style.
 int getDwellOffset()
          Gets the dwell offset chart.
 java.util.Vector getErrors()
          Returns the Vector of errors generated during a template load.
 NFTitle getFooter()
          Returns the chart footer.
 JGraph getGraph()
          Returns the peer rendering engine.
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.util.Locale locale)
          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.File template, java.lang.String documentBase, java.util.Properties runtimeProperties, java.util.Locale locale)
          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.util.Locale locale)
          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.io.InputStream template, java.lang.String documentBase, java.util.Properties runtimeProperties, java.util.Locale locale)
          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.util.Locale locale)
          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.lang.String template, java.lang.String documentBase, java.util.Properties runtimeProperties, java.util.Locale locale)
          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.util.Locale locale)
          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.
static NFGraph getGraphFromTemplate(java.net.URL template, java.lang.String documentBase, java.util.Properties runtimeProperties, java.util.Locale locale)
          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.
 int getLabelAnimationStyle()
          Get the label animation style.
 NFTitle getLeftTitle()
          Returns the chart left title.
 NFLegend getLegend()
          Returns the chart legend.
 int getLegendAnimationStyle()
          Get the legend animation style.
 NFLegendDwellAnimation getLegendDwellAnimation()
          Get the legend dwell animation style.
 NFFillBorder getLegendDwellAnimationHighlight()
          Gets the legend dwell animation highlight.
 int getLegendDwellAnimationStyle()
          Get the legend dwell animation style.
static java.lang.String getLicenseActivationKey()
          Get the license activation key.
 java.util.Locale getLocale()
          Gets the locale.
 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()
          Returns the number of errors generated during a template load.
 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.
 NFFillBorder getRubberband()
          Gets the rubberband for zoom.
 double getScaleFactor()
          Gets the scale factor.
 int getTitleSpacing()
          Gets the title spacing.
 boolean getToggleDataVisibility()
          Returns whether show/hide data should be enabled when clicking on a legend item true enable show/hide data false disable show/hide data
abstract  int getType()
          Returns the chart type.
static java.lang.String getVersion()
          Get the current product version.
 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)
          Deprecated.  
 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)
          Parses the given CDL parameter expression.
 void set(java.lang.String param, int itemIndex, int attrIndex, java.lang.Object val)
          Set the data value for a specific attribute within a TUPLE VECTOR.
 void set(java.lang.String param, int itemIndex, java.lang.Object val)
          Set the data value for a specific attribute or item within a TUPLE or VECTOR parameter, based on the itemIndex given.
 void set(java.lang.String param, java.lang.Object val)
          Set the data value for the given parameter.
 void set(java.lang.String param, java.lang.Object itemKey, java.lang.Object val)
          Set the data value for a specific attribute or item within a TUPLE or VECTOR parameter, based on the given itemKey.
 void set(java.lang.String param, java.lang.Object itemKey, java.lang.Object attrKey, java.lang.Object val)
          Set the data value for a specific attribute within a TUPLE VECTOR.
 void setActiveClicks(int activeClicks)
          Sets the active clicks.
 void setAlwaysUpdate(boolean alwaysUpdate)
          Sets the alwaysUpdate attribute.
 void setAntiAlias(boolean antiAlias)
          Calls setAntiAliasMode to set the state of the anti aliasing feature.
 void setAntiAliasMode(int antiAliasMode)
          Sets the state of the anti aliasing feature.
 void setBackgroundActiveLabel(NFActiveLabel backgroundActiveLabel)
          Sets the background active label.
 void setBackgroundFillPattern(NFFillPattern backgroundFillPattern)
          Sets the background fill pattern.
 void setBackgroundRegion(NFRegion backgroundRegion)
          Sets the chart background region.
 void setBuildAnimationEnabled(boolean buildAnimationEnabled)
          Enable build animations in supported output formats.
 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 setDwellAnimation(NFDwellAnimation dwellAnimation)
          Set the dwell animation style.
 void setDwellAnimationHighlight(NFFillBorder fb)
          Sets the dwell animation highlight.
 void setDwellAnimationStyle(int style)
          Set the dwell animation 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 setLabelAnimationStyle(int style)
          Set the label animation style.
 void setLeftTitle(NFTitle leftTitle)
          Sets the chart left title
 void setLegend(NFLegend legend)
          Sets the chart legend
 void setLegendAnimationStyle(int style)
          Set the legend animation style.
 void setLegendDwellAnimation(NFLegendDwellAnimation legendDwellAnimation)
          Set the legend dwell animation style.
 void setLegendDwellAnimationHighlight(NFFillBorder fb)
          Sets the legend dwell animation highlight.
 void setLegendDwellAnimationStyle(int style)
          Set the legend dwell animation style.
static void setLicenseKey(byte[] key)
          This method can be used to programmatically set a license key.
static void setLicenseKey(java.lang.String key)
          This method can be used to programmatically set a license key.
static void setLicenseLocation(java.io.File location)
          This method can be used to programmatically set the folder containing the license.
 void setLocale(java.util.Locale locale)
          Sets the locale.
 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 setRubberband(NFFillBorder fb)
          Sets the rubberband.
 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 setTitleSpacing(int titleSpacing)
          Sets the title spacing.
 void setToggleDataVisibility(boolean toggleDataVisibility)
          Sets whether show/hide data should be enabled when clicking on a legend item
 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.


BAR3D

public static final int BAR3D
Indicates a 3D 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.


POLAR

public static final int POLAR
Indicates an radar chart type.


PARETO

public static final int PARETO
Indicates a pareto chart type.


HEATMAP

public static final int HEATMAP
Indicates a heatmap chart type.


MULTIPIE

public static final int MULTIPIE
Indicates a MultiPie chart type.


HISTOGRAM

public static final int HISTOGRAM
Indicates a Histogram chart type.


ANTIALIAS_ON

public static final int ANTIALIAS_ON
Indicates an AntiAlias mode

See Also:
Constant Field Values

ANTIALIAS_ONDRAW

public static final int ANTIALIAS_ONDRAW
Indicates an AntiAlias mode

See Also:
Constant Field Values

ANTIALIAS_ONTEXT

public static final int ANTIALIAS_ONTEXT
Indicates an AntiAlias mode

See Also:
Constant Field Values

ANTIALIAS_OFF

public static final int ANTIALIAS_OFF
Indicates an AntiAlias mode

See Also:
Constant Field Values

FADE

public static final int FADE
Indicates legend animation style type

See Also:
Constant Field Values

HIGHLIGHT

public static final int HIGHLIGHT
Indicates legend dwell animation style type

See Also:
Constant Field Values

LEGEND_ANIMATION_STYLE_NONE

public static final int LEGEND_ANIMATION_STYLE_NONE
No legend animation

See Also:
Constant Field Values

LEGEND_ANIMATION_STYLE_FADE

public static final int LEGEND_ANIMATION_STYLE_FADE
Legend animation style fade

See Also:
Constant Field Values

LABEL_ANIMATION_STYLE_NONE

public static final int LABEL_ANIMATION_STYLE_NONE
No label animation

See Also:
Constant Field Values

LABEL_ANIMATION_STYLE_FADE

public static final int LABEL_ANIMATION_STYLE_FADE
Label animation style fade

See Also:
Constant Field Values

DWELL_ANIMATION_STYLE_NONE

public static final int DWELL_ANIMATION_STYLE_NONE
No dwell animation

See Also:
Constant Field Values

DWELL_ANIMATION_STYLE_HIGHLIGHT

public static final int DWELL_ANIMATION_STYLE_HIGHLIGHT
Dwell animation style highlight

See Also:
Constant Field Values

LEGEND_DWELL_ANIMATION_STYLE_NONE

public static final int LEGEND_DWELL_ANIMATION_STYLE_NONE
No legend dwell animation

See Also:
Constant Field Values

LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT

public static final int LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT
Legend dwell animation style highlight

See Also:
Constant Field Values

antiAliasModeMap

public static java.util.Hashtable antiAliasModeMap
The set of allowed anti-alias modes. Consists of ON, ONDRAW, ONTEXT, OFF.

Constructor Detail

NFGraph

public NFGraph()
Constructs a default NFGraph object.


NFGraph

public NFGraph(java.util.Properties runtimeProperties)
Constructs a default NFGraph object.

Currently available runtime properties are:


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. See the NFGraph(java.util.Properties) constructor for a list of valid Properties.
Method Detail

getDefaultData

public abstract java.lang.String getDefaultData()
Returns the default data used for the chart. Must be implemented by subclasses.

Returns:
The default data used to initialize a chart.

getType

public abstract int getType()
Returns the chart type.

Returns:
The chart type identifying the chart.

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.
Throws:
java.lang.Exception
See Also:
resetState()

getGraph

public JGraph getGraph()
Returns the peer rendering engine. For internal use only.

Returns:
graph

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.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getErrors

public java.util.Vector getErrors()
Returns the Vector of errors generated during a template load.

Returns:
The Vector of errors generated during a template load.

getNumErrors

public int getNumErrors()
Returns the number of errors generated during a template load.

Returns:
The number of errors generated during a template load.

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()
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)

setDwellAnimationHighlight

public void setDwellAnimationHighlight(NFFillBorder fb)
Sets the dwell animation highlight.

Parameters:
dwellAnimationHighlight -

getDwellAnimationHighlight

public NFFillBorder getDwellAnimationHighlight()
Gets the dwell animation highlight. Will create a new one from the state hashtable if the highlight has not been set.

Returns:
dwellanimation

setDwellAnimation

public void setDwellAnimation(NFDwellAnimation dwellAnimation)
Set the dwell animation style.

Parameters:
dwellAnimation - A dwell animation object

getDwellAnimation

public NFDwellAnimation getDwellAnimation()
Get the dwell animation style.

Returns:
A dwell animation object

setDwellAnimationStyle

public void setDwellAnimationStyle(int style)
Set the dwell animation style.

If the value passed is not a valid dwell animation style, DWELL_ANIMATION_STYLE_NONE will be used.

Parameters:
style - One of DWELL_ANIMATION_STYLE_NONE (default) or DWELL_ANIMATION_STYLE_HIGHLIGHT

getDwellAnimationStyle

public int getDwellAnimationStyle()
Get the dwell animation style.

Returns:
style One of DWELL_ANIMATION_STYLE_NONE (default) or DWELL_ANIMATION_STYLE_HIGHLIGHT

setLegendDwellAnimation

public void setLegendDwellAnimation(NFLegendDwellAnimation legendDwellAnimation)
Set the legend dwell animation style.

Parameters:
legendDwellAnimation - A legend dwell animation object

getLegendDwellAnimation

public NFLegendDwellAnimation getLegendDwellAnimation()
Get the legend dwell animation style.

Returns:
A legend dwell animation object

setLegendDwellAnimationHighlight

public void setLegendDwellAnimationHighlight(NFFillBorder fb)
Sets the legend dwell animation highlight.

Parameters:
legenddwellAnimation -

getLegendDwellAnimationHighlight

public NFFillBorder getLegendDwellAnimationHighlight()
Gets the legend dwell animation highlight. Will create a new one from the state hashtable if the highlight has not been set.

Returns:
legenddwellanimation

setLegendDwellAnimationStyle

public void setLegendDwellAnimationStyle(int style)
Set the legend dwell animation style.

If the value passed is not a valid legend dwell animation style, LEGEND_DWELL_ANIMATION_STYLE_NONE will be used.

Parameters:
style - One of LEGEND_DWELL_ANIMATION_STYLE_NONE (default) or LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT

getLegendDwellAnimationStyle

public int getLegendDwellAnimationStyle()
Get the legend dwell animation style.

Returns:
style One of LEGEND_DWELL_ANIMATION_STYLE_NONE (default) or LEGEND_DWELL_ANIMATION_STYLE_HIGHLIGHT

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.

setBackgroundActiveLabel

public void setBackgroundActiveLabel(NFActiveLabel backgroundActiveLabel)
Sets the background active label.

Parameters:
backgroundActiveLabel - Background active label object.

getBackgroundActiveLabel

public NFActiveLabel getBackgroundActiveLabel()
Gets the background active label.

Returns:
backgroundActiveLabel or null if not defined.

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)
Calls setAntiAliasMode to set the state of the anti aliasing feature. This attribute is only effective with JVM's 1.2 and higher.

Parameters:
antiAlias -

setAntiAliasMode

public void setAntiAliasMode(int antiAliasMode)
Sets the state of the anti aliasing feature. This attribute is only effective with JVM's 1.2 and higher.

Parameters:
antiAliasMode -

getAntiAlias

public boolean getAntiAlias()
Calls getAntiAliasMode to get the state of the anti aliasing feature. This attribute is only effective with JVM's 1.2 and higher.

Returns:
true if anti aliasing mode is ON otherwise returns false

getAntiAliasMode

public int getAntiAliasMode()
Gets the state of the anti aliasing feature. This attribute is only effective with JVM's 1.2 and higher.

Returns:
integer value indicating anti alias state either 0, 1, 2, or -1 0 antialiasing on, 1 antialiasing just text, 2 antialiasing just draw operations, -1 antialiasing off

setLegendAnimationStyle

public void setLegendAnimationStyle(int style)
Set the legend animation style.

If the value passed is not a valid legend animation style, LEGEND_ANIMATION_STYLE_NONE will be used.

Parameters:
style - One of LEGEND_ANIMATION_STYLE_NONE (default) or LEGEND_ANIMATION_STYLE_FADE

getLegendAnimationStyle

public int getLegendAnimationStyle()
Get the legend animation style.

Returns:
style One of LEGEND_ANIMATION_STYLE_NONE (default) or LEGEND_ANIMATION_STYLE_FADE

setLabelAnimationStyle

public void setLabelAnimationStyle(int style)
Set the label animation style.

If the value passed is not a valid label animation style, LABEL_ANIMATION_STYLE_NONE will be used.

Parameters:
style - One of LABEL_ANIMATION_STYLE_NONE (default) or LABEL_ANIMATION_STYLE_FADE

getLabelAnimationStyle

public int getLabelAnimationStyle()
Get the label animation style.

Returns:
style One of LABEL_ANIMATION_STYLE_NONE (default) or LABEL_ANIMATION_STYLE_FADE

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

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale. The locale is used to determine formatting symbols for decimals and dates.

Parameters:
locale -

getLocale

public java.util.Locale getLocale()
Gets the locale. The locale is used to determine formatting symbols for decimals and dates.

Returns:
locale

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.
Throws:
NFParamException

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.

setTitleSpacing

public void setTitleSpacing(int titleSpacing)
Sets the title spacing. TitleSpacing defines the space between the background border of a chart and the titles.

Parameters:
titleSpacing - If < 0, then -1 (default) is used.

getTitleSpacing

public int getTitleSpacing()
Gets the title spacing. TitleSpacing defines the space between the background border of a chart and the titles.

Returns:
titleSpacing -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.

setToggleDataVisibility

public void setToggleDataVisibility(boolean toggleDataVisibility)
Sets whether show/hide data should be enabled when clicking on a legend item

Parameters:
toggleDataVisibility - true enable show/hide data false disable show/hide data

getToggleDataVisibility

public boolean getToggleDataVisibility()
Returns whether show/hide data should be enabled when clicking on a legend item true enable show/hide data false disable show/hide data


getRubberband

public NFFillBorder getRubberband()
Gets the rubberband for zoom. Will create a new one from the state hashtable if the rubberband has not been set.

Returns:
rubberband

setRubberband

public void setRubberband(NFFillBorder fb)
Sets the rubberband.

Parameters:
rubberband -

setBuildAnimationEnabled

public void setBuildAnimationEnabled(boolean buildAnimationEnabled)
Enable build animations in supported output formats.

Parameters:
buildAnimationEnabled - Whether build animations should be enabled in supported output formats.

getBuildAnimationEnabled

public boolean getBuildAnimationEnabled()
Determine if build animations are enabled in supported output formats.

Returns:
Whether build animations should be enabled in supported output formats.

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
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
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
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
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
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
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
Parameters:
obj - The object being scrolled.
scrollMin - The minimum scroll value.
scrollMax - The 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
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
Parses the given CDL parameter expression. This method is part of the NetCharts Pro "string-based" API. Avoid using this method in combination with the NCPro Object-oriented API.

Parameters:
expr - A string of CDL to set on the chart.
Throws:
NFParamException

set

public void set(java.lang.String param,
                java.lang.Object val)
         throws NFParamException
Set the data value for the given parameter. This method is part of the NetCharts Pro "string-based" API. Avoid using this method in combination with the NCPro Object-oriented API.

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.
val - New value for parameter.
Throws:
NFParamException

set

public void set(java.lang.String param,
                int itemIndex,
                java.lang.Object val)
         throws NFParamException
Set the data value for a specific attribute or item within a TUPLE or VECTOR parameter, based on the itemIndex given. This method is part of the NetCharts Pro "string-based" API. Avoid using this method in combination with the NCPro Object-oriented API.

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
val - New value for parameter.
Throws:
NFParamException

set

public void set(java.lang.String param,
                int itemIndex,
                int attrIndex,
                java.lang.Object val)
         throws NFParamException
Set the data value for a specific attribute within a TUPLE VECTOR. This method is part of the NetCharts Pro "string-based" API. Avoid using this method in combination with the NCPro Object-oriented API.

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
Set the data value for a specific attribute or item within a TUPLE or VECTOR parameter, based on the given itemKey. This method is part of the NetCharts Pro "string-based" API. Avoid using this method in combination with the NCPro Object-oriented API.

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
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. This method is part of the NetCharts Pro "string-based" API. Avoid using this method in combination with the NCPro Object-oriented API.

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.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

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
Throws:
java.io.IOException

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.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.File template,
                                           java.util.Locale locale)
                                    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.
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

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.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.File template,
                                           java.lang.String documentBase,
                                           java.util.Properties runtimeProperties,
                                           java.util.Locale locale)
                                    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.
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.net.URL 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 URL.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.net.URL template,
                                           java.util.Locale locale)
                                    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 URL.
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.net.URL 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 URL.
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.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.net.URL template,
                                           java.lang.String documentBase,
                                           java.util.Properties runtimeProperties,
                                           java.util.Locale locale)
                                    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 URL.
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
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.InputStream 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 input stream.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.InputStream template,
                                           java.util.Locale locale)
                                    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 input stream.
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.InputStream 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 input stream.
documentBase - The base URL to use for chart generation.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.io.InputStream template,
                                           java.lang.String documentBase,
                                           java.util.Properties runtimeProperties,
                                           java.util.Locale locale)
                                    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 input stream.
documentBase - The base URL to use for chart generation.
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.lang.String 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 parameter string.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.lang.String template,
                                           java.util.Locale locale)
                                    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 parameter string.
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.lang.String 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 parameter string.
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.
Throws:
java.lang.Exception

getGraphFromTemplate

public static NFGraph getGraphFromTemplate(java.lang.String template,
                                           java.lang.String documentBase,
                                           java.util.Properties runtimeProperties,
                                           java.util.Locale locale)
                                    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 parameter string.
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
locale - The locale.
Returns:
the generated graph or null if the template cannot be read or has invalid information.
Throws:
java.lang.Exception

setLicenseKey

public static void setLicenseKey(java.lang.String key)
This method can be used to programmatically set a license key.

Parameters:
key -

setLicenseKey

public static void setLicenseKey(byte[] key)
This method can be used to programmatically set a license key.

Parameters:
key -

setLicenseLocation

public static void setLicenseLocation(java.io.File location)
This method can be used to programmatically set the folder containing the license.

Parameters:
location -

loadLicenseFile

public static void loadLicenseFile(java.net.URL u)
                            throws java.lang.Exception
This method is called to load the given license file, using the URL provided.

Throws:
java.lang.Exception

getVersion

public static final java.lang.String getVersion()
Get the current product version.


getLicenseActivationKey

public static final java.lang.String getLicenseActivationKey()
Get the license activation key.


paint

public void paint(java.awt.Graphics g)
Deprecated. 

Causes a paint event on the underlying graph instance

Parameters:
g - The Graphics to paint onto the graph instance

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 - 2018
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: Jan 7, 2018