com.imsl.chart
Class PickEvent
java.lang.Object
java.util.EventObject
java.awt.AWTEvent
java.awt.event.ComponentEvent
java.awt.event.InputEvent
java.awt.event.MouseEvent
com.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
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.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 |
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.InputEvent |
consume, getModifiers, getModifiersEx, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown |
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 eventid
- an int
that identifies the eventwhen
- a long
that gives the time the event occurredmodifiers
- 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 eventpopupTrigger
- 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
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
Copyright © 1970-2008 Visual Numerics, Inc.
Built July 8 2008.