Class JPanelSlices_WM

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class JPanelSlices_WM extends JInterfaceBase implements ChangeListener
Dialog to turn slices bounding box of surface renderer on and off, and to change the color of the frame. This dialog also control the X, Y, Z slices movements.
See Also:
  • Field Details

    • serialVersionUID

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

      public JCheckBox boxX
      Check boxes that turn the image plane on and off.
    • boxY

      public JCheckBox boxY
      Check boxes that turn the image plane on and off.
    • boxZ

      public JCheckBox boxZ
      Check boxes that turn the image plane on and off.
    • sliderX

      public JSlider sliderX
      Sliders for the image planes.
    • sliderY

      public JSlider sliderY
      Sliders for the image planes.
    • sliderZ

      public JSlider sliderZ
      Sliders for the image planes.
    • sliderT

      public JSlider sliderT
      Sliders for the image planes.
    • tSlice

      public int tSlice
      Which time slice is currently displayed.
    • xSlice

      public int xSlice
      Which slice is currently displayed in the ZY plane.
    • sliceVisible

      public boolean[] sliceVisible
      Flags indicating if the image slices are on or off.
    • ySlice

      public int ySlice
      Which slice is currently displayed in the XZ plane.
    • zSlice

      public int zSlice
      Which slice is currently displayed in the XY plane.
    • boundingBoxPanel

      private JPanel boundingBoxPanel
      Bounding box control panel.
    • boundingCheck

      private JCheckBox[] boundingCheck
      Check box for turning bounding boxes on and off.
    • colorButton

      private JButton[] colorButton
      Color button for changing bounding box color.
    • controlPanel

      private JPanel controlPanel
      Main panel for sliders.
    • labelX

      private JLabel labelX
      Labels next to sliders.
    • labelY

      private JLabel labelY
      Labels next to sliders.
    • labelZ

      private JLabel labelZ
      Labels next to sliders.
    • labelT

      private JLabel labelT
      Labels next to sliders.
    • labelX1

      private JLabel labelX1
      Labels beneath sliders.
    • labelXMid

      private JLabel labelXMid
      Labels beneath sliders.
    • labelXEnd

      private JLabel labelXEnd
      Labels beneath sliders.
    • labelY1

      private JLabel labelY1
      Labels beneath sliders.
    • labelYMid

      private JLabel labelYMid
      Labels beneath sliders.
    • labelYEnd

      private JLabel labelYEnd
      Labels beneath sliders.
    • labelZ1

      private JLabel labelZ1
      Labels beneath sliders.
    • labelZMid

      private JLabel labelZMid
      Labels beneath sliders.
    • labelZEnd

      private JLabel labelZEnd
      Labels beneath sliders.
    • opacityControlPanel

      private JPanel opacityControlPanel
      Opacity control panel.
    • opacityLabelX

      private JLabel opacityLabelX
      The opacity slider label.
    • opacityLabelY

      private JLabel opacityLabelY
      The opacity slider label.
    • opacityLabelZ

      private JLabel opacityLabelZ
      The opacity slider label.
    • opacitySliderLabelsX

      private JLabel[] opacitySliderLabelsX
      The labels below the opacity slider.
    • opacitySliderLabelsY

      private JLabel[] opacitySliderLabelsY
      The labels below the opacity slider.
    • opacitySliderLabelsZ

      private JLabel[] opacitySliderLabelsZ
      The labels below the opacity slider.
    • opacitySliderX

      private JSlider opacitySliderX
      Opacity slider, not enabled yet.
    • opacitySliderY

      private JSlider opacitySliderY
      Opacity slider, not enabled yet.
    • opacitySliderZ

      private JSlider opacitySliderZ
      Opacity slider, not enabled yet.
    • scroller

      private JScrollPane scroller
      The scroll pane holding the panel content. Useful when the screen is small.
    • scrollPanel

      private JInterfaceBase.DrawingPanel scrollPanel
      Scroll panel that holding the all the control components.
    • textX

      private JTextField textX
      Text fields that display the slice number next to the sliders.
    • textY

      private JTextField textY
      Text fields that display the slice number next to the sliders.
    • textZ

      private JTextField textZ
      Text fields that display the slice number next to the sliders.
    • textT

      private JTextField textT
      Text fields that display the slice number next to the sliders.
    • xDim

      private int xDim
      x, y, z and time dimension values.
    • yDim

      private int yDim
      x, y, z and time dimension values.
    • zDim

      private int zDim
      x, y, z and time dimension values.
    • tDim

      private int tDim
      x, y, z and time dimension values.
    • xOpacitySlice

      private int xOpacitySlice
      x, y, z opacity slider values.
    • yOpacitySlice

      private int yOpacitySlice
      x, y, z opacity slider values.
    • zOpacitySlice

      private int zOpacitySlice
      x, y, z opacity slider values.
    • xProbe

      private int xProbe
      Probe x, y, z position.
    • yProbe

      private int yProbe
      Probe x, y, z position.
    • zProbe

      private int zProbe
      Probe x, y, z position.
  • Constructor Details

    • JPanelSlices_WM

      public JPanelSlices_WM(VolumeTriPlanarInterface kVolumeViewer)
      Constructor.
      Parameters:
      kVolumeViewer - parent frame.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Changes color of slices box frame and button if color button was pressed; turns bounding box on and off if checkbox was pressed; and closes dialog if "Close" button was pressed.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - Event that triggered function.
    • buildControlPanel

      public void buildControlPanel()
      Builds panel that has 3 sliders for the 3 planes shown, 3 checkboxes for showing the planes, 3 text boxes for the current values of the sliders, and a fourth slider and text box for the time dimension, if necessary.
    • buildOpacityPanel

      public void buildOpacityPanel()
      Builds panel for opacity control change on the triplanar X, Y, Z.
    • disposeLocal

      public void disposeLocal()
      Dispose memory.
    • getBoxX

      public JCheckBox getBoxX()
      Return the checkbox of X slider.
      Returns:
      boxX Get X slider check box.
    • getBoxY

      public JCheckBox getBoxY()
      Return the checkbox of Y slider.
      Returns:
      boxY Get Y slider check box.
    • getBoxZ

      public JCheckBox getBoxZ()
      Return the checkbox of Z slider.
      Returns:
      boxZ Get Z slider check box.
    • getCenter

      public WildMagic.LibFoundation.Mathematics.Vector3f getCenter()
      Gets the three slider positions, representing the center point of the three orthogonal planes. The center point is translated from local ModelCoordinates into FileCoordinates.
      Returns:
      , the center of the three orthogonal planes (the three slider positions) in FileCoordinates.
    • getOpacity

      public int getOpacity(int i)
    • setOpacity

      public void setOpacity(int i, int value)
    • getColor

      public Color getColor(int i)
    • setColor

      public void setColor(int i, Color value)
    • getShowSlice

      public boolean getShowSlice(int i)
    • setShowSlice

      public void setShowSlice(int i, boolean value)
    • getShowBound

      public boolean getShowBound(int i)
    • setShowBound

      public void setShowBound(int i, boolean value)
    • getOpacitySliderX

      public JSlider getOpacitySliderX()
      Return the X opacity slider.
      Returns:
      opcitySliderX Opacity slider X.
    • getOpacitySliderY

      public JSlider getOpacitySliderY()
      Return the Y opacity slider.
      Returns:
      opcitySliderY Opacity slider Y.
    • getOpacitySliderZ

      public JSlider getOpacitySliderZ()
      Return the Z opacity slider.
      Returns:
      opcitySliderZ Opacity slider Z.
    • getSlice

      public int getSlice(int orientation)
      Get the current slider value for the slider that matches the orientation input parameter.
      Parameters:
      orientation - either FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL, or FileInfoBase.UNKNOWN_ORIENT.
      Returns:
      The slider position for the given orientation is returned. *
    • getSliderX

      public JSlider getSliderX()
      Return the X slider.
      Returns:
      sliderX X slider.
    • getSliderY

      public JSlider getSliderY()
      Return the Y slider.
      Returns:
      sliderY Y slider.
    • getSliderZ

      public JSlider getSliderZ()
      Return the Z slider.
      Returns:
      sliderZ Z slider.
    • getVisible

      public boolean getVisible(int orientation)
      slice slider visible or not.
      Returns:
      sliceVisible if true visible, otherwise invisible.
    • getXOpacitySlice

      public int getXOpacitySlice()
      Get the x opacity slider value.
      Returns:
      xOpacityslice X opacity slider value.
    • getXProbePos

      public int getXProbePos()
      Get the probe x coordinate.
      Returns:
      xProbe probe x position
    • getXSlice

      public int getXSlice()
      Get the X slider value.
      Returns:
      xSlice X slider value.
    • getYOpacitySlice

      public int getYOpacitySlice()
      Get the y opacity slider value.
      Returns:
      yOpacityslice Y opacity slider value.
    • getYProbePos

      public int getYProbePos()
      Get the probe y coordinate.
      Returns:
      yProbe probe y position
    • getYSlice

      public int getYSlice()
      Get the y slider value.
      Returns:
      ySlice Y slider value.
    • getZOpacitySlice

      public int getZOpacitySlice()
      Get the z opacity slider value.
      Returns:
      zOpacityslice Z opacity slider value.
    • getZProbePos

      public int getZProbePos()
      Get the probe z coordinate.
      Returns:
      zProbe probe z position
    • getZSlice

      public int getZSlice()
      Get the z slider value.
      Returns:
      zSlice Z slider value.
    • init

      public void init()
      Initializes GUI components.
    • resizePanel

      public void resizePanel(int panelWidth, int frameHeight)
      Resizing the control panel with ViewJFrameVolumeView's frame width and height.
      Parameters:
      panelWidth - DOCUMENT ME!
      frameHeight - DOCUMENT ME!
    • setButtonColor

      public void setButtonColor(JButton _button, Color _color)
      Description copied from class: JInterfaceBase
      Set the color of the button. Derived classes may also perform other functions.
      Overrides:
      setButtonColor in class JInterfaceBase
      Parameters:
      _button - button.
      _color - color.
    • setCenter

      public void setCenter(int x, int y, int z)
      Sets the three slider positions, based on the position of the three orthogonal planes: AXIAL, CORONAL, and SAGITTAL.
      Parameters:
      x - center x-position in FileCoordinates
      y - center y-position in FileCoordinates
      z - center z-position in FileCoordinates
    • setOpacitySliderXEnabled

      public void setOpacitySliderXEnabled(boolean flag)
      Set the opacity slider X with given boolean value.
      Parameters:
      flag - indicate opacity slider is set or not
    • setOpacitySliderYEnabled

      public void setOpacitySliderYEnabled(boolean flag)
      Set the opacity slider Y with given boolean value.
      Parameters:
      flag - indicate opacity slider is set or not
    • setOpacitySliderZEnabled

      public void setOpacitySliderZEnabled(boolean flag)
      Set the opacity slider Z with given boolean value.
      Parameters:
      flag - indicate opacity slider is set or not
    • setXProbePos

      public void setXProbePos(int _xProbe)
      Set probe x coordinate.
      Parameters:
      _xProbe - probe x position
    • setXSliderEnabled

      public void setXSliderEnabled(boolean flag)
      Sets the x slider and the labels beside and beneath it to the state given by flag.
      Parameters:
      flag - if true enable, otherwise disable.
    • setYProbePos

      public void setYProbePos(int _yProbe)
      Set probe y coordinate.
      Parameters:
      _yProbe - probe y position
    • setYSliderEnabled

      public void setYSliderEnabled(boolean flag)
      Sets the y slider and the labels beside and beneath it to the state given by flag.
      Parameters:
      flag - if true enable, otherwise disable.
    • setZProbePos

      public void setZProbePos(int _zProbe)
      Set probe z coordinate.
      Parameters:
      _zProbe - probe z position
    • setZSliderEnabled

      public void setZSliderEnabled(boolean flag)
      Sets the z slider and the labels beside and beneath it to the state given by flag.
      Parameters:
      flag - if true enable, otherwise disable.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Sets how the image plane should be displayed depending on value of slider.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - Event that triggered this function.
    • addControlPanel

      private void addControlPanel(Component c, GridBagConstraints gbc, int x, int y, int w, int h)
      Helper method that adds components to the control panel for the grid bag layout.
      Parameters:
      c - Component added to the control panel.
      gbc - GridBagConstraints of added component.
      x - Gridx location
      y - Gridy location
      w - Gridwidth
      h - Gridheight
    • addOpacityControlPanel

      private void addOpacityControlPanel(Component c, GridBagConstraints gbc, int x, int y, int w, int h)
      Helper method that adds components to the control panel for the grid bag layout.
      Parameters:
      c - Component added to the control panel.
      gbc - GridBagConstraints of added component.
      x - Gridx location
      y - Gridy location
      w - Gridwidth
      h - Gridheight
    • buildBoundingBox

      private void buildBoundingBox()
      Build the boudning box for X, Y, Z slices.
    • buildTimeSlider

      private void buildTimeSlider()
      Builds the time (4D) slider. No check box, because there is no plane to turn off.
    • createLabel

      private JLabel createLabel(String title)
      Creates a label in the proper font and color.
      Parameters:
      title - The title of the label.
      Returns:
      The new label.
    • setXSlicePos

      private void setXSlicePos(int _xSlice)
      Set the current x slider move position.
      Parameters:
      _xSlice - x slider position
    • setYSlicePos

      private void setYSlicePos(int _ySlice)
      Set the current y slider move position.
      Parameters:
      _ySlice - y slider position
    • setZSlicePos

      private void setZSlicePos(int _zSlice)
      Set the current z slider move position.
      Parameters:
      _zSlice - z slider position