|
NetCharts Pro | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--netcharts.pro.common.NFGraph
Abstract superclass for all chart rendering engines. Provides a number of methods and utilities that are used for all NetCharts objects.
| 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 |
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 |
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()
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()
Calls getAntiAliasMode to get the state of the anti aliasing feature. |
int |
getAntiAliasMode()
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()
Returns the default data used for the chart. |
NFDwell |
getDwell()
Gets the dwell, or "ActiveLabel" 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. |
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()
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. |
double |
getScaleFactor()
Gets the scale factor. |
abstract int |
getType()
Returns the chart type. |
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)
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)
Calls setAntiAliasMode to set the state of the anti aliasing feature. |
void |
setAntiAliasMode(int antiAliasMode)
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 |
public static final int BAR
public static final int PIE
public static final int XY
public static final int COMBO
public static final int DIAGRAM
public static final int STRIP
public static final int TIME
public static final int STOCK
public static final int BOX
public static final int LINE
public static final int DIAL
public static final int BUBBLE
public static final int RADAR
public static final int POLAR
public static final int ANTIALIAS_ON
public static final int ANTIALIAS_ONDRAW
public static final int ANTIALIAS_ONTEXT
public static final int ANTIALIAS_OFF
public static java.util.Hashtable antiAliasModeMap
ON, ONDRAW, ONTEXT, OFF.| Constructor Detail |
public NFGraph()
public NFGraph(java.util.Properties runtimeProperties)
Currently available runtime properties are:
Properties props = new Properties();
props.put("DateFormats", "\"dd/MM/yy HH:mm:ss\",\"dd-MMM-yyyy\"");
runtimeProperties - A java.util.Properties object containing the set
of runtime properties to use when generating the chart.public NFGraph(javax.swing.JPanel panel)
panel - Panel to draw graph on.
public NFGraph(javax.swing.JPanel panel,
java.util.Properties runtimeProperties)
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 |
public abstract java.lang.String getDefaultData()
public abstract int getType()
public void initializeFromString(java.lang.String chartTemplate)
chartTemplate - String of CDL datapublic void initializeFromFile(java.io.File chartTemplate)
chartTemplate - File pointing to CDL datapublic void initializeFromURL(java.net.URL chartTemplate)
chartTemplate - URL pointing to CDL datapublic void loadFromTemplate(java.io.File chartTemplate)
chartTemplate - File pointing to CDL data.resetState()public void loadFromTemplate(java.net.URL chartTemplate)
chartTemplate - URL pointing to CDL data.resetState()
public void loadFromTemplate(java.lang.String chartTemplate)
throws java.lang.Exception
chartTemplate - String containg the CDL data.resetState()public java.awt.Graphics getGraphGraphics()
public void setDocumentBase(java.lang.String documentBase)
documentBase - public void setParentApplet(java.applet.Applet applet)
applet - The parent applet.
public void finalize()
throws java.lang.Throwable
public java.util.Vector getErrors()
public int getNumErrors()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l - the property change listener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l - the property change listener to be removedpublic void stop()
public void start()
public void display()
public void sendUpdate()
public void sendData(java.lang.String key,
java.lang.String value)
key - The parameter name, e.g., Backgroundvalue - The CDL value e.g., (RAISED, 2, gray)
public void sendData(java.lang.String key,
java.lang.String value,
boolean sendUpdate)
key - The parameter name, e.g., Backgroundvalue - The CDL value e.g., (RAISED, 2, gray)sendUpdate - If true, the chart is immediately updated
with the new data.public void sendData(java.util.Vector parameterVector)
parameterVector - Contains a list of NFKeyValue elementsNFKeyValue
public void sendData(java.util.Vector parameterVector,
boolean sendUpdate)
parameterVector - Contains a list of NFKeyValue elementssendUpdate - If true causes the chart to update immediatelyNFKeyValuepublic void setAlwaysUpdate(boolean alwaysUpdate)
alwaysUpdate - public boolean getAlwaysUpdate()
public void setBackgroundRegion(NFRegion backgroundRegion)
backgroundRegion - Region object representing the backgroundpublic NFRegion getBackgroundRegion()
public void setFooter(NFTitle footer)
footer - Title object representing the footerpublic NFTitle getFooter()
public void setHeader(NFTitle header)
header - Title object representing the headerpublic NFTitle getHeader()
public void setLeftTitle(NFTitle leftTitle)
leftTitle - Title object representing the left titlepublic NFTitle getLeftTitle()
public void setRightTitle(NFTitle rightTitle)
rightTitle - Title object representing the right titlepublic NFTitle getRightTitle()
public void setLegend(NFLegend legend)
legend - public NFLegend getLegend()
public void setChartName(java.lang.String name)
name - public java.lang.String getChartName()
public void addNote(NFNote note,
NFNoteSet set)
note - Note to addset - NoteSet stylepublic void setNoteSeries(NFNoteSeries noteSeries)
noteSeries - 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);
public NFNoteSeries getNoteSeries()
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);
addNote(netcharts.pro.common.NFNote, netcharts.pro.common.NFNoteSet)public void setDwell(NFDwell dwell)
dwell - public NFDwell getDwell()
public void setColorTable(NFVector colorTable)
colorTable - A list of Color objects.public NFVector getColorTable()
public void setBackgroundFillPattern(NFFillPattern backgroundFillPattern)
backgroundFillPattern - public NFFillPattern getBackgroundFillPattern()
public void setSize(int width,
int height)
width - Chart width.height - Chart height.public void setSize(java.awt.Dimension chartSize)
chartSize - Chart sizepublic javax.swing.JPanel getPanel()
public javax.swing.JPanel getRootPanel()
public void setChartSize(java.awt.Dimension chartSize)
chartSize - public java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public java.awt.Dimension getChartSize()
public void setAntiAlias(boolean antiAlias)
antiAlias - public void setAntiAliasMode(int antiAliasMode)
antiAliasMode. - public boolean getAntiAlias()
public int getAntiAliasMode()
public void setScaleFactor(double scaleFactor)
scaleFactor - public double getScaleFactor()
public void setActiveClicks(int activeClicks)
activeClicks - public int getActiveClicks()
public void setNumberFormat(NFNumberFormat numberFormat)
numberFormat - public NFNumberFormat getNumberFormat()
public void setMetaData(java.util.Hashtable metaData)
metaData - public java.util.Hashtable getMetaData()
public void setDwellOffset(int dwellOffset)
throws NFParamException
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.
dwellOffset - The offset to use to determine the hotspot size.public int getDwellOffset()
public void setPlotArea(NFAreaSize plotArea)
plotArea - public NFAreaSize getPlotArea()
public void setChartElementSpacing(int chartElementSpacing)
chartElementSpacing - If < 0, then -1 (default) is used.public int getChartElementSpacing()
-1 is returned by default.public void setDataActiveLabelsEnabled(boolean activeLabelsEnabled)
activeLabelsEnabled - When popups will appear over data areas of the chart.public boolean getDataActiveLabelsEnabled()
public void addChartActionListener(NFChartActionListener l)
l - the new action listenerpublic void removeChartActionListener(NFChartActionListener l)
l - the action listener to removepublic void addGraphObserver(NFGraphObserver observer)
observer - public void removeGraphObserver(NFGraphObserver observer)
observer -
public boolean dwellDisplay(boolean onoff,
netcharts.graphics.NFActiveLabel label)
dwellDisplay in interface NFDwellObservernetcharts.graphics.NFDwellObserveronoff - Whether the label is to be turned on or off.label - The ActiveLabel.
public boolean dwellPress(java.awt.Event evt,
int x,
int y,
netcharts.graphics.NFActiveLabel label)
dwellPress in interface NFDwellObservernetcharts.graphics.NFDwellObserverevt - The Event.x - The x coordinate of the event.y - The y coordinate of the event.label - The ActiveLabel.public void graphDrawn(java.awt.Graphics g)
NFGraphObservergraphDrawn in interface NFGraphObservernetcharts.graphics.NFGraphObserverg - The Graphics the graph was drawn on.public void graphTooSmall(java.awt.Dimension size)
NFGraphObservergraphTooSmall in interface NFGraphObservernetcharts.graphics.NFGraphObserversize - The size the graph was given to draw itself in. This size
is minus the area for the headers, legend, etc.
public boolean preDrag(java.lang.Object obj,
double curX,
double curY,
double newX,
double newY)
NFDragObserverpreDrag in interface NFDragObservernetcharts.graphics.NFDragObserverobj - The object being dragged.curX - The current X value.curY - The current Y value.newX - The new X value.newY - The new Y value.
public void postDrag(java.lang.Object obj,
double newX,
double newY)
NFDragObserverpostDrag in interface NFDragObservernetcharts.graphics.NFDragObserverobj - The object dragged.newX - The new X value.newY - The new Y value.
public boolean preScroll(java.lang.Object obj,
double scrollMin,
double scrollMax,
double curScaleMin,
double curScaleMax,
double newScaleMin,
double newScaleMax)
NFScrollObserverpreScroll in interface NFScrollObservernetcharts.graphics.NFScrollObserverobj - 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.
public void postScroll(java.lang.Object obj,
double scrollMin,
double scrollMax,
double scaleMin,
double scaleMax)
NFScrollObserverpostScroll in interface NFScrollObservernetcharts.graphics.NFScrollObserverobj - The object scrolled.scrollMin - The minimum scroll value.scrollMax - The maximum scroll value.scaleMin - The minimum scale value.scaleMax - The maximum scale value.public void resetState()
public void set(java.lang.Object expr)
throws NFParamException
expr - An expression to set on the chart.NFLoadParams
public void set(java.lang.String param,
java.lang.Object val)
throws NFParamException
The VAL object should reference data according to the type of parameter specified by PARAM.
| Parameter Type | Data Object |
| Single-Value | Raw Data Object |
| Tuple Attribute | Raw Data Object |
| Tuple Parameter | Vector of Raw Data Objects |
| Simple Vector | Vector of Raw Data Objects |
| Tuple Vector | Vector of Vector of Raw Data Objects |
The following Raw Data Objects are supported for the various attribute types:
| Attribute Type | Raw Data Objects |
| String | Any object type |
| Number | Number, String |
| Date | NFDate, NFTimeUnit, Number, String |
| Color | Color, String |
| Symbol | Number, String |
| Image | NFParamImage, 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);
param - Parameter to set.val - New value for parameter.NFParamException -
public void set(java.lang.String param,
int itemIndex,
java.lang.Object val)
throws NFParamException
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.
param - Parameter to set.itemIndex - The target index within the TUPLE or VECTORval - New value for parameter.NFParamException -
public void set(java.lang.String param,
int itemIndex,
int attrIndex,
java.lang.Object val)
throws NFParamException
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.
set ("LineSet1", 2, 0, new Float(0.5));
specifies that first attribute (index = 0) of the 3rd tuple
(index = 2) in the LineSet1 vector should be changed to
a value of 0.5.
If a non-vector parameter is specified, the attrIndex is ignored.
param - The parameter to set.itemIndex - The index of the tuple to set.attrIndex - The index of the attribute within the tuple to setval - The new value.NFParamException - if an error occurs