Class 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • STD_MODE

      public static final int STD_MODE
      Stardard mode of the camera auto snapshooting.
      See Also:
    • FLY_MODE

      public static final int FLY_MODE
      Fly mode of the camera manually snapshooting.
      See Also:
    • buttonPanel

      private JPanel buttonPanel
      Button panel.
    • degreeLabel

      private JLabel degreeLabel
      Label of the rotation degree.
    • degreeText

      private JTextField degreeText
      Textfield of the roation degree.
    • flyButton

      private JRadioButton flyButton
      Raido Button group.
    • labelX

      private JLabel labelX
      X, Y, Z labels inside the rotation panel.
    • labelY

      private JLabel labelY
      X, Y, Z labels inside the rotation panel.
    • labelZ

      private JLabel labelZ
      X, Y, Z labels inside the rotation panel.
    • leftDownButton

      private JButton leftDownButton
      Left panel mouse button down.
    • leftDownButtonEmpty

      private JButton leftDownButtonEmpty
      Left panel empty button.
    • leftLeftButton

      private JButton leftLeftButton
      Left panel mouse button left.
    • leftRightButton

      private JButton leftRightButton
      Left panel mouse button right.
    • leftUpButton

      private JButton leftUpButton
      Left panel mouse button up.
    • leftUpButtonEmpty

      private JButton leftUpButtonEmpty
      Empty button group.
    • middleDownButton

      private JButton middleDownButton
      Middle panel down button.
    • middleLeftButton

      private JButton middleLeftButton
      Middel panel left button.
    • middleLeftButtonEmpty

      private JButton middleLeftButtonEmpty
      Middle panel empty button.
    • middleRightButton

      private JButton middleRightButton
      Middle panel right button.
    • middleRightButtonEmpty

      private JButton middleRightButtonEmpty
      Middle panel right button empty.
    • middleUpButton

      private JButton middleUpButton
      Middel panel up button.
    • mode

      private int mode
      Current mode std or fly.
    • mousePanel

      private JPanel mousePanel
      Panel holds the mouse move buttons.
    • parentScene

      private RenderViewBase parentScene
      Parent frame.
    • pressed

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

      private JRadioButton radioX
      Radio button of the X_AXIS mode option.
    • radioY

      private JRadioButton radioY
      Radio button of the Y_AXIS mode option.
    • radioZ

      private JRadioButton radioZ
      Radio button of the Z_AXIS mode option.
    • resetButton

      private JButton resetButton
      Reset button.
    • rightDownButton

      private JButton rightDownButton
      Right panel down button.
    • rightLeftButton

      private JButton rightLeftButton
      Right panel left button.
    • rightRightButton

      private JButton rightRightButton
      Right panel right button.
    • rightUpButton

      private JButton rightUpButton
      Right panel up button.
    • scroller

      private JScrollPane scroller
      Scroll pane.
    • scrollPanel

      private JPanelCamera.DrawingPanel scrollPanel
      Scroll panel that holding the all the control components.
    • snapButton

      private JButton snapButton
      Camera button.
    • startButton

      private JButton startButton
      Start button to auto snapshooting.
    • stdButton

      private JRadioButton stdButton
      Auto snapshot button.
    • time

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

    • JPanelCamera

      public JPanelCamera(RenderViewBase theParentFrame)
      Creates new dialog for converting type of image.
      Parameters:
      theParentFrame - Parent frame.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Closes dialog box when the OK button is pressed and sets the variables.
      Specified by:
      actionPerformed in interface ActionListener
      Specified by:
      actionPerformed in class JPanelRendererBase
      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

      public JPanel getMainPanel()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
      Specified by:
      getMainPanel in class JPanelRendererBase
      Returns:
      JPanel the main control panel
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Sets the flags for the checkboxes and resets labels.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JPanelRendererBase
      Parameters:
      event - Event that triggered this function.
    • mouseClicked

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

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

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

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

      public void mouseReleased(MouseEvent event)
      Translates the event to the appropriate version on the canvas, then sends it to the canvas.
      Specified by:
      mouseReleased in interface 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 - 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

      protected void finalize() throws Throwable
      finalize - calls dispose.
      Overrides:
      finalize in class JPanelRendererBase
      Throws:
      Throwable - Call disposeLocal to free memory.
    • testParameter

      protected boolean testParameter(String str, double minValue, double maxValue)
      Tests that the entered parameter is in range.
      Overrides:
      testParameter in class JPanelRendererBase
      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:
      true if parameters passed range test, false if failed.
    • buildMouseControlPanel

      private JPanel 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

      private JButton buildResetButton()
      Build the reset button.
      Returns:
      resetButton reset button.
    • buildStartButton

      private JButton 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

      private void setButtonProps(JButton button, 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.
    • setFlyEnabled

      private void setFlyEnabled(boolean flag)
      Enable manual snapshot buttons.
      Parameters:
      flag - true means turn on, false means turn off.
    • setIcon

      private void setIcon(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.
    • setStdEnabled

      private void setStdEnabled(boolean flag)
      Enable auto snapshot buttons.
      Parameters:
      flag - true means turn on, false means turn off.