JMSLTM Numerical Library 4.0

com.imsl.chart
Class PickEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byjava.awt.AWTEvent
          extended byjava.awt.event.ComponentEvent
              extended byjava.awt.event.InputEvent
                  extended byjava.awt.event.MouseEvent
                      extended bycom.imsl.chart.PickEvent
All Implemented Interfaces:
Serializable

public class PickEvent
extends MouseEvent

An event that indicates that a chart element has been selected.

See Also:
PickListener, Chart Programmer's Guide: Picking, Serialized Form

Field Summary
 
Fields inherited from class java.awt.event.MouseEvent
BUTTON1, BUTTON2, BUTTON3, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_WHEEL, NOBUTTON
 
Fields inherited from class java.awt.event.InputEvent
ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, META_DOWN_MASK, META_MASK, SHIFT_DOWN_MASK, SHIFT_MASK
 
Fields inherited from class java.awt.event.ComponentEvent
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PickEvent(Component source, int id, long when, int modifiers, int x, int y, int clickCount, boolean popupTrigger)
          Construct a PickEvent object at point (x,y).
PickEvent(MouseEvent event)
          Construct a PickEvent object.
 
Method Summary
 ChartNode getNode()
          Gets this ChartNode.
static double pointToLine(int Px, int Py, int[] devA, int[] devB)
          Compute the distance from the point (Px,Py) to the line segment AB.
 void setNode(ChartNode node)
          Sets the ChartNode.
 
Methods inherited from class java.awt.event.MouseEvent
getButton, getClickCount, getMouseModifiersText, getPoint, getX, getY, isPopupTrigger, paramString, translatePoint
 
Methods inherited from class java.awt.event.InputEvent
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class java.awt.event.ComponentEvent
getComponent
 
Methods inherited from class java.awt.AWTEvent
getID, setSource, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PickEvent

public PickEvent(Component source,
                 int id,
                 long when,
                 int modifiers,
                 int x,
                 int y,
                 int clickCount,
                 boolean popupTrigger)
Construct a PickEvent object at point (x,y).

Parameters:
source - the Component that originated the event
id - an int that identifies the event
when - a long that gives the time the event occurred
modifiers - an int that gives the modifier keys down during event (e.g. shift, ctrl, alt, meta)
x - an int, the x coordinate of the point (x,y)
y - an int, the y coordinate of the point (x,y)
clickCount - an int which specifies the number of mouse button clicks necessary to trigger the event
popupTrigger - is a boolean, true if this event is a trigger for a popup menu

PickEvent

public PickEvent(MouseEvent event)
Construct a PickEvent object.

Parameters:
event - a MouseEvent
Method Detail

getNode

public ChartNode getNode()
Gets this ChartNode.


pointToLine

public static double pointToLine(int Px,
                                 int Py,
                                 int[] devA,
                                 int[] devB)
Compute the distance from the point (Px,Py) to the line segment AB. If the closest point from P to the line AB is not between A and B then the distance to the closer of A and B is returned.

Parameters:
Px - an int, the x coordinate of the point (Px,Py)
Py - an int, the y coordinate of the point (Px,Py)
devA - an int array which contains the point which defines the head of the line segment.
devB - an int array which contains the point which defines the tail of the line segment.
Returns:
a double, the distance from the point (Px,Py) to the line segment AB.

setNode

public void setNode(ChartNode node)
Sets the ChartNode.

Parameters:
node - the ChartNode to be set

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.