Overview | Package | Class | Tree | Index | Help NetCharts Pro (Applets) 7.0
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

netcharts.graphics
Class NFGraph

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--netcharts.graphics.NFGraph
Subclasses:
NFDataChart

public class NFGraph
implements NFDwellObserver
The NFGraph class is an generic class used for different kinds of data graphs. It must be sub-classed in order to generate a graph.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
java.applet.Applet a
          the associated Applet
int antiAliasing
           
boolean autoScale
           
NFRegion background
           
NFActiveLabel backgroundActiveLabel
           
NFPatternFill backgroundPatternFill
           
java.util.Hashtable chartMetaData
           
NFContext context
           
char decSymbol
          The decimal symbol.
NFActiveRegion dwell
          If non-null, handles dwell label displaying
int dwellAction
          Dwell Action
int dwellOffset
          pixels around a dwell point.
boolean graphChanged
          Set true when the graph has changed and needs to be displayed
int groupSize
          Size of number grouping.
char groupSymbol
          The number grouping symbol.
boolean incrementalUpdate
          Set true when the only the last point should be drawn
boolean layoutChanged
          used internally to determine if certain graph items need to be recalculated
NFLegend legend
          Legend object
boolean legendChanged
          Set true when the legend has changed and needs to be displayed
NFLoadParams loadParams
          Used for parameter loading
int mouseControlDown
          Control Down Action
int mouseMetaDown
          Meta Down Action
int mouseShiftDown
          Shift Down Action
static int NOZOOM
          No Zooming
java.util.Vector observers
           
NFParam param
          Used for parameter storage
java.util.Properties runtimeProperties
          Runtime Properties
double scale
           
int zoomAction
          Zoom Action
boolean zoomEnabled
          allow/disable zoom processing
static int ZOOMIN
          Zoom In
static int ZOOMOUT
          Zoom Out
 
Method Summary
boolean abortPreDrag(double curX, double curY, double newX, double newY)
          Check with all DragObservers before dragging.
void addDwellObserver(NFDwellObserver observer)
          Add an observer to the dwell region to catch dwell events.
void addObserver(java.lang.Object observer)
          Add an observer of any type to the graph.
void addTitleActiveLabelParamInfo(NFLabel l, java.lang.String param)
          Add Parameter information to the ActiveLabel associated with the given NFLabel.
void clean()
          This method cleans the chart and its parameters, making it ready to be reused.
void clearActiveLabel(NFLabel label)
          Removes the active label for the NFLabel from the dwell vector.
void clearMetaData()
          Clear the chart's meta data.
java.awt.Color defaultColor(int i)
          Get a default color for the given index
void defineParams()
          Defines all HTML parameters supported by NFGraph.
void display()
          Display all graph parts, calling sub-class methods as necessary.
void display(boolean forceGraph)
          If <forceGraph> is true, force a redraw of the graph.
void display(java.awt.Graphics g)
          Display all graph parts, calling sub-class methods as necessary.
void drawGraph(java.awt.Graphics g, java.awt.Rectangle r)
          This method must be overridden by sub-classes in order to display data sets.
void drawGraphLite(java.awt.Graphics g)
          This method must be overridden by sub-classes in order to display data sets.
java.awt.Image drawImage(int width, int height)
          Create and return an image of the current graph.
void dwellChanged()
          This method is called whenever the dwell region changes and is intended to be over-ridden by higher level chart classes.
boolean dwellDisplay(boolean onoff, NFActiveLabel label)
          This method is called when a dwell label is about to be displayed or erased.
boolean dwellPress(java.awt.Event evt, int x, int y, NFActiveLabel label)
          This method is called whenever a dwell press occurs on the given label.
NFActiveRegion getActiveRegion()
          Get the ActiveRegion for the Graph.
NFContext getContext()
          Get the context of this NFGraph object.
char getDecimalSymbol()
          Returns the current decimal symbol
static java.lang.String getErrorMsg(java.lang.Exception e)
          Get the error message from an Exception, clipping off the Exception name.
static java.lang.String getErrorMsg(java.lang.Exception e, boolean clipPrefix)
          Get the error message from an Exception, clipping off the Exception name if specified.
int getGroupSize()
          Returns the current grouping size
char getGroupSymbol()
          Returns the current grouping symbol
NFActiveLabel getLegendActiveLabel(int idx)
          Returns the active label, if any, associated with the given index, which was previously generated by getLegendIndex()
int getLegendIndex(NFActiveLabel label)
          Returns the index in the legend for the given active label.
int getLegendItemCount()
          Returns the number of items in the legend (not including title)
NFLoadParams getLoadParams()
          Returns the graph's parameter loading engine
java.util.Vector getMetaData(java.lang.String name)
          Gets the meta data for the given name.
java.util.Enumeration getMetaDataKeys()
          Gets the name keys of all stored meta data.
NFActiveLabel getNoteSetActiveLabel(int idx)
          Returns the active label, if any, associated with the given index, which was previously generated by getNoteSetIndex()
int getNoteSetIndex(NFActiveLabel label)
          Returns the index of the noteset that owns the given active label.
int getNoteSetIndex(NFNoteSet ns)
          Get the note set index for the given noteset object
NFParam getParam()
          Returns the graph's parameter database
NFParse getParse()
          Returns the graph's parameter parser
java.util.Properties getRuntimeProperties()
          Get the runtime properties of this graph.
java.lang.String getTextualDescription()
          This method returns a textual description of the chart.
void initGraph(java.applet.Applet a)
          Initialize the NFGraph object
boolean isZoomable()
          This method indicates whether or not this graph can be zoomed.
boolean keyDown(java.awt.Event evt, int key)
          Interprets any key presses within the chart.
void loadParams()
          Loads all HTML parameters supported by NFGraph.
void loadParams(java.applet.Applet app)
          Loads applet parameters from the HTML file that invoked the applet.
void loadParams(NFCdf chart, java.util.Vector errors)
          Loads all parameters defined in the given chart object and stores a complete string definition in the chart.params hashtable for each valid parameter.
void loadParams(java.lang.String expr)
          Loads application parameters defined by the given parameter expression.
void loadParams(java.lang.StringBuffer expr)
          Loads application parameters defined by the given parameter expression.
void loadParams(java.lang.String hostname, int port, java.lang.String args)
          Loads application parameters from the NFParamServer designated by the <host> and <port> arguments.
void loadParams(java.lang.String param, java.lang.Object data)
          Loads application parameters defined by the given parameter vector.
void loadParams(java.net.URL url)
          Loads application parameters defined by a URL.
boolean mouseDown(java.awt.Event evt, int x, int y)
          Keeps track of mouse movement over the graph
boolean mouseDrag(java.awt.Event evt, int x, int y)
          Keeps track of mouse dragging over the graph
boolean mouseExit(java.awt.Event evt, int x, int y)
          Keeps track of mouse exit out of the graph
boolean mouseMove(java.awt.Event evt, int x, int y)
          Keeps track of mouse movement over the graph
boolean mouseUp(java.awt.Event evt, int x, int y)
          Keeps track of mouse being released over the graph
void notifyGraphObservers(java.awt.Graphics g)
          Notify all GraphObservers that the grpah was drawn on the given Graphics.
boolean notifyGraphOffscreenObservers(java.awt.Image db, java.awt.Graphics g, boolean pre)
          Notify all GraphOffscreenObservers that the graph is about to be/has been drawn on the given Graphics.
void notifyPostDrag(double newX, double newY)
          Notify all DragObservers that something has been dragged.
void paint(java.awt.Graphics g)
          Handle a paint request.
void print(java.awt.Graphics g, java.awt.Dimension d)
          Handle a print request.
void putMetaData(java.lang.String name, java.util.Vector value)
          Inserts meta data for the given name.
void reload(NFCdf chart, java.util.Vector errors)
          Reload the current chart using the given CDF object.
boolean reloadNeeded(java.util.Date timestamp)
          Returns true if any of the underlying data sources for the chart have changed since the given timestamp.
void removeDwellObserver(NFDwellObserver observer)
          Remove an observer from the dwell region.
void removeObserver(java.lang.Object observer)
          Remove any type of observer from the graph.
void reset()
          The reset method may be overridden in order to provide a routine that computes display parameters without actually displaying the data.
void scroll(int direction)
          This method can be called to cause the charts to scroll in a given direction.
void setActiveLabel(NFLabel label, java.lang.String name)
          Gets the activeLabel information from the param object and sets it to the appropriate label.
void setBackground(NFRegion region)
          Set the graph background.
void setContext(NFContext context)
          Set the context of this NFGraph object.
void setDecimalSymbol(char symbol)
          This method can be used to set the decimal separator to be used when formatting numbers.
void setFooter(NFLabel footer)
          Set the graph footer.
void setGrouping(int size, char symbol)
          This method can be used to set the group size and symbol to be used when formatting whole numbers.
void setHeader(NFLabel header)
          Set the graph header.
void setLeftTitle(NFLabel title)
          Set the graph left title.
void setRightTitle(NFLabel title)
          Set the graph right title.
void setRuntimeProperties(java.util.Properties runtimeProperties)
          Set the runtime properties of this graph.
void setScale(double scale)
          Set the scale factor for all scalable items in the graph.
void setUseDoubleBuffer(boolean useDoubleBuffer)
          Sets the useDoubleBuffer flag.
void start(java.applet.Applet a)
          Start the Graph executing.
void stop(java.applet.Applet a)
          Stop the Graph from executing.
void update(java.awt.Graphics g)
          Update the display of the graph.
void update(java.awt.Graphics g, java.awt.Rectangle r)
          Update the display of the graph.
void update(java.util.Observable o, java.lang.Object obj)
          This method is called by the NFParam object whenever a new set of parameters have been parsed.
void updateData()
          Update the data of the graph, i.e.
void updateGraph()
          This method is called whenever an update is aborted, for any reason, without calling the drawGraph() method.
void zoom(int x, int y, int width, int height)
          This method should be overriden if zoom support is required for a given chart.
void zoomHome()
          This method can be called to cause the chart to zoom out to it's maximum size.
void zoomIn()
          This method should be overriden if zoom support is required for a given chart.
void zoomOut()
          This method should be overriden if zoom support is required for a given chart.
 

Field Detail

a

protected java.applet.Applet a
the associated Applet

legend

protected NFLegend legend
Legend object

param

protected NFParam param
Used for parameter storage

loadParams

protected NFLoadParams loadParams
Used for parameter loading

graphChanged

protected boolean graphChanged
Set true when the graph has changed and needs to be displayed

legendChanged

protected boolean legendChanged
Set true when the legend has changed and needs to be displayed

incrementalUpdate

protected boolean incrementalUpdate
Set true when the only the last point should be drawn

dwell

protected NFActiveRegion dwell
If non-null, handles dwell label displaying

dwellOffset

protected int dwellOffset
pixels around a dwell point.

layoutChanged

protected boolean layoutChanged
used internally to determine if certain graph items need to be recalculated

zoomEnabled

protected boolean zoomEnabled
allow/disable zoom processing

background

protected NFRegion background

backgroundActiveLabel

protected NFActiveLabel backgroundActiveLabel

backgroundPatternFill

protected NFPatternFill backgroundPatternFill

scale

protected double scale

autoScale

protected boolean autoScale

antiAliasing

protected int antiAliasing

NOZOOM

public static final int NOZOOM
No Zooming

ZOOMIN

public static final int ZOOMIN
Zoom In

ZOOMOUT

public static final int ZOOMOUT
Zoom Out

mouseMetaDown

public int mouseMetaDown
Meta Down Action

mouseShiftDown

public int mouseShiftDown
Shift Down Action

mouseControlDown

public int mouseControlDown
Control Down Action

zoomAction

public int zoomAction
Zoom Action

dwellAction

public int dwellAction
Dwell Action

observers

protected java.util.Vector observers

runtimeProperties

protected java.util.Properties runtimeProperties
Runtime Properties

groupSize

protected int groupSize
Size of number grouping.

groupSymbol

protected char groupSymbol
The number grouping symbol.

decSymbol

protected char decSymbol
The decimal symbol.

chartMetaData

protected java.util.Hashtable chartMetaData

context

protected NFContext context
Method Detail

setContext

public void setContext(NFContext context)
Set the context of this NFGraph object. The context is used to resolve paths and store authentication information.
Parameters:
context - The context to set.

getContext

public NFContext getContext()
Get the context of this NFGraph object.
Returns:
The current context.

initGraph

public void initGraph(java.applet.Applet a)
Initialize the NFGraph object
Parameters:
a - The Applet to retrieve parameters from.

print

public void print(java.awt.Graphics g,
                  java.awt.Dimension d)
Handle a print request.
Parameters:
g - The Graphics to print on.

paint

public void paint(java.awt.Graphics g)
Handle a paint request.
Parameters:
g - The Graphics to print on.
Overrides:
paint in class java.awt.Container

setHeader

public void setHeader(NFLabel header)
Set the graph header. By default, no header is displayed.
Parameters:
header - The NFLabel to use as the header.

setFooter

public void setFooter(NFLabel footer)
Set the graph footer. By default, no footer is displayed.
Parameters:
footer - The NFLabel to use as the footer.

setLeftTitle

public void setLeftTitle(NFLabel title)
Set the graph left title. By default, no left title is displayed.
Parameters:
title - The NFLabel to use as the left title.

setRightTitle

public void setRightTitle(NFLabel title)
Set the graph right title. By default, no right title is displayed.
Parameters:
title - The NFLabel to use as the right title.

setBackground

public void setBackground(NFRegion region)
Set the graph background. By default, no background is displayed.
Parameters:
region - The Region to use as the background.

setScale

public void setScale(double scale)
Set the scale factor for all scalable items in the graph.
Parameters:
scale - The scale factor.

setUseDoubleBuffer

public void setUseDoubleBuffer(boolean useDoubleBuffer)
Sets the useDoubleBuffer flag. When true (default), double buffering will be used whenever this component is painted. When false, the component will be painted directly to the Graphics object.

The Microsoft VM experiences problems when double-buffering is used during the printing process, so you may want to setUseDoubleBuffer to false prior to printing inside of a Microsoft VM.

Parameters:
useDoubleBuffer - Whether to enable double-buffering or not.

getActiveRegion

public NFActiveRegion getActiveRegion()
Get the ActiveRegion for the Graph.
Returns:
The current ActiveRegion.

defaultColor

public java.awt.Color defaultColor(int i)
Get a default color for the given index
Parameters:
i - The index.
Returns:
The color at the given index.

getNoteSetIndex

public int getNoteSetIndex(NFActiveLabel label)
Returns the index of the noteset that owns the given active label. If no noteset is found, -1 is returned.
Parameters:
label - The ActiveLabel to identify.
Returns:
The index of the NoteSet or -1 otherwise.

getNoteSetActiveLabel

public NFActiveLabel getNoteSetActiveLabel(int idx)
Returns the active label, if any, associated with the given index, which was previously generated by getNoteSetIndex()
Parameters:
idx - The index of the NoteSet.
Returns:
The ActiveLabel associated with the NoteSet.

getLegendIndex

public int getLegendIndex(NFActiveLabel label)
Returns the index in the legend for the given active label.
Parameters:
label - The ActiveLabel to identify.
Returns:
The index of the Legend or -1 otherwise.

getLegendItemCount

public int getLegendItemCount()
Returns the number of items in the legend (not including title)
Returns:
The item count.

getLegendActiveLabel

public NFActiveLabel getLegendActiveLabel(int idx)
Returns the active label, if any, associated with the given index, which was previously generated by getLegendIndex()
Parameters:
idx - The index of the Legend.
Returns:
The ActiveLabel associated with the Legend.

getMetaData

public java.util.Vector getMetaData(java.lang.String name)
Gets the meta data for the given name.

NOTE: The case of the name is insensitive.

Parameters:
name - The name of the meta data.
Returns:
The value associated with the given name, or null if it doesn't exist.

getMetaDataKeys

public java.util.Enumeration getMetaDataKeys()
Gets the name keys of all stored meta data.
Returns:
An Enumeration of the keys.

putMetaData

public void putMetaData(java.lang.String name,
                        java.util.Vector value)
Inserts meta data for the given name.

NOTE: The case of the name becomes insensitive.

Parameters:
name - The name of the meta data.
value - The value of the meta data.

clearMetaData

public void clearMetaData()
Clear the chart's meta data.

dwellChanged

protected void dwellChanged()
This method is called whenever the dwell region changes and is intended to be over-ridden by higher level chart classes.

update

public void update(java.util.Observable o,
                   java.lang.Object obj)
This method is called by the NFParam object whenever a new set of parameters have been parsed.
Specified by:
update(java.util.Observable, java.lang.Object) in interface java.util.Observer
Parameters:
o - The Observable making the update.
obj - The Object parameter.

dwellDisplay

public boolean dwellDisplay(boolean onoff,
                            NFActiveLabel label)
This method is called when a dwell label is about to be displayed or erased. When onoff is true, the label is about to be displayed. If true is returned, the label will NOT be displayed.

When onoff is false, the label should be erased by one of the observers.

Specified by:
dwellDisplay in interface NFDwellObserver
Parameters:
onoff - true if the label is going to be drawn, false if its not.
label - The ActiveLabel.
Returns:
true if the label is NOT to be displayed, false otherwise.

dwellPress

public boolean dwellPress(java.awt.Event evt,
                          int x,
                          int y,
                          NFActiveLabel label)
This method is called whenever a dwell press occurs on the given label. If true is returned, no further processing will be performed. If false is returned, the URL and target associated with the label will be used to showDocument().
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.

updateGraph

protected void updateGraph()
This method is called whenever an update is aborted, for any reason, without calling the drawGraph() method. This allows sub-classes to process the "update" without drawing anything.

drawGraph

protected void drawGraph(java.awt.Graphics g,
                         java.awt.Rectangle r)
This method must be overridden by sub-classes in order to display data sets. It is called by NFGraph after all headers, titles and legends have been displayed.

The data displayed should be contained within the given rectangle, in the given graphics context, in order to prevent any overwriting of other graph elements.

Parameters:
g - The Graphics to draw on.
r - The area to draw in.

drawGraphLite

protected void drawGraphLite(java.awt.Graphics g)
This method must be overridden by sub-classes in order to display data sets. It is called by NFGraph after all headers, titles and legends have been displayed.

This method indicates only the last point should be drawn and no grids or axes need be updated.

Parameters:
g - The Graphics to draw on.

drawImage

public java.awt.Image drawImage(int width,
                       int height)
Create and return an image of the current graph. If width or height are greater than 0, then they will be used to override the current width and height.
Parameters:
width - The width to draw at.
height - The height to draw at.
Returns:
An Image with the graph drawn on it.

updateData

public void updateData()
Update the data of the graph, i.e. DataBeans.

update

public void update(java.awt.Graphics g)
Update the display of the graph.
Parameters:
g - The Graphics to update on.
Overrides:
update in class java.awt.Container

update

public void update(java.awt.Graphics g,
                   java.awt.Rectangle r)
Update the display of the graph.
Parameters:
g - The Graphics to update on.
r - The area to draw in.

getErrorMsg

public static java.lang.String getErrorMsg(java.lang.Exception e)
Get the error message from an Exception, clipping off the Exception name.
Parameters:
e - The Exception.
Returns:
The error message.

getErrorMsg

public static java.lang.String getErrorMsg(java.lang.Exception e,
                                 boolean clipPrefix)
Get the error message from an Exception, clipping off the Exception name if specified.
Parameters:
e - The Exception.
clipPrefix - Whether to clip off the Exception name or not.
Returns:
The error message.

display

protected void display()
Display all graph parts, calling sub-class methods as necessary.

display

protected void display(java.awt.Graphics g)
Display all graph parts, calling sub-class methods as necessary.
Parameters:
g - The Graphics to diaply on.

display

protected void display(boolean forceGraph)
If <forceGraph> is true, force a redraw of the graph. Otherwise, the saved image is redisplayed.
Parameters:
forceGraph - Whether to force a redraw or not.

reset

protected void reset()
The reset method may be overridden in order to provide a routine that computes display parameters without actually displaying the data.

clean

public void clean()
This method cleans the chart and its parameters, making it ready to be reused.

loadParams

public final void loadParams(java.applet.Applet app)
                     throws java.lang.Exception
Loads applet parameters from the HTML file that invoked the applet. This method may not be overridden by sub-classes.
Parameters:
app - The Applet to load parameters from.
Throws:
java.lang.Exception - If there was an error loading the parameters.

loadParams

public final void loadParams(java.net.URL url)
                     throws java.lang.Exception
Loads application parameters defined by a URL. This method may not be overridden by sub-classes. See NFUtil.getFileURL() for a convenient method for getting a URL for a local disk file.
Parameters:
url - The URL to load parameters from.
Throws:
java.lang.Exception - If there was an error loading the parameters.

loadParams

public final void loadParams(java.lang.String expr)
                     throws java.lang.Exception
Loads application parameters defined by the given parameter expression. This method may not be overridden by sub-classes.
Parameters:
expr - The string of cdl to load parameters from.
Throws:
java.lang.Exception - If there was an error loading the parameters.

loadParams

public final void loadParams(java.lang.StringBuffer expr)
                     throws java.lang.Exception
Loads application parameters defined by the given parameter expression. This method may not be overridden by sub-classes.
Parameters:
expr - The buffer of cdl to load parameters from.
Throws:
java.lang.Exception - If there was an error loading the parameters.

loadParams

public final void loadParams(java.lang.String param,
                             java.lang.Object data)
                     throws java.lang.Exception
Loads application parameters defined by the given parameter vector. This method may not be overridden by sub-classes.
Parameters:
param - The parameter to load.
data - The parameter value to load.
Throws:
java.lang.Exception - If there was an error loading the parameters.

loadParams

public final void loadParams(java.lang.String hostname,
                             int port,
                             java.lang.String args)
                     throws java.lang.Exception
Loads application parameters from the NFParamServer designated by the <host> and <port> arguments. When connected, the <args> string will be sent to the server, followed by a newline. All parameters generated by the server will be parsed by a background thread. See NFParam for further details about NFParamServer processing.
Parameters:
hostname - The ParamServer hostname.
port - The ParamServer port.
args - The ParamServer arguments.
Throws:
java.lang.Exception - If there was an error loading the parameters.
See Also:
NFParam

loadParams

public final void loadParams(NFCdf chart,
                             java.util.Vector errors)
                     throws java.lang.Exception
Loads all parameters defined in the given chart object and stores a complete string definition in the chart.params hashtable for each valid parameter.

If "errors" is non-null, then all error messages will be appended to the vector.

Parameters:
chart - The Cdf definition of a chart.
errors - The Vector to append loading errors to.
Throws:
java.lang.Exception - If there was an error loading the parameters.

getRuntimeProperties

public java.util.Properties getRuntimeProperties()
Get the runtime properties of this graph.

setRuntimeProperties

public void setRuntimeProperties(java.util.Properties runtimeProperties)
Set the runtime properties of this graph.

defineParams

protected void defineParams()
Defines all HTML parameters supported by NFGraph. This method may be overridden by subclasses to define additional parameters. In such cases, this method should be executed first.

loadParams

protected void loadParams()
                  throws java.lang.Exception
Loads all HTML parameters supported by NFGraph. This method may be overridden by subclasses to load additional parameters. In such cases, this method should be executed first.
Throws:
java.lang.Exception - If there was an error loading the parameters.

stop

public void stop(java.applet.Applet a)
Stop the Graph from executing. Called when the applet is stopped.
Parameters:
a - The Applet stopping.

start

public void start(java.applet.Applet a)
Start the Graph executing. Called when the applet is started.
Parameters:
a - The Applet starting.

addDwellObserver

public void addDwellObserver(NFDwellObserver observer)
Add an observer to the dwell region to catch dwell events.
Parameters:
observer - The NFDwellObserver to add.

removeDwellObserver

public void removeDwellObserver(NFDwellObserver observer)
Remove an observer from the dwell region.
Parameters:
observer - The NFDwellObserver to remove.

addObserver

public void addObserver(java.lang.Object observer)
Add an observer of any type to the graph. The following types are supported, with the observer being added to the given object:
Parameters:
observer - The Observer to add.

removeObserver

public void removeObserver(java.lang.Object observer)
Remove any type of observer from the graph. See addObserver() for the types supported.
Parameters:
observer - The Observer to remove.
See Also:
addObserver(Object)

notifyGraphObservers

protected void notifyGraphObservers(java.awt.Graphics g)
Notify all GraphObservers that the grpah was drawn on the given Graphics.
Parameters:
g - The Graphics the graph was drawn on.

notifyGraphOffscreenObservers

protected boolean notifyGraphOffscreenObservers(java.awt.Image db,
                                                java.awt.Graphics g,
                                                boolean pre)
Notify all GraphOffscreenObservers that the graph is about to be/has been drawn on the given Graphics.
Parameters:
db - The Image.
g - The Graphics.
pre - Pre or post the drawing operation.

abortPreDrag

public boolean abortPreDrag(double curX,
                            double curY,
                            double newX,
                            double newY)
Check with all DragObservers before dragging. If any request that the drag should not continue, it is aborted.
Parameters:
curX - The current X value.
curY - The current Y value.
newX - The new X value.
newY - The new Y value.
Returns:
true if the drag should be aborted, false otherwise.

notifyPostDrag

public void notifyPostDrag(double newX,
                           double newY)
Notify all DragObservers that something has been dragged.
Parameters:
newX - The new X value.
newY - The new Y value.

mouseMove

public boolean mouseMove(java.awt.Event evt,
                         int x,
                         int y)
Keeps track of mouse movement over the graph
Parameters:
evt - The Event.
x - The x coordinate of the event.
y - The y coordinate of the event.
Returns:
true if the event was handled, false otherwise.
Overrides:
mouseMove in class java.awt.Component

mouseExit

public boolean mouseExit(java.awt.Event evt,
                         int x,
                         int y)
Keeps track of mouse exit out of the graph
Parameters:
evt - The Event.
x - The x coordinate of the event.
y - The y coordinate of the event.
Returns:
true if the event was handled, false otherwise.
Overrides:
mouseExit in class java.awt.Component

mouseDown

public boolean mouseDown(java.awt.Event evt,
                         int x,
                         int y)
Keeps track of mouse movement over the graph
Parameters:
evt - The Event.
x - The x coordinate of the event.
y - The y coordinate of the event.
Returns:
true if the event was handled, false otherwise.
Overrides:
mouseDown in class java.awt.Component

mouseDrag

public boolean mouseDrag(java.awt.Event evt,
                         int x,
                         int y)
Keeps track of mouse dragging over the graph
Parameters:
evt - The Event.
x - The x coordinate of the event.
y - The y coordinate of the event.
Returns:
true if the event was handled, false otherwise.
Overrides:
mouseDrag in class java.awt.Component

mouseUp

public boolean mouseUp(java.awt.Event evt,
                       int x,
                       int y)
Keeps track of mouse being released over the graph
Parameters:
evt - The Event.
x - The x coordinate of the event.
y - The y coordinate of the event.
Returns:
true if the event was handled, false otherwise.
Overrides:
mouseUp in class java.awt.Component

keyDown

public boolean keyDown(java.awt.Event evt,
                       int key)
Interprets any key presses within the chart. This is primarily used for zooming and scrolling.
Parameters:
evt - The Event.
key - The key pressed.
Returns:
true if the event was handled, false otherwise.
Overrides:
keyDown in class java.awt.Component

isZoomable

public boolean isZoomable()
This method indicates whether or not this graph can be zoomed.
Returns:
true if this graph can zoom, false otherwise.

zoom

protected void zoom(int x,
                    int y,
                    int width,
                    int height)
This method should be overriden if zoom support is required for a given chart. It is called by the rubberbanding routines when the user has selected a given region on the screen. The given rectangle is defined using screen coordinates and are guaranteed to be within the space allocated to the chart.
Parameters:
x - The X coordinate of the selected area.
y - The y coordinate of the selected area.
width - The width of the selected area.
height - The height of the selected area.

zoomIn

public void zoomIn()
This method should be overriden if zoom support is required for a given chart.

zoomOut

public void zoomOut()
This method should be overriden if zoom support is required for a given chart.

zoomHome

public void zoomHome()
This method can be called to cause the chart to zoom out to it's maximum size. It should be overridden by any chart that supports zooming.

scroll

public void scroll(int direction)
This method can be called to cause the charts to scroll in a given direction. It should be overridden by any chart that supports scrolling. The following directions are valid:
Parameters:
direction - The direction to scroll.

getLoadParams

public NFLoadParams getLoadParams()
Returns the graph's parameter loading engine
Returns:
The parameter loading engine.

getParam

public NFParam getParam()
Returns the graph's parameter database
Returns:
The parameter database.

getParse

public NFParse getParse()
Returns the graph's parameter parser
Returns:
The parameter parser.

getNoteSetIndex

public int getNoteSetIndex(NFNoteSet ns)
Get the note set index for the given noteset object
Parameters:
ns - The NoteSet to search for.
Returns:
The index of the NoteSet.

setActiveLabel

public void setActiveLabel(NFLabel label,
                           java.lang.String name)
                   throws java.lang.Exception
Gets the activeLabel information from the param object and sets it to the appropriate label. NOTE - although we attempt to clear the old active label here, usually the active label will be null since the NFLabel label object is a new object if the label content changes. Therefore, insure that someone calls the clearActiveLabel before the old label object is replaced.
Parameters:
label - The NFLabel to use for the named ActiveLabel.
name - The ActiveLabel parameter.
Throws:
java.lang.Exception - If there was an error in setting the NFLabel.

addTitleActiveLabelParamInfo

protected void addTitleActiveLabelParamInfo(NFLabel l,
                                            java.lang.String param)
Add Parameter information to the ActiveLabel associated with the given NFLabel. This information is used by NetChartsBeans ChartEvent.
Parameters:
l - The NFLabel to get the ActiveLabel from.
param - The information regarding which parameter this Label is associated with.

clearActiveLabel

public void clearActiveLabel(NFLabel label)
Removes the active label for the NFLabel from the dwell vector.
Parameters:
label - The NFLabel to get the ActiveLabel from.

reloadNeeded

public boolean reloadNeeded(java.util.Date timestamp)
Returns true if any of the underlying data sources for the chart have changed since the given timestamp.
Parameters:
timestamp - The date to make the comparison against.
Returns:
true if a reload is needed, false otherwise.

reload

public void reload(NFCdf chart,
                   java.util.Vector errors)
           throws java.lang.Exception
Reload the current chart using the given CDF object. This method clears all previous databean dependencies before reloading the chart and returns any errors generated during the parsing or loading process.
Parameters:
chart - The Cdf definition to load the parameters from.
errors - A vector to append any generated errors to.

getTextualDescription

public java.lang.String getTextualDescription()
This method returns a textual description of the chart.

setGrouping

public void setGrouping(int size,
                        char symbol)
This method can be used to set the group size and symbol to be used when formatting whole numbers. By default, no grouping is done. Common values are a groupSize of 3 and a groupSymbol of ','
Parameters:
size - The grouping size.
symbol - The grouping symbol.

getGroupSymbol

public char getGroupSymbol()
Returns the current grouping symbol
Returns:
The symbol.

getGroupSize

public int getGroupSize()
Returns the current grouping size
Returns:
The size.

setDecimalSymbol

public void setDecimalSymbol(char symbol)
This method can be used to set the decimal separator to be used when formatting numbers. The default separator is '.'
Parameters:
symbol - The symbol.

getDecimalSymbol

public char getDecimalSymbol()
Returns the current decimal symbol
Returns:
The symbol.

Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD


Visual Mining, Inc.
2099 Gaither Grove Rd.
Suite 220
Rockville, MD 20850
800.308.0731
301.947.8293 FAX

Copyright © Visual Mining, Inc. 1996 - 2010
All Rights Reserved.

NetCharts ProTM is a registered trademark of Visual Mining, Inc. Other brands and their products are trademarks of their respective holders.

Last Modified: Jun 29, 2010