Class JPanelFlythruMove
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.renderer.JPanelRendererBase
gov.nih.mipav.view.renderer.flythroughview.JPanelFlythruMove
- All Implemented Interfaces:
ActionListener,FocusListener,ItemListener,KeyListener,MouseListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
Title: JPanelFlythruMove
Description: Fly thru user control panel that manipulate the movements.
- Author:
- Ruida Cheng
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classHelper class which sets the appropriate icons for the down button.(package private) classWrapper in order to hold the control panel layout in the JScrollPane.(package private) classDOCUMENT ME!(package private) classHelper class which sets the appropriate icons for the left button.(package private) classHelper class which sets the appropriate icons for the left button.(package private) classThread that plays.(package private) classHelper class which sets the appropriate icons for the right button.(package private) classHelper class which sets the appropriate icons for the left button.(package private) classClass used to send Standard mouse events to the canvas.(package private) classHelper class which sets the appropriate icons for the up button.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonAuto Run Button.static final intAVI is recording.private JToggleButtonAVI Recorder Play button.private JToggleButtonAVI Recorder record button.private JToggleButtonAVI Recorder Stop button.private JButtonDOCUMENT ME!(package private) booleanflag to indicate current mode being changed.private JToggleButtonContinue play button.(package private) intindex to the item list.(package private) longCurrent mouse press event time stamp.private JButtonDOCUMENT ME!private MouseEventVectorSeqence of mouse events ( press, shift,and release as individual mouse event).booleanFlag to indicate first event.private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!(package private) booleanFlag to indicating play mouse is running or not.private JButtonDOCUMENT ME!private JButtonMS media player button to play AVI file.private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonEmpty button group.private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!intCurrent mode, init to stop.(package private) intMouse event counter.private VectorSequence of mouse events( press, shift and release as a whole mouse event).private JPanelPanel holds the mouse move buttons.private JPanelMovie control panel that hold mouse recorder and AVI movie control.private FlyThroughRenderInterfaceThe parent fly thru render reference.static final intRecorder/Player is paused.private JToggleButtonPause button.static final intRecorder/Player is playing.private JToggleButtonDisplay button.private JPanelFlythruMove.PlayMouseReference to PlayMouse class object.private booleanIf any of the mouse move button pressed.(package private) longPrevious mouse press event time stamp.private JButtonApple quick time player button to play quick time movie.static final intRecorder/Player is recording.private JToggleButtonRecorder button.private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!private JButtonJButton group.private JScrollPaneScroll pane.private JPanelFlythruMove.DrawingPanelScroll panel that holding the all the control components.private static final longUse serialVersionUID for interoperability.private JToggleButtonNext step button.private JButtonDOCUMENT ME!private JButtonDOCUMENT ME!static final intRecorder/Player is stopped.private JToggleButtonStop button.private longTime to wait for the next mouse event.private JToolBarTool bar of the mouse recorder.Fields inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
applyButton, cancelButton, cancelFlag, closeButton, helpButton, isActiveImage, mainPanel, NEW, OKButton, REPLACE, runInSeparateThread, serif12, serif12BFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionUser interface to control the fly through renderer events. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Invoke the action event accroding to the comamnd passed in.private JPanelCreates the mouse control panels.private voidBuild the mouse recorder button panel.voiddispose(boolean flag) Dispose memory.Return the main control panel.private voidinit()Initialize the control panel.booleanReturns whether the AVI is recording.booleanisPaused()Returns whether the mouse recorder is paused.booleanReturns whether the mouse recorder is playing saved events.booleanReturns whether the mouse recorder is recording.booleanReturns whether the mouse recorder is stopped.private JButtonMakes a separator for the use in the toolbars.voidmouseClicked(MouseEvent event) Translates the event to the appropriate version on the canvas, then sends it to the canvas.voidmouseEntered(MouseEvent event) Translates the event to the appropriate version on the canvas, then sends it to the canvas.voidmouseExited(MouseEvent event) Translates the event to the appropriate version on the canvas, then sends it to the canvas.voidmousePressed(MouseEvent event) Translates the event to the appropriate version on the canvas, then sends it to the canvas.voidmouseReleased(MouseEvent event) Translates the event to the appropriate version on the canvas, then sends it to the canvas.private voidplay(boolean selectedToEnd, boolean forever) If there is no other thread running, starts a new thread to play the mouse events.voidresizePanel(int panelWidth, int frameHeight) Resizig the control panel with ViewJFrameVolumeView's frame width and height.voidSave quick time movie.voidSave AVI movie.private voidsetButtonProps(JButton button, String tip) Sets the button properties for all the arrow buttons.private voidSets the pressed or unpressed icon for the button, depending on which type it is.Methods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, disposeLocal, finalize, focusGained, focusLost, isCancelled, itemStateChanged, keyPressed, keyReleased, keyTyped, makeString, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystem, testParameterMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
STOP_MODE
public static final int STOP_MODERecorder/Player is stopped.- See Also:
-
RECORD_MODE
public static final int RECORD_MODERecorder/Player is recording.- See Also:
-
PAUSE_MODE
public static final int PAUSE_MODERecorder/Player is paused.- See Also:
-
PLAY_MODE
public static final int PLAY_MODERecorder/Player is playing.- See Also:
-
AVI_MODE
public static final int AVI_MODEAVI is recording.- See Also:
-
first
public boolean firstFlag to indicate first event. -
mode
public int modeCurrent mode, init to stop. -
changedMode
boolean changedModeflag to indicate current mode being changed. -
current
int currentindex to the item list. -
currEventTime
long currEventTimeCurrent mouse press event time stamp. -
isPlaying
boolean isPlayingFlag to indicating play mouse is running or not. -
mouseCount
int mouseCountMouse event counter. -
prevEventTime
long prevEventTimePrevious mouse press event time stamp. -
annotationNextButton
DOCUMENT ME! -
annotationPrevButton
DOCUMENT ME! -
autoRunButton
Auto Run Button. -
aviPlayButton
AVI Recorder Play button. -
aviRecordButton
AVI Recorder record button. -
aviStopButton
AVI Recorder Stop button. -
branchButton
DOCUMENT ME! -
contButton
Continue play button. -
endButton
DOCUMENT ME! -
eventVector
Seqence of mouse events ( press, shift,and release as individual mouse event). -
gazeDecreaseButton
DOCUMENT ME! -
gazeIncrButton
DOCUMENT ME! -
homeButton
DOCUMENT ME! -
leftRotateButton
DOCUMENT ME! -
mediaPlayerButton
MS media player button to play AVI file. -
middleDownButton
DOCUMENT ME! -
middleLeftButton
DOCUMENT ME! -
middleLeftButtonEmpty
Empty button group. -
middleRightButton
DOCUMENT ME! -
middleUpButton
DOCUMENT ME! -
mouseEvents
Sequence of mouse events( press, shift and release as a whole mouse event). -
mousePanel
Panel holds the mouse move buttons. -
moviePanel
Movie control panel that hold mouse recorder and AVI movie control. -
parentScene
The parent fly thru render reference. -
pauseButton
Pause button. -
playButton
Display button. -
playMouse
Reference to PlayMouse class object. -
pressed
private boolean pressedIf any of the mouse move button pressed. -
quickTimeButton
Apple quick time player button to play quick time movie. -
recordButton
Recorder button. -
reverseButton
DOCUMENT ME! -
rightDownButton
DOCUMENT ME! -
rightLeftButton
DOCUMENT ME! -
rightRightButton
DOCUMENT ME! -
rightRotateButton
DOCUMENT ME! -
rightUpButton
JButton group. -
scroller
Scroll pane. -
scrollPanel
Scroll panel that holding the all the control components. -
stepButton
Next step button. -
stepDecreaseButton
DOCUMENT ME! -
stepIncrButton
DOCUMENT ME! -
stopButton
Stop button. -
time
private long timeTime to wait for the next mouse event. -
toolBar
Tool bar of the mouse recorder.
-
-
Constructor Details
-
JPanelFlythruMove
User interface to control the fly through renderer events.- Parameters:
_kView- FlythruRender
-
-
Method Details
-
actionPerformed
Invoke the action event accroding to the comamnd passed in.- Specified by:
actionPerformedin interfaceActionListener- Specified by:
actionPerformedin classJPanelRendererBase- Parameters:
event- ActionEvent
-
dispose
public void dispose(boolean flag) Dispose memory.- Parameters:
flag- invoke the super dispose or not.
-
getMainPanel
Return the main control panel.- Specified by:
getMainPanelin classJPanelRendererBase- 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
Translates the event to the appropriate version on the canvas, then sends it to the canvas.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
event- Original mouse event.
-
mouseEntered
Translates the event to the appropriate version on the canvas, then sends it to the canvas.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
event- Original mouse event.
-
mouseExited
Translates the event to the appropriate version on the canvas, then sends it to the canvas.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
event- Original mouse event.
-
mousePressed
Translates the event to the appropriate version on the canvas, then sends it to the canvas.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
event- Original mouse event.
-
mouseReleased
Translates the event to the appropriate version on the canvas, then sends it to the canvas.- Specified by:
mouseReleasedin interfaceMouseListener- 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:
resizePanelin classJPanelRendererBase- Parameters:
panelWidth- DOCUMENT ME!frameHeight- DOCUMENT ME!
-
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
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- Iftrue, the mouse events are played from the selected one to the end of the list. Iffalseonly the selected one is played.forever- Iftrue, the mouse events list is played until the stop button or pause button is pressed.
-
setButtonProps
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
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-trueindicates the button was pressed,falsethat it was released.
-
saveAVIMovie
public void saveAVIMovie()Save quick time movie. -
saveQuickTimeMovie
public void saveQuickTimeMovie()Save AVI movie.
-