com.sas.graphics.components
Class PickInfo

com.sas.graphics.components.PickInfo

public class PickInfo

A PickInfo provides a mapping from a data-element to all of its associated data and is contained inside each delivered ProbeEvent. A "Probe" event is delivered when a mouse pointer moves over a region of a Graph occupied by a data-element. A ProbeEvent object is passed as an argument to a ProbeListener's "probeUpdate" method. Register a ProbeListener to a Graph to receive these events.

"data-elements" are those chart graphics depicting the values found in the data model. For example the bars in the BarChart are data-elements but the axis, legend, titles, footnotes, etc are not.

Usage

"getX" and "getY" will return the X and Y screen coordinates of the mouse pointer where the event was generated.

Since:
SAS 9.1
See Also:
Graph, ProbeEvent, ProbeListener, ProbeListener.probeUpdate(com.sas.graphics.components.ProbeEvent)

Field Summary
static java.lang.String FORMATTED_VALUE
           
static java.lang.String ID
           
static java.lang.String LABEL
           
static java.lang.String RB_KEY
           
static java.lang.String VALUE
           
static java.lang.String VISIBLE
           
 
Constructor Summary
PickInfo(java.util.Vector[] newLabelValuePairs, int newObservationIndex, java.lang.Object newModel, int newX, int newY, java.awt.event.MouseEvent newMouseEvent)
          Constructs a PickInfo object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this MarkerStyle.
 java.util.Vector[] getLabelValueCollection()
          Return the data values associated with the data-element in the form of a series of vectors.
 java.lang.Object getModel()
          Get a handle to the data source.
 java.awt.event.MouseEvent getMouseEvent()
          Get the mouse event that triggered the ProbeEvent.
 int getObservationIndex()
          Get the Row index in the model that is associated with the data-element
 int getX()
          The X portion of the screen coordinate that was picked against.
 int getY()
          The Y portion of the screen coordinate that was picked against.
 void setLabelValueCollection(java.util.Vector[] newLabelValuePairs)
          Set the data values associated with the data-element in the form of a series of vectors.
 void setModel(java.lang.Object newModel)
          Set a handle to the data source.
 void setMouseEvent(java.awt.event.MouseEvent newMouseEvent)
          Set the mouse event that triggered the ProbeEvent.
 void setObservationIndex(int newObservationIndex)
          Set the Row index in the model that is associated with the data-element
 void setX(int newX)
          Used to set the X portion of the screen coordinate that was picked against.
 void setY(int newY)
          Used to set the Y portion of the screen coordinate that was picked against.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

ID

public static final java.lang.String ID

VALUE

public static final java.lang.String VALUE

FORMATTED_VALUE

public static final java.lang.String FORMATTED_VALUE

LABEL

public static final java.lang.String LABEL

VISIBLE

public static final java.lang.String VISIBLE
Constructor Detail

PickInfo

public PickInfo(java.util.Vector[] newLabelValuePairs,
                int newObservationIndex,
                java.lang.Object newModel,
                int newX,
                int newY,
                java.awt.event.MouseEvent newMouseEvent)
Constructs a PickInfo object.

Parameters:
newLabelValuePairs - the data values associated with the data-element in the form of a series of vectors
newObservationIndex - the Row index in the model that is associated with the data-element
newModel - a handle to the data source
newX - the X portion of the screen coordinate that was picked against
newY - the Y portion of the screen coordinate that was picked against
newMouseEvent - the mouse event that triggered the ProbeEvent
Method Detail

getX

public int getX()
The X portion of the screen coordinate that was picked against.

Returns:
The X portion of the screen coordinate that was picked against
See Also:
setX(int), getY()

setX

public void setX(int newX)
Used to set the X portion of the screen coordinate that was picked against.

Parameters:
newX - the X portion of the screen coordinate that was picked against
See Also:
getX()

getY

public int getY()
The Y portion of the screen coordinate that was picked against.

Returns:
The Y portion of the screen coordinate that was picked against
See Also:
setY(int), getX()

setY

public void setY(int newY)
Used to set the Y portion of the screen coordinate that was picked against.

Parameters:
newY - the Y portion of the screen coordinate that was picked against
See Also:
getY()

getMouseEvent

public java.awt.event.MouseEvent getMouseEvent()
Get the mouse event that triggered the ProbeEvent.

Returns:
the mouse event that triggered the ProbeEvent.
See Also:
setMouseEvent(java.awt.event.MouseEvent)

setMouseEvent

public void setMouseEvent(java.awt.event.MouseEvent newMouseEvent)
Set the mouse event that triggered the ProbeEvent.

Parameters:
newMouseEvent - the mouse event that triggered the ProbeEvent.
See Also:
getMouseEvent()

getLabelValueCollection

public java.util.Vector[] getLabelValueCollection()
Return the data values associated with the data-element in the form of a series of vectors. Each vector entry is a separate Hashtable. The number of entries depicts the number of associated data-elements. For example if the BarChart has 5 response variables then 5 bars are generated for each valid data observation (considering summarized data). 5 Hashtables will be returned with the PickInfo. Each hashtable will contain a mapping from variable property to value.


setLabelValueCollection

public void setLabelValueCollection(java.util.Vector[] newLabelValuePairs)
Set the data values associated with the data-element in the form of a series of vectors. Each vector entry is a separate Hashtable. The number of entries depicts the number of associated data-elements. For example if the BarChart has 5 response variables then 5 bars are generated for each valid data observation (considering summarized data). 5 Hashtables will be returned with the PickInfo.

Parameters:
newLabelValuePairs - the array of hashtable associations

getObservationIndex

public int getObservationIndex()
Get the Row index in the model that is associated with the data-element

Returns:
the Row index in the model that is associated with the data-element
See Also:
setObservationIndex(int)

setObservationIndex

public void setObservationIndex(int newObservationIndex)
Set the Row index in the model that is associated with the data-element

Parameters:
newObservationIndex - the Row index in the model that is associated with the data-element
See Also:
getObservationIndex()

getModel

public java.lang.Object getModel()
Get a handle to the data source.

Returns:
a handle to the data source
See Also:
setModel(java.lang.Object)

setModel

public void setModel(java.lang.Object newModel)
Set a handle to the data source.

Parameters:
newModel - handle to the data source
See Also:
getModel()

equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this MarkerStyle.

The result is true if and only if the argument is not null and is a MarkerStyle object that has the same property values as this object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to test for equality with this MarkerStyle
Returns:
true if the objects are the same; false otherwise.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.