Package gov.nih.mipav.view.renderer.J3D
Class JPanelCamera
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.J3D.JPanelRendererJ3D
gov.nih.mipav.view.renderer.J3D.JPanelCamera
- All Implemented Interfaces:
ActionListener,FocusListener,ItemListener,KeyListener,MouseListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class JPanelCamera
extends JPanelRendererJ3D
implements ActionListener, MouseListener, ItemListener
JPanelCamera creates the camera control panel for the 3D visulization frame. The basic functionalities include auto
and manual snapshot 3D images, and create a film clip from the captuered 3D images.
- Version:
- 0.1 May, 2003
- Author:
- Matthew J. McAuliffe, Ph.D., 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) classHelper class which create the empty button.(package private) classHelper class which sets the appropriate icons for the left button.(package private) classHelper class which sets the appropriate icons for the right 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 JPanelButton panel.private JLabelLabel of the rotation degree.private JTextFieldTextfield of the roation degree.static final intFly mode of the camera manually snapshooting.private JRadioButtonRaido Button group.private JLabelX, Y, Z labels inside the rotation panel.private JLabelX, Y, Z labels inside the rotation panel.private JLabelX, Y, Z labels inside the rotation panel.private JButtonLeft panel mouse button down.private JButtonLeft panel empty button.private JButtonLeft panel mouse button left.private JButtonLeft panel mouse button right.private JButtonLeft panel mouse button up.private JButtonEmpty button group.private JButtonMiddle panel down button.private JButtonMiddel panel left button.private JButtonMiddle panel empty button.private JButtonMiddle panel right button.private JButtonMiddle panel right button empty.private JButtonMiddel panel up button.private intCurrent mode std or fly.private JPanelPanel holds the mouse move buttons.private RenderViewBaseParent frame.private booleanIf any of the mouse move button pressed.private JRadioButtonRadio button of the X_AXIS mode option.private JRadioButtonRadio button of the Y_AXIS mode option.private JRadioButtonRadio button of the Z_AXIS mode option.private JButtonReset button.private JButtonRight panel down button.private JButtonRight panel left button.private JButtonRight panel right button.private JButtonRight panel up button.private JScrollPaneScroll pane.private JPanelCamera.DrawingPanelScroll panel that holding the all the control components.private static final longUse serialVersionUID for interoperability.private JButtonCamera button.private JButtonStart button to auto snapshooting.static final intStardard mode of the camera auto snapshooting.private JRadioButtonAuto snapshot button.private longTime to wait for the next mouse event.Fields inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
rayBasedRender, renderBaseFields 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
ConstructorsConstructorDescriptionJPanelCamera(RenderViewBase theParentFrame) Creates new dialog for converting type of image. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Closes dialog box when the OK button is pressed and sets the variables.private JPanelCreates the mouse control panels.private JButtonBuild the reset button.private JButtonBuilds the cancel button.voiddisposeLocal(boolean flag) Clear memory.protected voidfinalize()finalize - calls dispose.Sets up the GUI (panels, buttons, etc) and displays it on the screen.private voidinit()Sets up the GUI (panels, buttons, etc) and displays it on the screen.voiditemStateChanged(ItemEvent event) Sets the flags for the checkboxes and resets labels.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.voidresizePanel(int panelWidth, int frameHeight) Resizig the control panel with ViewJFrameVolumeView's frame width and height.private voidsetButtonProps(JButton button, String tip) Sets the button properties for all the arrow buttons.voidsetDegree(boolean positive) Set the image rotation angle.private voidsetFlyEnabled(boolean flag) Enable manual snapshot buttons.private voidSets the pressed or unpressed icon for the button, depending on which type it is.private voidsetStdEnabled(boolean flag) Enable auto snapshot buttons.protected booleantestParameter(String str, double minValue, double maxValue) Tests that the entered parameter is in range.Methods inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
disposeLocal, getSurfaceRender, setRayBasedRender, setSurfaceRenderMethods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, focusGained, focusLost, isCancelled, keyPressed, keyReleased, keyTyped, makeString, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystemMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.event.FocusListener
focusGained, focusLostMethods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
STD_MODE
public static final int STD_MODEStardard mode of the camera auto snapshooting.- See Also:
-
FLY_MODE
public static final int FLY_MODEFly mode of the camera manually snapshooting.- See Also:
-
buttonPanel
Button panel. -
degreeLabel
Label of the rotation degree. -
degreeText
Textfield of the roation degree. -
flyButton
Raido Button group. -
labelX
X, Y, Z labels inside the rotation panel. -
labelY
X, Y, Z labels inside the rotation panel. -
labelZ
X, Y, Z labels inside the rotation panel. -
leftDownButton
Left panel mouse button down. -
leftDownButtonEmpty
Left panel empty button. -
leftLeftButton
Left panel mouse button left. -
leftRightButton
Left panel mouse button right. -
leftUpButton
Left panel mouse button up. -
leftUpButtonEmpty
Empty button group. -
middleDownButton
Middle panel down button. -
middleLeftButton
Middel panel left button. -
middleLeftButtonEmpty
Middle panel empty button. -
middleRightButton
Middle panel right button. -
middleRightButtonEmpty
Middle panel right button empty. -
middleUpButton
Middel panel up button. -
mode
private int modeCurrent mode std or fly. -
mousePanel
Panel holds the mouse move buttons. -
parentScene
Parent frame. -
pressed
private boolean pressedIf any of the mouse move button pressed. -
radioX
Radio button of the X_AXIS mode option. -
radioY
Radio button of the Y_AXIS mode option. -
radioZ
Radio button of the Z_AXIS mode option. -
resetButton
Reset button. -
rightDownButton
Right panel down button. -
rightLeftButton
Right panel left button. -
rightRightButton
Right panel right button. -
rightUpButton
Right panel up button. -
scroller
Scroll pane. -
scrollPanel
Scroll panel that holding the all the control components. -
snapButton
Camera button. -
startButton
Start button to auto snapshooting. -
stdButton
Auto snapshot button. -
time
private long timeTime to wait for the next mouse event.
-
-
Constructor Details
-
JPanelCamera
Creates new dialog for converting type of image.- Parameters:
theParentFrame- Parent frame.
-
-
Method Details
-
actionPerformed
Closes dialog box when the OK button is pressed and sets the variables.- Specified by:
actionPerformedin interfaceActionListener- Specified by:
actionPerformedin classJPanelRendererBase- Parameters:
event- Event that triggers this function
-
disposeLocal
public void disposeLocal(boolean flag) Clear memory.- Parameters:
flag- if true then super.disposeLocal() is called
-
getMainPanel
Sets up the GUI (panels, buttons, etc) and displays it on the screen.- Specified by:
getMainPanelin classJPanelRendererBase- Returns:
- JPanel the main control panel
-
itemStateChanged
Sets the flags for the checkboxes and resets labels.- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classJPanelRendererBase- Parameters:
event- Event that triggered this function.
-
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- panel width.frameHeight- parent frame height.
-
setDegree
public void setDegree(boolean positive) Set the image rotation angle.- Parameters:
positive- rotate counter clock wise or not.
-
finalize
finalize - calls dispose.- Overrides:
finalizein classJPanelRendererBase- Throws:
Throwable- Call disposeLocal to free memory.
-
testParameter
Tests that the entered parameter is in range.- Overrides:
testParameterin classJPanelRendererBase- Parameters:
str- The value entered by the user.minValue- The minimum value this variable may be set to.maxValue- The maximum value this variable may be set to.- Returns:
trueif parameters passed range test,falseif failed.
-
buildMouseControlPanel
Creates the mouse control panels. There are four arrows for each mouse button, left, right, and middle.- Returns:
- The panel containing the mouse controls.
-
buildResetButton
Build the reset button.- Returns:
- resetButton reset button.
-
buildStartButton
Builds the cancel button. Sets it internally as well return the just-built button.- Returns:
- Return the auto snapshot button.
-
init
private void init()Sets up the GUI (panels, buttons, etc) and displays it on the screen. -
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.
-
setFlyEnabled
private void setFlyEnabled(boolean flag) Enable manual snapshot buttons.- Parameters:
flag-truemeans turn on,falsemeans turn off.
-
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.
-
setStdEnabled
private void setStdEnabled(boolean flag) Enable auto snapshot buttons.- Parameters:
flag-truemeans turn on,falsemeans turn off.
-