Class ViewControlsImage

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

public class ViewControlsImage extends JPanel implements ChangeListener, ActionListener
This class builds the control panel used in ViewJFrameImage frames. Toolbars are created and added to the panel and the listener for the toolbars is the image frame. If the image frame is to display two images then alpha blending tools are added and displayed.
Version:
0.1 Dec 15, 1998 update 9 august 2001
Author:
Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

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

      protected JSlider alphaSlider
      DOCUMENT ME!
    • borderActiveImage

      protected TitledBorder borderActiveImage
      DOCUMENT ME!
    • borderImageSlider

      protected TitledBorder borderImageSlider
      DOCUMENT ME!
    • frame

      protected ViewJFrameBase frame
      DOCUMENT ME!
    • gbc

      protected GridBagConstraints gbc
      DOCUMENT ME!
    • generalPanel

      protected JPanel generalPanel
      DOCUMENT ME!
    • group1

      protected ButtonGroup group1
      DOCUMENT ME!
    • imageSize

      protected int imageSize
      DOCUMENT ME!
    • paintToolBar

      protected JToolBar paintToolBar
      Paint toolbar.
    • panelActiveImage

      protected JPanel panelActiveImage
      DOCUMENT ME!
    • panelImageSlider

      protected JPanel panelImageSlider
      DOCUMENT ME!
    • panelOptionToolbars

      protected JPanel panelOptionToolbars
      DOCUMENT ME!
    • panelToolbars

      protected JPanel panelToolbars
      DOCUMENT ME!
    • radioImageA

      protected JRadioButton radioImageA
      DOCUMENT ME!
    • radioImageB

      protected JRadioButton radioImageB
      DOCUMENT ME!
    • registrationToolBar

      protected JToolBar registrationToolBar
      Registration toolbar.
    • scriptToolBar

      protected JToolBar scriptToolBar
      DOCUMENT ME!
    • tImageSlider

      protected ViewJSlider tImageSlider
      tImageSlider
    • toolBar

      protected JToolBar toolBar
      Main toolbar .
    • toolBarObj

      protected ViewToolBarBuilder toolBarObj
      Object builds and controls the toolbars.
    • zImageSlider

      protected ViewJSlider zImageSlider
      DOCUMENT ME!
  • Constructor Details

    • ViewControlsImage

      public ViewControlsImage(ViewJFrameBase _frame)
      Constructs new control panel.
      Parameters:
      _frame - Parent frame.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Action event handler. Switches active image between image A and image B.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - Event that triggers function.
    • add

      public void add(Component c, GridBagConstraints gbc, int x, int y, int w, int h)
      Adds a component to the toolbar panel using the given gridbag constraints.
      Parameters:
      c - Component to add.
      gbc - Grid bag constraints for component.
      x - GridBagConstraints.gridx
      y - GridBagConstraints.gridy
      w - GridBagConstraints.gridwidth
      h - GridBagConstraints.gridheight
      See Also:
    • addActiveImageControl

      public void addActiveImageControl()
      Displays the panel which controls which image is the "active image" displayed when imageB is available.
    • buildToolbar

      public void buildToolbar(boolean showImage, JToolBar voiToolbar, ButtonGroup VOIGroup, JToggleButton VOIPointer, boolean showPaint)
      DOCUMENT ME!
      Parameters:
      showImage - Indicates if the image toolbar is shown.
      showPaint - Indicates if the paint toolbar is shown.
      showVOI - Indicates if the VOI toolbar is shown.
      voiIndex - Indicates the index of the currently (or previously) selected VOI
    • buildToolbar

      public void buildToolbar(boolean showImage, JToolBar voiToolbar, ButtonGroup VOIGroup, JToggleButton VOIPointer, boolean showPaint, boolean showScripting)
      Builds the toolbars.
      Parameters:
      showImage - Indicates if the image toolbar is shown.
      showPaint - Indicates if the paint toolbar is shown.
      showScripting - Indicates if the scripting toolbar is shown.
      showVOI - Indicates if the VOI toolbar is shown.
      voiIndex - Indicates the index of the currently (or previously) selected VOI
    • addCustomToolBar

      public void addCustomToolBar(Vector<CustomUIBuilder.UIParams> paramVector)
    • buildSimpleToolBar

      public void buildSimpleToolBar()
      Creates the main toolbar without any of the pre-made additional bars (no VOI etc) for use with addCustomToolBar() to add custom-built bars to the main bar
    • finalize

      public void finalize()
      Clean up memory.
      Overrides:
      finalize in class Object
    • getActiveImage

      public int getActiveImage()
      Identifies which image is active.
      Returns:
      the identifier for the active image
    • getFrame

      public ViewJFrameBase getFrame()
      Accessor for the ViewJFrameBase used.
      Returns:
      the frame used
    • getTools

      public ViewToolBarBuilder getTools()
      Accessor for the tool bar held by these controls.
      Returns:
      The tool bar held by this controls.
    • removeActiveImageControl

      public void removeActiveImageControl()
      Removes the controls to the display of which image is "active" in the frame when imageB is not available.
    • runCurrentScript

      public void runCurrentScript()
      Invokes the toolbar builder to run the currently selected script.
    • setActiveImage

      public void setActiveImage(int image)
      Sets the active image to either A or B and updates the paint spinner values.
      Parameters:
      image - Indicates which image is active.
    • setAlphaSliderEnabled

      public void setAlphaSliderEnabled(boolean enabled)
      DOCUMENT ME!
      Parameters:
      enabled - DOCUMENT ME!
    • setRecording

      public void setRecording(boolean isRecording)
      Used to set the state for the script recorder.
      Parameters:
      isRecording - boolean
    • setAlphaSlider

      public void setAlphaSlider(int i)
    • setTimeSl

      public void setTimeSl(int slice)
      Directs the image to display a particular time slice.
      Parameters:
      slice - The time slice to display.
      See Also:
      • invalid reference
        ModelImage#setTimeSlice(int)
    • setTSlider

      public void setTSlider(int tSlice)
      Places the pointer on the (time) slider bar to a location corresponding to the given slice value (within the set).
      Parameters:
      tSlice - The slice in the frame that is displayed.
      See Also:
    • setVOIColor

      public void setVOIColor(int voiUID)
      DOCUMENT ME!
      Parameters:
      voiUID - DOCUMENT ME!
    • setVOIColor

      public void setVOIColor(Color newColor)
      DOCUMENT ME!
      Parameters:
      newColor - DOCUMENT ME!
    • setZSlider

      public void setZSlider(int zSlice)
      Places the pointer on the (slice) slider bar to a location corresponding to the given slice value (within the set) without notifying the listeners.
      Parameters:
      zSlice - the slice in the frame that is displayed
      See Also:
      • JSlider
      • invalid reference
        ViewControlsImage#updateZImageSlider(int)
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Sets values based on knob along slider.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - Event that triggered this function.
    • updateFrames

      public void updateFrames(boolean flag, int alphaBlend)
      Calls ModelImage's updateFrames method.
      Parameters:
      flag - this boolean indicates if the frame that displays the image should re-export the image and apply new LUT
      alphaBlend - the amount of alpha blending to do
      See Also:
      • invalid reference
        ModelImage#notifyImageDisplayListners
    • updateScripts

      public void updateScripts(String dir)
      Invokes the toolbar builder to update the scripts combo box based on the new script directory.
      Parameters:
      dir - - name of directory for script files.
    • buildAlphaSlider

      protected void buildAlphaSlider()
      Builds the slider used to control the alpha blending.
    • getTImageSlider

      public JSlider getTImageSlider()
    • getZImageSlider

      public JSlider getZImageSlider()
    • toggleSlider

      public void toggleSlider()
      This method toggles between the intensities between Image A and Image B