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

Class netcharts.graphics.
NFActiveRegion

java.lang.Object
  |
  +--netcharts.graphics.NFActiveRegion

public class NFActiveRegion
implements
NFActiveRegion tracks user interaction with the mouse in specified rectangles or polygons on the screen.

The dwell interaction occurs when the pointer (mouse) is left over a specified rectangle or polygon for the dwellTime. At that time, all of the dwell observers registered via addObserver() will be notified via their dwellDisplay() method. If any of them returns true, then no further processing will be performed. Otherwise, if an NFLabel has been set, NFActiveRegion will post that label on the display. posted the dwell label.

When the mouse moves again, the dwell observers will be notified again via the dwellDisplay() method, indicating that the display should be updated to erase the dwell label previosly posted.

If the user presses a mouse button while a dwell label is displayed, then the dwell observers will be notified via their dwellPress() methods. If any of the observers return true, then no additional processing is performed. Otherwise, the URL and target assigned to the active label will be processed using showDocument().


Field Summary
static int BACK
          Used for addLabel.
static int FRONT
          Used for addLabel.
 
Constructor Summary
NFActiveRegion(long dwellTime, NFDwellObserver callback)
          Constructor including dwellTime, and callback.
 
Method Summary
NFActiveLabel addLabel(NFActiveLabel label)
          Add the given active label to the list of labels being tracked by this active region.
NFActiveLabel addLabel(NFActiveLabel label, int where)
          Add the given active label to the list of labels being tracked by this active region at the given spot.
NFActiveLabel addLabel(java.util.Vector labels, int nth)
          Add the nth active label in the vector, if it doesn't exist, add a default active label.
void addLabels(java.util.Vector labels, int count)
          Add up to <count> labels from the given vector to this active region.
void addObserver(NFDwellObserver observer)
          Register the given object as an observer of the dwell processing.
java.util.Vector createSelectLabels(java.util.Vector labels, int count)
          Create <count> active labels for select mode, adding them to the given vector and to the current active region.
NFActiveLabel findMatch(int x, int y)
          Returns the first active label which bounds the given point.
java.util.Vector getActiveLabels()
          Get the Vector of ActiveLabels in this ActiveRegion.
NFLabel getLabel()
          Get the label used to draw the active labels.
boolean getSelectMode()
          Returns the current selectMode value.
boolean mouseDown(java.awt.Event evt, int x, int y)
          Called by an outside routine to process a mouse event Returns true if a match was found, false otherwise.
boolean mouseDown(java.awt.Event evt, int x, int y, boolean activate)
          Called by an outside routine to process a mouse event Returns true if a match was found, false otherwise.
void mousePos(int x, int y)
          Called by an outside routine to update the mouse x and y
void removeAllLabels()
          Delete all active labels tracked by this active region
void removeLabel(NFActiveLabel label)
          Delete the given active label from the list of labels being tracked by this active region
void removeLabel(java.util.Vector v)
          Delete all active labels in the given vector from the list of labels being tracked
void removeLabel(java.util.Vector v, int vIndex, int dIndex)
          Delete all active labels in the given vector from the list of labels being tracked
void removeObserver(NFDwellObserver observer)
          De-register the given object as an observer of the dwell processing.
void resetLabels(java.util.Vector labels)
          Reset all of the active labels in the given vector
void run()
          Keep checking the mouse position to see if the user is "dwelling".
void setClickCount(int clickCount)
          Sets the number of clicks required before an active label is activated.
void setDocument(java.applet.AppletContext ac, int clickCount)
          Deprecated. Setting a non-null applet context indicates that the NFActiveRegion object should attempt to "showDocument" If the applet context or the showDocument will not be called, and the observer will be passed back the x, y, and modifiers.
void setDocument(java.applet.Applet app, int clickCount)
          Use the given applet to determine the AppletContext in which to show a document, or failing that, turn off document display.
void setLabel(NFLabel label, java.awt.Component comp)
          Setting a non-null NFLabel component indicates that the NFActiveRegion object should attempt to post the NFLabel if a dwell occurs over a data polygon.
void setToolBarMode(boolean b)
          Set the mode in which all ActiveLabels are displayed as ToolTips.
void setWindowMode(boolean b)
          Set the mode in which all ActiveLabels are displayed in their on windows.
void start()
          Start the dwell thread
void startDwell()
          Start the dwell thread
void stop()
          Stop the dwell thread
void stopDwell()
          Stop the dwell thread
 

Field Detail

FRONT

public static final int FRONT
Used for addLabel. Specifies FRONT of list.

BACK

public static final int BACK
Used for addLabel. Specifies BACK of list.
Constructor Detail

NFActiveRegion

public NFActiveRegion(long dwellTime,
                      NFDwellObserver callback)
Constructor including dwellTime, and callback. dwellTime indicates how long before a dwell is considered a dwell. The callback is the observer object that will be notified, if not null.
Parameters:
dwellTime - The time needed for a dwell to be a dwell
callback - The DwellObsetrver to notify.
Method Detail

getActiveLabels

public java.util.Vector getActiveLabels()
Get the Vector of ActiveLabels in this ActiveRegion.
Returns:
The Vector of ActiveLabels.

setWindowMode

public void setWindowMode(boolean b)
Set the mode in which all ActiveLabels are displayed in their on windows.
Parameters:
b - Whether to display the ActiveLabels in their own windows or not.

setToolBarMode

public void setToolBarMode(boolean b)
Set the mode in which all ActiveLabels are displayed as ToolTips.
Parameters:
b - Whether to display the ActiveLabels as ToolTips or not.

getSelectMode

public boolean getSelectMode()
Returns the current selectMode value.
Returns:
The select mode.

addObserver

public void addObserver(NFDwellObserver observer)
Register the given object as an observer of the dwell processing.
Parameters:
observer - The Observer to add.

removeObserver

public void removeObserver(NFDwellObserver observer)
De-register the given object as an observer of the dwell processing.
Parameters:
observer - The Observer to remove.

setLabel

public void setLabel(NFLabel label,
                     java.awt.Component comp)
Setting a non-null NFLabel component indicates that the NFActiveRegion object should attempt to post the NFLabel if a dwell occurs over a data polygon. The corresponding data label value will be displayed as the NFLabel's value. If label is null, dwell labels will not be displayed and the observer will be passed back the point x, y, and the label value
Parameters:
label - The label to display ActiveLabels using.
comp - The Component to use for label rotation.

getLabel

public NFLabel getLabel()
Get the label used to draw the active labels.

setDocument

public void setDocument(java.applet.Applet app,
                        int clickCount)
Use the given applet to determine the AppletContext in which to show a document, or failing that, turn off document display.
Parameters:
app - The Applet to use to display documents.
clickCount - The number of clicks.

setDocument

public void setDocument(java.applet.AppletContext ac,
                        int clickCount)
Deprecated. Use setDocument(Applet, int) instead
Setting a non-null applet context indicates that the NFActiveRegion object should attempt to "showDocument" If the applet context or the showDocument will not be called, and the observer will be passed back the x, y, and modifiers.
Parameters:
ac - The AppletContext to use to display documents.
clickCount - The number of clicks.

setClickCount

public void setClickCount(int clickCount)
Sets the number of clicks required before an active label is activated. note that the applet context must first have been set using setDocument
Parameters:
clickCount - The number of clicks.

start

public void start()
Start the dwell thread

startDwell

public void startDwell()
Start the dwell thread

stop

public void stop()
Stop the dwell thread

stopDwell

public void stopDwell()
Stop the dwell thread

mousePos

public void mousePos(int x,
                     int y)
Called by an outside routine to update the mouse x and y
Parameters:
x - The X coordinate of the mouse.
y - The Y coordinate of the mouse.

mouseDown

public boolean mouseDown(java.awt.Event evt,
                         int x,
                         int y)
Called by an outside routine to process a mouse event Returns true if a match was found, false otherwise.
Parameters:
evt - The Event.
x - The X coordinate of the mouse.
y - The Y coordinate of the mouse.

mouseDown

public boolean mouseDown(java.awt.Event evt,
                         int x,
                         int y,
                         boolean activate)
Called by an outside routine to process a mouse event Returns true if a match was found, false otherwise.
Parameters:
evt - The Event.
x - The X coordinate of the mouse.
y - The Y coordinate of the mouse.
activate - Search for a match.

addLabel

public NFActiveLabel addLabel(NFActiveLabel label)
Add the given active label to the list of labels being tracked by this active region. If the given label is null, a default label will be added and returned.
Parameters:
label - The ActiveLabel to add.
Returns:
The ActiveLabel added.

addLabel

public NFActiveLabel addLabel(NFActiveLabel label,
                              int where)
Add the given active label to the list of labels being tracked by this active region at the given spot. If the given label is null, a default label will be added and returned.
Parameters:
label - The ActiveLabel to add.
where - The location in the list to insert the label.
Returns:
The ActiveLabel added.

addLabel

public NFActiveLabel addLabel(java.util.Vector labels,
                              int nth)
Add the nth active label in the vector, if it doesn't exist, add a default active label. In either case, the active label added is returned.
Parameters:
labels - A Vector of ActiveLabels.
nth - Which to add.
Returns:
The ActiveLabel added.

addLabels

public void addLabels(java.util.Vector labels,
                      int count)
Add up to <count> labels from the given vector to this active region.
Parameters:
labels - A Vector of ActiveLabels.
count - How many to add.

resetLabels

public void resetLabels(java.util.Vector labels)
Reset all of the active labels in the given vector
Parameters:
labels - A Vector of ActiveLabels.

createSelectLabels

public java.util.Vector createSelectLabels(java.util.Vector labels,
                                 int count)
Create <count> active labels for select mode, adding them to the given vector and to the current active region. If the given vector is null, a new one will be created and returned. If the given vector contains elements, then those labels will be removed from the vector and this active region.
Parameters:
labels - A Vector of ActiveLabels.
count - How many to add.

removeLabel

public void removeLabel(NFActiveLabel label)
Delete the given active label from the list of labels being tracked by this active region
Parameters:
label - The ActiveLabel to remove.

removeLabel

public void removeLabel(java.util.Vector v)
Delete all active labels in the given vector from the list of labels being tracked
Parameters:
v - A Vector of ActiveLabels.

removeLabel

public void removeLabel(java.util.Vector v,
                        int vIndex,
                        int dIndex)
Delete all active labels in the given vector from the list of labels being tracked
Parameters:
v - A Vector of ActiveLabels.

removeAllLabels

public void removeAllLabels()
Delete all active labels tracked by this active region

findMatch

public NFActiveLabel findMatch(int x,
                               int y)
Returns the first active label which bounds the given point. If no match is found, null is returned. NOTE: We search backwards through the list, because we assume that the last labels added correspond to the last data points to be displayed.
Parameters:
x - The X coordniate.
y - The Y coordniate.

run

public void run()
Keep checking the mouse position to see if the user is "dwelling". If so, display the dwell label. If not, go to sleep and wait for the mousePos() method to be called.
Specified by:
run() in interface java.lang.Runnable

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