Class JDialogOpacityControls

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class JDialogOpacityControls extends JDialogBase implements ChangeListener
Simple dialog to change Opacity Settings (1 = opaque, 0 = transparent).
Version:
1.0 Sept 17, 1999
Author:
Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

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

      private ViewControlsImage controls
      Controls affected by opacity changes.
    • current

      private JLabel current
      Label that gives current value of slider.
    • opacity

      private float opacity
      Opacity number.
    • opacitySlider

      private JSlider opacitySlider
      Opacity slider.
    • surfacePaint

      private SurfacePaint surfacePaint
      SurfacePaint reference
    • surfacePaint_WM

      private SurfacePaint_WM surfacePaint_WM
      SurfacePaint reference
    • voiManager

      private VOIManagerInterface voiManager
  • Constructor Details

    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, ViewControlsImage cntrls)
      Creates new dialog with a slider and close button.
      Parameters:
      theParentFrame - The parent frame
      cntrls - The controls that the opacity will apply to.
    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, float initVal)
      Creates new dialog with a slider and close button.
      Parameters:
      theParentFrame - The parent frame
      initVal - The initial value of the opacity.
    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, ViewControlsImage cntrls, boolean isVisible)
      Deprecated.
      Creates new dialog with a slider and close button.
      Parameters:
      theParentFrame - The parent frame
      cntrls - The controls that the opacity will apply to.
      isVisible - Dialog visible or not
    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, float initVal, boolean isVisible)
      Deprecated.
      Creates new dialog with a slider and close button.
      Parameters:
      theParentFrame - The parent frame
      initVal - The initial value of the opacity.
      isVisible - Dialog visible or not
    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, SurfacePaint surfacePaint, float initVal)
      Creates new dialog with a slider and close button.
      Parameters:
      theParentFrame - The parent frame
      initVal - The initial value of the opacity.
    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, SurfacePaint_WM surfacePaint, float initVal)
      Creates new dialog with a slider and close button.
      Parameters:
      theParentFrame - The parent frame
      initVal - The initial value of the opacity.
    • JDialogOpacityControls

      public JDialogOpacityControls(Frame theParentFrame, VOIManagerInterface voiManager, float initVal)
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Sets opacity once close button is pressed.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - Event that triggered function
    • getMainPanel

      public JPanel getMainPanel(float initValue)
      Deprecated.
      Makes slider to set opacity of VOI. Opaque = 1, Transparency = 0.
      Parameters:
      initValue - Initial value of slider.
      Returns:
      DOCUMENT ME!
    • getOpacity

      public float getOpacity()
      Accessor that returns the new opacity.
      Overrides:
      getOpacity in class Window
      Returns:
      Opacity.
    • 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
    • init

      private void init(float initValue)
      Makes slider to set opacity of VOI. Opaque = 1, Transparency = 0.
      Parameters:
      initValue - Initial value of slider.