Class MouseEventVectorPlotter
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.plotterview.MouseEventVectorPlotter
-
- All Implemented Interfaces:
java.io.Serializable
public class MouseEventVectorPlotter extends java.lang.Object implements java.io.SerializableThis class holds the necessary information for each "mouse event" that shows up in the list. In reality, the "mouse event" listed is a vector of mouse events that begins with a mousePressed and ends with a mouseReleased. In between are mouseDragged events. In this way all events that happen on the canvas are accounted for. If we were to put every event that actually happened in the list, the list would soon contain hundreds of elements. The mouseEvents vector can be empty, as is the case when a view is saved. Then just the name and the view are saved; the vector holding mouseEvents remains empty.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanfirstFirst time accessed.(package private) intmodeCurrent mode.(package private) java.util.VectormouseEventsVector to record mouse events.(package private) java.lang.StringnameName of the events.private static longserialVersionUIDUse serialVersionUID for interoperability.(package private) java.lang.ObjectstateState being recorded.(package private) java.util.VectorstateVectorVector to record state changes.(package private) javax.media.j3d.Transform3DviewParent frame transform3D view.
-
Constructor Summary
Constructors Constructor Description MouseEventVectorPlotter(java.lang.String name, javax.media.j3d.Transform3D view, boolean first, java.lang.Object state, int mode)Creates a new structure to hold necessary information, with the name in the list and the beginning view saved.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object event)Adds a new mouse event to the end of the mouseEvents vector.voidadd(java.lang.Object event, java.lang.Object state)Adds a new mouse event to the end of the mouseEvents vector.intgetMode()Returns the mouse pointer mode at the beginning of events.java.util.VectorgetMouseEvents()Returns the mouse events vector.java.lang.StringgetName()Returns the current vector title name.java.lang.ObjectgetState()Returns the state at the beginning of events.java.util.VectorgetStateVector()Returns the state vector.javax.media.j3d.Transform3DgetView()Returns the view stored in this structure.booleanisFirst()Returns flag indicating if this is the first mouse event vector in a series.private voidreadObject(java.io.ObjectInputStream stream)Called by some native invokeMethod.voidsetMode(int _mode)Set the mode at the beginning of the vector array.voidsetName(java.lang.String _name)Set the current vector title name.voidsetState(java.lang.Object _state)Set the state at the beginning of vector array.voidsetView(javax.media.j3d.Transform3D _view)Set the current vector view - transform3D object.private voidwriteObject(java.io.ObjectOutputStream stream)Called by some native invokeMethod.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
first
boolean first
First time accessed.
-
mode
int mode
Current mode.
-
mouseEvents
java.util.Vector mouseEvents
Vector to record mouse events.
-
name
java.lang.String name
Name of the events.
-
state
java.lang.Object state
State being recorded.
-
stateVector
java.util.Vector stateVector
Vector to record state changes.
-
view
javax.media.j3d.Transform3D view
Parent frame transform3D view.
-
-
Constructor Detail
-
MouseEventVectorPlotter
public MouseEventVectorPlotter(java.lang.String name, javax.media.j3d.Transform3D view, boolean first, java.lang.Object state, int mode)Creates a new structure to hold necessary information, with the name in the list and the beginning view saved. The Vector containing the rest of the mouseEvents is also created but begins empty. Elements are added with the add method, below.- Parameters:
name- Name of this view or mouse event.view- Transform representing the view.first- If this is the first-time accessed usetrueotherwise, usefalse.state- The state being recorded.mode- Current mode.
-
-
Method Detail
-
add
public void add(java.lang.Object event)
Adds a new mouse event to the end of the mouseEvents vector.- Parameters:
event- Event to add.
-
add
public void add(java.lang.Object event, java.lang.Object state)Adds a new mouse event to the end of the mouseEvents vector.- Parameters:
event- Event to add.state- State to add
-
getMode
public int getMode()
Returns the mouse pointer mode at the beginning of events.- Returns:
- mode The mode.
-
getMouseEvents
public java.util.Vector getMouseEvents()
Returns the mouse events vector.- Returns:
- Vector containing all the mouse events that happened after (and including) the mousePressed event.
-
getName
public java.lang.String getName()
Returns the current vector title name.- Returns:
- name The name.
-
getState
public java.lang.Object getState()
Returns the state at the beginning of events.- Returns:
- state The state.
-
getStateVector
public java.util.Vector getStateVector()
Returns the state vector.- Returns:
- Vector containing all the states parallel to mouse events.
-
getView
public javax.media.j3d.Transform3D getView()
Returns the view stored in this structure.- Returns:
- The transform representing the view.
-
isFirst
public boolean isFirst()
Returns flag indicating if this is the first mouse event vector in a series.- Returns:
trueif the first mouse event vector, otherwisefalse.
-
setMode
public void setMode(int _mode)
Set the mode at the beginning of the vector array.- Parameters:
_mode- The mode
-
setName
public void setName(java.lang.String _name)
Set the current vector title name.- Parameters:
_name- The name.
-
setState
public void setState(java.lang.Object _state)
Set the state at the beginning of vector array.- Parameters:
_state- The state.
-
setView
public void setView(javax.media.j3d.Transform3D _view)
Set the current vector view - transform3D object.- Parameters:
_view- The present view transform.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionCalled by some native invokeMethod. Provides a way to read this class out as a object stream. First, the size of the vector is read, then each mouseEvent into the vector, then the name, then the view. The view is read in as a String because it is not serializable. The read method corresponds to the write method, below.- Parameters:
stream- Object stream to read from.- Throws:
java.io.IOException- If the matrix being read in by the JDialogMouseRecorder has the incorrect size.java.lang.ClassNotFoundException- DOCUMENT ME!
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionCalled by some native invokeMethod. Provides a way to write this class out as a object stream. First, the size of the vector is written, then each mouseEvent in the vector, then the name, then the view. The view is written out as a String because it is not serializable. The write method corresponds to the read method, above.- Parameters:
stream- Object stream to write to.- Throws:
java.io.IOException- DOCUMENT ME!
-
-