Package gov.nih.mipav.view.dialogs
Class JDialogLightBox
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.dialogs.JDialogBase
-
- gov.nih.mipav.view.dialogs.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) classJDialogLightBox.CancelListenerdoes nothing at the moment.(package private) classJDialogLightBox.OkBgListenerpick up the selected color and call method to change the grid color.(package private) classJDialogLightBox.OkBorderListenerPick up the selected color and change the image border color For use by the color chooser.-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
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
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButtonbackgroundBDOCUMENT ME!private java.awt.ColorbgColorDOCUMENT ME!private javax.swing.JButtonborderBDOCUMENT ME!private java.awt.ColorborderColorDOCUMENT ME!private intborderSizeDOCUMENT ME!private javax.swing.JLabelbordersizeLDOCUMENT ME!private javax.swing.JTextFieldbordersizeTextDOCUMENT ME!private intcolDOCUMENT ME!private javax.swing.JLabelcolLabelDOCUMENT ME!private ViewJColorChoosercolorChooserDOCUMENT ME!private javax.swing.JPanelcolorPanelDOCUMENT ME!private javax.swing.JPanelcolPanelDOCUMENT ME!private javax.swing.JTextFieldcolTextDOCUMENT ME!private java.awt.Fontfont12DOCUMENT ME!private java.awt.Fontfont12BDOCUMENT ME!private ViewJFrameLightBoxframeDOCUMENT ME!private intgridSizeDOCUMENT ME!private javax.swing.JLabelgridsizeLDOCUMENT ME!private javax.swing.JTextFieldgridsizeTextDOCUMENT ME!private intincrementprivate javax.swing.JLabelincrementLabelprivate javax.swing.JTextFieldincrementTextprivate static intINVALID_INPUTDOCUMENT ME!private intlastBorderSizeDOCUMENT ME!private intlastColDOCUMENT ME!private intlastGridSizeDOCUMENT ME!private intlastIncrementprivate intlastRowDOCUMENT ME!private booleanlastRowBFlagDOCUMENT ME!private floatmagnificationDOCUMENT ME!private javax.swing.JWindowmagniWindowDOCUMENT ME!private javax.swing.JSlidermagSliderDOCUMENT ME!private java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>magSliderDictionaryDOCUMENT ME!private javax.swing.JPanelmagSliderPanelDOCUMENT ME!private javax.swing.JPanelpanelRowColumnDOCUMENT ME!private javax.swing.JRadioButtonradioColumnDOCUMENT ME!private javax.swing.JRadioButtonradioRowDOCUMENT ME!private javax.swing.JButtonresetButtonDOCUMENT ME!private introwDOCUMENT ME!private booleanrow_dependentDOCUMENT ME!private booleanrowBFlagvalues obtained from settings.private javax.swing.JLabelrowLabelDOCUMENT ME!private javax.swing.JPanelrowPanelDOCUMENT ME!private javax.swing.JTextFieldrowTextDOCUMENT ME!private static intSAME_INPUTDOCUMENT ME!private static longserialVersionUIDUse serialVersionUID for interoperability.private javax.swing.JLabeltoolTipDOCUMENT ME!private javax.swing.JSlidertSliderDOCUMENT ME!private java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>tSliderDictionaryDOCUMENT ME!private javax.swing.JPaneltSliderPanelDOCUMENT ME!private static intVALID_INPUTdefinitions indicating that user input has been validated.-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JDialogLightBox(ViewJFrameLightBox _frame)constructs new control dialog of the Lightbox View.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)DOCUMENT ME!private voidbuildColorPanel()builds the controls to set the color of the border the and color of the background.voidbuildDialog()setup the lightbox's control dialog.private voidbuildMagSlider()builds the image magnification slider.private voidbuildMagSliderLabels(float min, float max)builds labels used by the magnification slider.private voidbuildRowColPanel()sets up the row and column panel.private voidbuildTSlider()builds the time (4th dimension) slider.private voidbuildTSliderLabels(int min, int max)builds labels used by the time slider.private intcheckBSTextField()check border size of the frame, range (0,10).private intcheckGSTextField()checks the settings of grid size controls.private intcheckIncrementTextField()check border size of the frame, range (0,10).private intcheckRCTextField()checks the settings of light box row/column controls.voidresetValues()Resets the values to match the current lightbox.voidsetTSlider(int tSlice)method to set the time (4th dimension) slider if it exists.voidsetValues(boolean row_dependent, int row, int col)method to set the row, col, and row_dependent values.voidstateChanged(javax.swing.event.ChangeEvent e)sets values based on knob along slider.-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
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
-
-
-
-
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!
-
colorChooser
private ViewJColorChooser colorChooser
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!
-
frame
private ViewJFrameLightBox frame
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:
actionPerformedin interfacejava.awt.event.ActionListener- Overrides:
actionPerformedin classJDialogBase- 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:
stateChangedin interfacejavax.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 slidermax- 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 slidermax- 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!
-
-