Package gov.nih.mipav.view.dialogs
Class JDialogDicomDir
- 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.JDialogDicomDir
-
- All Implemented Interfaces:
DialogDefaultsInterface,PreviewImageContainer,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.event.TreeSelectionListener,javax.swing.RootPaneContainer,javax.swing.WindowConstants
public class JDialogDicomDir extends JDialogBase implements java.awt.event.ActionListener, java.awt.event.ItemListener, javax.swing.event.TreeSelectionListener, javax.swing.event.ChangeListener, PreviewImageContainer
Simple dialog used to show the contents of a selected DICOMDIR file. Allows the user to view previews of the image, related tags, along with opening the image.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 (package private) javax.swing.tree.DefaultMutableTreeNodebaseprivate intbrightnessDOCUMENT ME!private javax.swing.JPanelbrightPanelDOCUMENT ME!private javax.swing.JSliderbrightSliderDOCUMENT ME!private javax.swing.JPanelbuttonPanelDOCUMENT ME!private floatcontrastDOCUMENT ME!private javax.swing.JSlidercontSliderDOCUMENT ME!private javax.swing.JLabelcurrentDOCUMENT ME!private javax.swing.JLabelcurrent2DOCUMENT ME!protected java.awt.DimensionDEFAULT_SIZEDescribes the initial size of the textual display area when the dialog is created.private java.awt.DimensiondefaultImageSizeDOCUMENT ME!private FileInfoDicomdicomInfoprivate FileDicomSQdirInfostatic java.lang.String[]dpColumnNamesColumn names for data provenanceprivate java.io.Filefileprivate booleanifSuccess(package private) javax.swing.JPanelimagePanelprivate javax.swing.JSplitPaneimageSliderPaneDOCUMENT ME!(package private) ViewJComponentPreviewImageimgprivate java.text.NumberFormatnfcDOCUMENT ME!(package private) FileDicomopenerprivate intorigBrightnessDOCUMENT ME!private floatorigContrastDOCUMENT ME!private javax.swing.JScrollPanescrollPaneDOCUMENT ME!private static longserialVersionUIDUse serialVersionUID for interoperability.protected java.awt.Fontserif12DOCUMENT ME!protected java.awt.Fontserif12BDOCUMENT ME!private javax.swing.JPanelsliderPanelDOCUMENT ME!private ViewTableModeltagViewerThe table modelprotected FileImageXML.ThumbnailthumbnailDOCUMENT ME!private JTreeDICOMtree-
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, 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 JDialogDicomDir(java.awt.Frame parent)Default constructor for DICOMDIRJDialogDicomDir(java.awt.Frame parent, java.io.File file, FileDicom caller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)Closes dialog box when the "Close" button is pressed.private voidbuildBrightContPanel()Initializes GUI components and displays dialog.protected FileInfoBasebuildImage(java.lang.String fileName, java.lang.String directory)Opens preview of image in frameprivate javax.swing.JSplitPanebuildImagePanel()private voidcreateNodes()Creates nodes on the tree based on DICOMDIRjava.awt.DimensiongetPanelSize()The method returns the size of the panel into which the ViewJComponentPreviewImage will be drawing itself.private voidinit(java.lang.String title)Initializes the dialog box to a certain size and adds the components.private voidopen()Open new DICOMDIR file, if successful then close current boxprivate voidopenImage()voidstateChanged(javax.swing.event.ChangeEvent e)Updates the image based on thumbnailsvoidvalueChanged(javax.swing.event.TreeSelectionEvent e)Updates the table based on tree selectionbooleanwasSuccess()-
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
-
dpColumnNames
public static final java.lang.String[] dpColumnNames
Column names for data provenance
-
DEFAULT_SIZE
protected final java.awt.Dimension DEFAULT_SIZE
Describes the initial size of the textual display area when the dialog is created. The value is given in pixel size rather than the number of characters since the display area has no characters to display.
-
origBrightness
private int origBrightness
DOCUMENT ME!
-
origContrast
private float origContrast
DOCUMENT ME!
-
buttonPanel
private javax.swing.JPanel buttonPanel
DOCUMENT ME!
-
scrollPane
private javax.swing.JScrollPane scrollPane
DOCUMENT ME!
-
ifSuccess
private boolean ifSuccess
-
imagePanel
javax.swing.JPanel imagePanel
-
img
ViewJComponentPreviewImage img
-
tagViewer
private ViewTableModel tagViewer
The table model
-
tree
private JTreeDICOM tree
-
brightPanel
private javax.swing.JPanel brightPanel
DOCUMENT ME!
-
serif12
protected java.awt.Font serif12
DOCUMENT ME!
-
serif12B
protected java.awt.Font serif12B
DOCUMENT ME!
-
brightSlider
private javax.swing.JSlider brightSlider
DOCUMENT ME!
-
contSlider
private javax.swing.JSlider contSlider
DOCUMENT ME!
-
imageSliderPane
private javax.swing.JSplitPane imageSliderPane
DOCUMENT ME!
-
defaultImageSize
private java.awt.Dimension defaultImageSize
DOCUMENT ME!
-
current
private javax.swing.JLabel current
DOCUMENT ME!
-
current2
private javax.swing.JLabel current2
DOCUMENT ME!
-
sliderPanel
private javax.swing.JPanel sliderPanel
DOCUMENT ME!
-
nfc
private java.text.NumberFormat nfc
DOCUMENT ME!
-
thumbnail
protected FileImageXML.Thumbnail thumbnail
DOCUMENT ME!
-
contrast
private float contrast
DOCUMENT ME!
-
brightness
private int brightness
DOCUMENT ME!
-
base
javax.swing.tree.DefaultMutableTreeNode base
-
dirInfo
private FileDicomSQ dirInfo
-
dicomInfo
private FileInfoDicom dicomInfo
-
opener
FileDicom opener
-
file
private java.io.File file
-
-
Constructor Detail
-
JDialogDicomDir
public JDialogDicomDir(java.awt.Frame parent)
Default constructor for DICOMDIR
-
JDialogDicomDir
public JDialogDicomDir(java.awt.Frame parent, java.io.File file, FileDicom caller)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Closes dialog box when the "Close" button is pressed. Opens either a new file or selected images based on button.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- Event that triggers this function.
-
openImage
private void openImage()
-
init
private void init(java.lang.String title)
Initializes the dialog box to a certain size and adds the components.- Parameters:
title- Title of the dialog box.
-
createNodes
private void createNodes()
Creates nodes on the tree based on DICOMDIR
-
open
private void open()
Open new DICOMDIR file, if successful then close current box
-
buildImage
protected FileInfoBase buildImage(java.lang.String fileName, java.lang.String directory)
Opens preview of image in frame
-
buildBrightContPanel
private void buildBrightContPanel()
Initializes GUI components and displays dialog.For the brightSlider the slider values and the brightness values are identical. brightness is an offset going from -255 to 255. This is enough to change all 0 values to 255 and all 255 values to 0. brightness is added to all contrast scaled red, green, and blue.
However, for the contrastSlider the slider values are different from the contrast values. The contrast values go from 0.1 to 10.0 while the slider values go from -200 to 200. contrast = (float)Math.pow(10.0,contSlider.getValue()/200.0) The original red, green, and blue are mutliplied by contrast.
-
valueChanged
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
Updates the table based on tree selection- Specified by:
valueChangedin interfacejavax.swing.event.TreeSelectionListener
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent e)
Updates the image based on thumbnails- Specified by:
stateChangedin interfacejavax.swing.event.ChangeListener
-
getPanelSize
public java.awt.Dimension getPanelSize()
Description copied from interface:PreviewImageContainerThe method returns the size of the panel into which the ViewJComponentPreviewImage will be drawing itself. It needs the Dimension so that it knows how large to scale.- Specified by:
getPanelSizein interfacePreviewImageContainer- Returns:
- Dimension
-
buildImagePanel
private javax.swing.JSplitPane buildImagePanel()
-
wasSuccess
public boolean wasSuccess()
-
-