Class JPanelFlythruMove

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

    public class JPanelFlythruMove
    extends JPanelRendererBase
    implements java.awt.event.ActionListener, java.awt.event.MouseListener

    Title: JPanelFlythruMove

    Description: Fly thru user control panel that manipulate the movements.

    Author:
    Ruida Cheng
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  JPanelFlythruMove.DownButton
      Helper class which sets the appropriate icons for the down button.
      (package private) class  JPanelFlythruMove.DrawingPanel
      Wrapper in order to hold the control panel layout in the JScrollPane.
      (package private) class  JPanelFlythruMove.EmptyButton
      DOCUMENT ME!
      (package private) class  JPanelFlythruMove.LeftButton
      Helper class which sets the appropriate icons for the left button.
      (package private) class  JPanelFlythruMove.LeftRotateButton
      Helper class which sets the appropriate icons for the left button.
      (package private) class  JPanelFlythruMove.PlayMouse
      Thread that plays.
      (package private) class  JPanelFlythruMove.RightButton
      Helper class which sets the appropriate icons for the right button.
      (package private) class  JPanelFlythruMove.RightRotateButton
      Helper class which sets the appropriate icons for the left button.
      (package private) class  JPanelFlythruMove.StandardMouse
      Class used to send Standard mouse events to the canvas.
      (package private) class  JPanelFlythruMove.UpButton
      Helper class which sets the appropriate icons for the up button.
      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Invoke the action event accroding to the comamnd passed in.
      private javax.swing.JPanel buildControlPanel()
      Creates the mouse control panels.
      private void buildMoviePanel()
      Build the mouse recorder button panel.
      void dispose​(boolean flag)
      Dispose memory.
      javax.swing.JPanel getMainPanel()
      Return the main control panel.
      private void init()
      Initialize the control panel.
      boolean isAVIRecording()
      Returns whether the AVI is recording.
      boolean isPaused()
      Returns whether the mouse recorder is paused.
      boolean isPlaying()
      Returns whether the mouse recorder is playing saved events.
      boolean isRecording()
      Returns whether the mouse recorder is recording.
      boolean isStopped()
      Returns whether the mouse recorder is stopped.
      private javax.swing.JButton makeSeparator()
      Makes a separator for the use in the toolbars.
      void mouseClicked​(java.awt.event.MouseEvent event)
      Translates the event to the appropriate version on the canvas, then sends it to the canvas.
      void mouseEntered​(java.awt.event.MouseEvent event)
      Translates the event to the appropriate version on the canvas, then sends it to the canvas.
      void mouseExited​(java.awt.event.MouseEvent event)
      Translates the event to the appropriate version on the canvas, then sends it to the canvas.
      void mousePressed​(java.awt.event.MouseEvent event)
      Translates the event to the appropriate version on the canvas, then sends it to the canvas.
      void mouseReleased​(java.awt.event.MouseEvent event)
      Translates the event to the appropriate version on the canvas, then sends it to the canvas.
      private void play​(boolean selectedToEnd, boolean forever)
      If there is no other thread running, starts a new thread to play the mouse events.
      void resizePanel​(int panelWidth, int frameHeight)
      Resizig the control panel with ViewJFrameVolumeView's frame width and height.
      void saveAVIMovie()
      Save quick time movie.
      void saveQuickTimeMovie()
      Save AVI movie.
      private void setButtonProps​(javax.swing.JButton button, java.lang.String tip)
      Sets the button properties for all the arrow buttons.
      private void setIcon​(java.lang.Object source, boolean press)
      Sets the pressed or unpressed icon for the button, depending on which type it is.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • STOP_MODE

        public static final int STOP_MODE
        Recorder/Player is stopped.
        See Also:
        Constant Field Values
      • RECORD_MODE

        public static final int RECORD_MODE
        Recorder/Player is recording.
        See Also:
        Constant Field Values
      • PAUSE_MODE

        public static final int PAUSE_MODE
        Recorder/Player is paused.
        See Also:
        Constant Field Values
      • PLAY_MODE

        public static final int PLAY_MODE
        Recorder/Player is playing.
        See Also:
        Constant Field Values
      • first

        public boolean first
        Flag to indicate first event.
      • mode

        public int mode
        Current mode, init to stop.
      • changedMode

        boolean changedMode
        flag to indicate current mode being changed.
      • current

        int current
        index to the item list.
      • currEventTime

        long currEventTime
        Current mouse press event time stamp.
      • isPlaying

        boolean isPlaying
        Flag to indicating play mouse is running or not.
      • mouseCount

        int mouseCount
        Mouse event counter.
      • prevEventTime

        long prevEventTime
        Previous mouse press event time stamp.
      • annotationNextButton

        private javax.swing.JButton annotationNextButton
        DOCUMENT ME!
      • annotationPrevButton

        private javax.swing.JButton annotationPrevButton
        DOCUMENT ME!
      • autoRunButton

        private javax.swing.JButton autoRunButton
        Auto Run Button.
      • aviPlayButton

        private javax.swing.JToggleButton aviPlayButton
        AVI Recorder Play button.
      • aviRecordButton

        private javax.swing.JToggleButton aviRecordButton
        AVI Recorder record button.
      • aviStopButton

        private javax.swing.JToggleButton aviStopButton
        AVI Recorder Stop button.
      • branchButton

        private javax.swing.JButton branchButton
        DOCUMENT ME!
      • contButton

        private javax.swing.JToggleButton contButton
        Continue play button.
      • endButton

        private javax.swing.JButton endButton
        DOCUMENT ME!
      • eventVector

        private MouseEventVector eventVector
        Seqence of mouse events ( press, shift,and release as individual mouse event).
      • gazeDecreaseButton

        private javax.swing.JButton gazeDecreaseButton
        DOCUMENT ME!
      • gazeIncrButton

        private javax.swing.JButton gazeIncrButton
        DOCUMENT ME!
      • homeButton

        private javax.swing.JButton homeButton
        DOCUMENT ME!
      • leftRotateButton

        private javax.swing.JButton leftRotateButton
        DOCUMENT ME!
      • mediaPlayerButton

        private javax.swing.JButton mediaPlayerButton
        MS media player button to play AVI file.
      • middleDownButton

        private javax.swing.JButton middleDownButton
        DOCUMENT ME!
      • middleLeftButton

        private javax.swing.JButton middleLeftButton
        DOCUMENT ME!
      • middleLeftButtonEmpty

        private javax.swing.JButton middleLeftButtonEmpty
        Empty button group.
      • middleRightButton

        private javax.swing.JButton middleRightButton
        DOCUMENT ME!
      • middleUpButton

        private javax.swing.JButton middleUpButton
        DOCUMENT ME!
      • mouseEvents

        private java.util.Vector mouseEvents
        Sequence of mouse events( press, shift and release as a whole mouse event).
      • mousePanel

        private javax.swing.JPanel mousePanel
        Panel holds the mouse move buttons.
      • moviePanel

        private javax.swing.JPanel moviePanel
        Movie control panel that hold mouse recorder and AVI movie control.
      • pauseButton

        private javax.swing.JToggleButton pauseButton
        Pause button.
      • playButton

        private javax.swing.JToggleButton playButton
        Display button.
      • pressed

        private boolean pressed
        If any of the mouse move button pressed.
      • quickTimeButton

        private javax.swing.JButton quickTimeButton
        Apple quick time player button to play quick time movie.
      • recordButton

        private javax.swing.JToggleButton recordButton
        Recorder button.
      • reverseButton

        private javax.swing.JButton reverseButton
        DOCUMENT ME!
      • rightDownButton

        private javax.swing.JButton rightDownButton
        DOCUMENT ME!
      • rightLeftButton

        private javax.swing.JButton rightLeftButton
        DOCUMENT ME!
      • rightRightButton

        private javax.swing.JButton rightRightButton
        DOCUMENT ME!
      • rightRotateButton

        private javax.swing.JButton rightRotateButton
        DOCUMENT ME!
      • rightUpButton

        private javax.swing.JButton rightUpButton
        JButton group.
      • scroller

        private javax.swing.JScrollPane scroller
        Scroll pane.
      • stepButton

        private javax.swing.JToggleButton stepButton
        Next step button.
      • stepDecreaseButton

        private javax.swing.JButton stepDecreaseButton
        DOCUMENT ME!
      • stepIncrButton

        private javax.swing.JButton stepIncrButton
        DOCUMENT ME!
      • stopButton

        private javax.swing.JToggleButton stopButton
        Stop button.
      • time

        private long time
        Time to wait for the next mouse event.
      • toolBar

        private javax.swing.JToolBar toolBar
        Tool bar of the mouse recorder.
    • Constructor Detail

      • JPanelFlythruMove

        public JPanelFlythruMove​(FlyThroughRenderInterface _kView)
        User interface to control the fly through renderer events.
        Parameters:
        _kView - FlythruRender
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Invoke the action event accroding to the comamnd passed in.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Specified by:
        actionPerformed in class JPanelRendererBase
        Parameters:
        event - ActionEvent
      • dispose

        public void dispose​(boolean flag)
        Dispose memory.
        Parameters:
        flag - invoke the super dispose or not.
      • getMainPanel

        public javax.swing.JPanel getMainPanel()
        Return the main control panel.
        Specified by:
        getMainPanel in class JPanelRendererBase
        Returns:
        JPanel the main control panel
      • isAVIRecording

        public boolean isAVIRecording()
        Returns whether the AVI is recording.
        Returns:
        whether the panel is recording
      • isPaused

        public boolean isPaused()
        Returns whether the mouse recorder is paused.
        Returns:
        whether the mouse recorder is paused
      • isPlaying

        public boolean isPlaying()
        Returns whether the mouse recorder is playing saved events.
        Returns:
        whether the panel is playing a set of saved events
      • isRecording

        public boolean isRecording()
        Returns whether the mouse recorder is recording.
        Returns:
        whether the panel is recording
      • isStopped

        public boolean isStopped()
        Returns whether the mouse recorder is stopped.
        Returns:
        whether the mouse recorder is stopped
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent event)
        Translates the event to the appropriate version on the canvas, then sends it to the canvas.
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        Parameters:
        event - Original mouse event.
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent event)
        Translates the event to the appropriate version on the canvas, then sends it to the canvas.
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Parameters:
        event - Original mouse event.
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent event)
        Translates the event to the appropriate version on the canvas, then sends it to the canvas.
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        Parameters:
        event - Original mouse event.
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent event)
        Translates the event to the appropriate version on the canvas, then sends it to the canvas.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        event - Original mouse event.
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent event)
        Translates the event to the appropriate version on the canvas, then sends it to the canvas.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Parameters:
        event - Original mouse event.
      • resizePanel

        public void resizePanel​(int panelWidth,
                                int frameHeight)
        Resizig the control panel with ViewJFrameVolumeView's frame width and height.
        Overrides:
        resizePanel in class JPanelRendererBase
        Parameters:
        panelWidth - DOCUMENT ME!
        frameHeight - DOCUMENT ME!
      • buildControlPanel

        private javax.swing.JPanel buildControlPanel()
        Creates the mouse control panels. There are four arrows for each mouse button, left, right, and middle.
        Returns:
        The panel containing the mouse controls.
      • buildMoviePanel

        private void buildMoviePanel()
        Build the mouse recorder button panel.
      • init

        private void init()
        Initialize the control panel.
      • makeSeparator

        private javax.swing.JButton makeSeparator()
        Makes a separator for the use in the toolbars.
        Returns:
        Separator button.
      • play

        private void play​(boolean selectedToEnd,
                          boolean forever)
        If there is no other thread running, starts a new thread to play the mouse events.
        Parameters:
        selectedToEnd - If true, the mouse events are played from the selected one to the end of the list. If false only the selected one is played.
        forever - If true, the mouse events list is played until the stop button or pause button is pressed.
      • setButtonProps

        private void setButtonProps​(javax.swing.JButton button,
                                    java.lang.String tip)
        Sets the button properties for all the arrow buttons.
        Parameters:
        button - Button whose properties need to be set.
        tip - Tool tip text to associate with this button.
      • setIcon

        private void setIcon​(java.lang.Object source,
                             boolean press)
        Sets the pressed or unpressed icon for the button, depending on which type it is.
        Parameters:
        source - The button that was pressed or released.
        press - true indicates the button was pressed, false that it was released.
      • saveAVIMovie

        public void saveAVIMovie()
        Save quick time movie.
      • saveQuickTimeMovie

        public void saveQuickTimeMovie()
        Save AVI movie.