Class JDialogLightBox

  • All Implemented Interfaces:
    DialogDefaultsInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogLightBox
    extends JDialogBase
    implements javax.swing.event.ChangeListener
    This class builds the control dialog used in ViewJFrameLightbox class. Widgets are created and added to the panel and the listener. This dialog will allow the user to set the number of rows or columns, the color of the borders and the background, the magnification of the images and if its a 4D image, the 4th dimension slider.
    Version:
    1.0 June 31st, 1999
    Author:
    Matthew J. McAuliffe, Ph.D. annd Tun Jie, M.D.
    See Also:
    ViewJFrameLightBox, Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  JDialogLightBox.CancelListener
      does nothing at the moment.
      (package private) class  JDialogLightBox.OkBgListener
      pick up the selected color and call method to change the grid color.
      (package private) class  JDialogLightBox.OkBorderListener
      Pick up the selected color and change the image border color For use by the color chooser.
      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      DOCUMENT ME!
      private void buildColorPanel()
      builds the controls to set the color of the border the and color of the background.
      void buildDialog()
      setup the lightbox's control dialog.
      private void buildMagSlider()
      builds the image magnification slider.
      private void buildMagSliderLabels​(float min, float max)
      builds labels used by the magnification slider.
      private void buildRowColPanel()
      sets up the row and column panel.
      private void buildTSlider()
      builds the time (4th dimension) slider.
      private void buildTSliderLabels​(int min, int max)
      builds labels used by the time slider.
      private int checkBSTextField()
      check border size of the frame, range (0,10).
      private int checkGSTextField()
      checks the settings of grid size controls.
      private int checkIncrementTextField()
      check border size of the frame, range (0,10).
      private int checkRCTextField()
      checks the settings of light box row/column controls.
      void resetValues()
      Resets the values to match the current lightbox.
      void setTSlider​(int tSlice)
      method to set the time (4th dimension) slider if it exists.
      void setValues​(boolean row_dependent, int row, int col)
      method to set the row, col, and row_dependent values.
      void stateChanged​(javax.swing.event.ChangeEvent e)
      sets values based on knob along slider.
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • VALID_INPUT

        private static int VALID_INPUT
        definitions indicating that user input has been validated.
      • SAME_INPUT

        private static int SAME_INPUT
        DOCUMENT ME!
      • INVALID_INPUT

        private static int INVALID_INPUT
        DOCUMENT ME!
      • bgColor

        private java.awt.Color bgColor
        DOCUMENT ME!
      • borderB

        private javax.swing.JButton borderB
        DOCUMENT ME!
      • backgroundB

        private javax.swing.JButton backgroundB
        DOCUMENT ME!
      • borderColor

        private java.awt.Color borderColor
        DOCUMENT ME!
      • borderSize

        private int borderSize
        DOCUMENT ME!
      • bordersizeL

        private javax.swing.JLabel bordersizeL
        DOCUMENT ME!
      • bordersizeText

        private javax.swing.JTextField bordersizeText
        DOCUMENT ME!
      • incrementText

        private javax.swing.JTextField incrementText
      • incrementLabel

        private javax.swing.JLabel incrementLabel
      • increment

        private int increment
      • lastIncrement

        private int lastIncrement
      • col

        private int col
        DOCUMENT ME!
      • colLabel

        private javax.swing.JLabel colLabel
        DOCUMENT ME!
      • colorPanel

        private javax.swing.JPanel colorPanel
        DOCUMENT ME!
      • colPanel

        private javax.swing.JPanel colPanel
        DOCUMENT ME!
      • colText

        private javax.swing.JTextField colText
        DOCUMENT ME!
      • font12

        private java.awt.Font font12
        DOCUMENT ME!
      • font12B

        private java.awt.Font font12B
        DOCUMENT ME!
      • gridSize

        private int gridSize
        DOCUMENT ME!
      • gridsizeL

        private javax.swing.JLabel gridsizeL
        DOCUMENT ME!
      • gridsizeText

        private javax.swing.JTextField gridsizeText
        DOCUMENT ME!
      • lastBorderSize

        private int lastBorderSize
        DOCUMENT ME!
      • lastCol

        private int lastCol
        DOCUMENT ME!
      • lastGridSize

        private int lastGridSize
        DOCUMENT ME!
      • lastRow

        private int lastRow
        DOCUMENT ME!
      • lastRowBFlag

        private boolean lastRowBFlag
        DOCUMENT ME!
      • magnification

        private float magnification
        DOCUMENT ME!
      • magniWindow

        private javax.swing.JWindow magniWindow
        DOCUMENT ME!
      • magSlider

        private javax.swing.JSlider magSlider
        DOCUMENT ME!
      • magSliderDictionary

        private java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> magSliderDictionary
        DOCUMENT ME!
      • magSliderPanel

        private javax.swing.JPanel magSliderPanel
        DOCUMENT ME!
      • panelRowColumn

        private javax.swing.JPanel panelRowColumn
        DOCUMENT ME!
      • radioColumn

        private javax.swing.JRadioButton radioColumn
        DOCUMENT ME!
      • radioRow

        private javax.swing.JRadioButton radioRow
        DOCUMENT ME!
      • resetButton

        private javax.swing.JButton resetButton
        DOCUMENT ME!
      • row

        private int row
        DOCUMENT ME!
      • row_dependent

        private boolean row_dependent
        DOCUMENT ME!
      • rowBFlag

        private boolean rowBFlag
        values obtained from settings.
      • rowLabel

        private javax.swing.JLabel rowLabel
        DOCUMENT ME!
      • rowPanel

        private javax.swing.JPanel rowPanel
        DOCUMENT ME!
      • rowText

        private javax.swing.JTextField rowText
        DOCUMENT ME!
      • toolTip

        private javax.swing.JLabel toolTip
        DOCUMENT ME!
      • tSlider

        private javax.swing.JSlider tSlider
        DOCUMENT ME!
      • tSliderDictionary

        private java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> tSliderDictionary
        DOCUMENT ME!
      • tSliderPanel

        private javax.swing.JPanel tSliderPanel
        DOCUMENT ME!
    • Constructor Detail

      • JDialogLightBox

        public JDialogLightBox​(ViewJFrameLightBox _frame)
        constructs new control dialog of the Lightbox View.
        Parameters:
        _frame - reference to the lightbox frame
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        DOCUMENT ME!
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - event that triggers function
      • buildDialog

        public void buildDialog()
        setup the lightbox's control dialog. Sets the row/column selector, color, magnification slider, and, if needed, 4th dimension slider.
      • resetValues

        public void resetValues()
        Resets the values to match the current lightbox. The magnification and time slider are not reset, since changes to those fields automatically update in the lightbox frame.
      • setTSlider

        public void setTSlider​(int tSlice)
        method to set the time (4th dimension) slider if it exists.
        Parameters:
        tSlice - time slice that the slider should be set to.
      • setValues

        public void setValues​(boolean row_dependent,
                              int row,
                              int col)
        method to set the row, col, and row_dependent values.
        Parameters:
        row_dependent - DOCUMENT ME!
        row - DOCUMENT ME!
        col - DOCUMENT ME!
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        sets values based on knob along slider.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        e - event that triggered this function
      • buildColorPanel

        private void buildColorPanel()
        builds the controls to set the color of the border the and color of the background.
      • buildMagSlider

        private void buildMagSlider()
        builds the image magnification slider.
      • buildMagSliderLabels

        private void buildMagSliderLabels​(float min,
                                          float max)
        builds labels used by the magnification slider.
        Parameters:
        min - minimum value for the slider
        max - maximum value for the slider
      • buildRowColPanel

        private void buildRowColPanel()
        sets up the row and column panel. Displays the current setting of rows and columns in the light box takes input from the text field, radio buttons determine which parameter to be changed modifies the layout of lightbox.
      • buildTSlider

        private void buildTSlider()
        builds the time (4th dimension) slider.
      • buildTSliderLabels

        private void buildTSliderLabels​(int min,
                                        int max)
        builds labels used by the time slider.
        Parameters:
        min - minimum value for the slider
        max - maximum value for the slider
      • checkBSTextField

        private int checkBSTextField()
        check border size of the frame, range (0,10).
        Returns:
        DOCUMENT ME!
      • checkIncrementTextField

        private int checkIncrementTextField()
        check border size of the frame, range (0,10).
        Returns:
        DOCUMENT ME!
      • checkGSTextField

        private int checkGSTextField()
        checks the settings of grid size controls.
        Returns:
        DOCUMENT ME!
      • checkRCTextField

        private int checkRCTextField()
        checks the settings of light box row/column controls.
        Returns:
        DOCUMENT ME!