Class MouseEventVectorPlotter

  • All Implemented Interfaces:
    java.io.Serializable

    public class MouseEventVectorPlotter
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean first
      First time accessed.
      (package private) int mode
      Current mode.
      (package private) java.util.Vector mouseEvents
      Vector to record mouse events.
      (package private) java.lang.String name
      Name of the events.
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      (package private) java.lang.Object state
      State being recorded.
      (package private) java.util.Vector stateVector
      Vector to record state changes.
      (package private) javax.media.j3d.Transform3D view
      Parent 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
      void add​(java.lang.Object event)
      Adds a new mouse event to the end of the mouseEvents vector.
      void add​(java.lang.Object event, java.lang.Object state)
      Adds a new mouse event to the end of the mouseEvents vector.
      int getMode()
      Returns the mouse pointer mode at the beginning of events.
      java.util.Vector getMouseEvents()
      Returns the mouse events vector.
      java.lang.String getName()
      Returns the current vector title name.
      java.lang.Object getState()
      Returns the state at the beginning of events.
      java.util.Vector getStateVector()
      Returns the state vector.
      javax.media.j3d.Transform3D getView()
      Returns the view stored in this structure.
      boolean isFirst()
      Returns flag indicating if this is the first mouse event vector in a series.
      private void readObject​(java.io.ObjectInputStream stream)
      Called by some native invokeMethod.
      void setMode​(int _mode)
      Set the mode at the beginning of the vector array.
      void setName​(java.lang.String _name)
      Set the current vector title name.
      void setState​(java.lang.Object _state)
      Set the state at the beginning of vector array.
      void setView​(javax.media.j3d.Transform3D _view)
      Set the current vector view - transform3D object.
      private void writeObject​(java.io.ObjectOutputStream stream)
      Called by some native invokeMethod.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 use true otherwise, use false.
        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:
        true if the first mouse event vector, otherwise false.
      • 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.ClassNotFoundException
        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:
        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.IOException
        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:
        java.io.IOException - DOCUMENT ME!