Class MouseEventVectorPlotter
java.lang.Object
gov.nih.mipav.view.renderer.J3D.surfaceview.plotterview.MouseEventVectorPlotter
- All Implemented Interfaces:
Serializable
This 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:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanFirst time accessed.(package private) intCurrent mode.(package private) VectorVector to record mouse events.(package private) StringName of the events.private static final longUse serialVersionUID for interoperability.(package private) ObjectState being recorded.(package private) VectorVector to record state changes.(package private) javax.media.j3d.Transform3DParent frame transform3D view. -
Constructor Summary
ConstructorsConstructorDescriptionMouseEventVectorPlotter(String name, javax.media.j3d.Transform3D view, boolean first, 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
Modifier and TypeMethodDescriptionvoidAdds a new mouse event to the end of the mouseEvents vector.voidAdds a new mouse event to the end of the mouseEvents vector.intgetMode()Returns the mouse pointer mode at the beginning of events.Returns the mouse events vector.getName()Returns the current vector title name.getState()Returns the state at the beginning of events.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(ObjectInputStream stream) Called by some native invokeMethod.voidsetMode(int _mode) Set the mode at the beginning of the vector array.voidSet the current vector title name.voidSet the state at the beginning of vector array.voidsetView(javax.media.j3d.Transform3D _view) Set the current vector view - transform3D object.private voidwriteObject(ObjectOutputStream stream) Called by some native invokeMethod.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
first
boolean firstFirst time accessed. -
mode
int modeCurrent mode. -
mouseEvents
Vector mouseEventsVector to record mouse events. -
name
String nameName of the events. -
state
Object stateState being recorded. -
stateVector
Vector stateVectorVector to record state changes. -
view
javax.media.j3d.Transform3D viewParent frame transform3D view.
-
-
Constructor Details
-
MouseEventVectorPlotter
public MouseEventVectorPlotter(String name, javax.media.j3d.Transform3D view, boolean first, 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 Details
-
add
Adds a new mouse event to the end of the mouseEvents vector.- Parameters:
event- Event to add.
-
add
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
Returns the mouse events vector.- Returns:
- Vector containing all the mouse events that happened after (and including) the mousePressed event.
-
getName
Returns the current vector title name.- Returns:
- name The name.
-
getState
Returns the state at the beginning of events.- Returns:
- state The state.
-
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
Set the current vector title name.- Parameters:
_name- The name.
-
setState
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
Called 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:
IOException- If the matrix being read in by the JDialogMouseRecorder has the incorrect size.ClassNotFoundException- DOCUMENT ME!
-
writeObject
Called 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:
IOException- DOCUMENT ME!
-