|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.xinapse.multisliceimage.ImageSelectionPanel
public class ImageSelectionPanel
An ImageSelectioPanel is a javax.swing.JPanel that can be used to select a MultiSliceImage for input. The MultiSliceImage file can be selected either by pressing a button (with an icon on it) and selecting the file via an ImageFileChooser, or by editing the text fields that select the directory (folder) and file name.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| 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 |
| Field Summary | |
|---|---|
protected ImageFileChooser |
imageChooser
The ImageFileChooser that can be popped up to select a new image. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ImageSelectionPanel()
Creates new ImageSelectionPanel, with the default Folder set to the System Property user.dir. |
|
ImageSelectionPanel(boolean acceptDicom)
Creates new ImageSelectionPanel, with the default Folder set to the System Property user.dir. |
|
ImageSelectionPanel(boolean oneLine,
boolean acceptDicom)
Creates new ImageSelectionPanel, with the default Folder set to the System Property user.dir, and with the image file selection field on only one line. |
|
ImageSelectionPanel(java.io.File f,
java.lang.Class imageClassToFilter,
boolean acceptDicom)
Creates new ImageSelectionPanel, with the default Folder given by argument. |
|
ImageSelectionPanel(java.io.File f,
java.lang.Class imageClassToFilter,
boolean oneLine,
boolean acceptDicom)
Creates new ImageSelectionPanel, with the default Folder given by argument, and with the image file selection field on only one line. |
|
| Method Summary | |
|---|---|
void |
addFileChangeCommitListener(javax.swing.event.ChangeListener l)
Add a ChangeListener to this ImageSelectionPanel. |
void |
addFileTextEditListener(javax.swing.event.ChangeListener l)
Add a ChangeListener to this ImageSelectionPanel. |
java.io.File |
getFile()
Returns the java.io.File that has been set in this ImageSelectionPanel. |
java.lang.Class |
getImageFilterClass()
Returns the class of image that will be filtered when the user first chooses a new image to set in the panel. |
java.awt.Dimension |
getPreferredSize()
Override the default getPreferredSize() method. |
java.io.File |
getWorkingDirectory()
Returns the "current working directory" for this ImageSelectionPanel. |
void |
removeFileChangeCommitListener(javax.swing.event.ChangeListener l)
Remove a ChangeListener from this ImageSelectionPanel. |
void |
removeFileTextEditListener(javax.swing.event.ChangeListener l)
Remove a ChangeListener from this ImageSelectionPanel. |
void |
setEditable(boolean editable)
Sets whether text for folder/file selection is editable. |
void |
setEnabled(boolean b)
Enables or disables this ImageSelectionPanel, depending on the value of the parameter b. |
void |
setFile(java.io.File f)
Sets the file in this ImageSelectionPanel to the specified file. |
void |
setFileLabel(java.lang.String label)
Sets the label for the file selection text field. |
void |
setFileText(java.lang.String text)
Sets the text for the file selection text field. |
void |
setFileToolTipText(java.lang.String text)
Sets the tool tip text for the file selection text field. |
void |
setFolderLabel(java.lang.String label)
Sets the label for the folder selection text field. |
void |
setFolderText(java.lang.String text)
Sets the text for the folder selection text field. |
void |
setFolderToolTipText(java.lang.String text)
Sets the tool tip text for the folder selection text field. |
void |
setImageButtonToolTipText(java.lang.String text)
Sets the tool tip text for the button that pops up an ImageFileChooser to select the image. |
void |
setImageFilterClass(java.lang.Class c)
Sets the class of image that will be filtered when the user first chooses a new image to set in the panel. |
void |
setWorkingDirectory(java.io.File f)
Sets the "current working directory" for this ImageSelectionPanel. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected ImageFileChooser imageChooser
| Constructor Detail |
|---|
public ImageSelectionPanel()
public ImageSelectionPanel(boolean acceptDicom)
acceptDicom - whether to allow selection of DICOM image files.
public ImageSelectionPanel(boolean oneLine,
boolean acceptDicom)
oneLine - if the ImageSelectionPanel is to appear on only one line.
public ImageSelectionPanel(java.io.File f,
java.lang.Class imageClassToFilter,
boolean acceptDicom)
f - used to set the default folder for the image. If f is a directory,
then the default folder is set to f. If f is a regular file, the the
default folder is set to the parent directory of f. If f is null,
then the default folder is set to the System Property user.dir.imageClassToFilter - the Class of the image
(e.g. com.xinapse.multisliceimage.UNC.UNCImage.class) that will be the default image
type to filter on.acceptDicom - whether to allow selection of DICOM image files.
public ImageSelectionPanel(java.io.File f,
java.lang.Class imageClassToFilter,
boolean oneLine,
boolean acceptDicom)
f - used to set the default folder for the image. If f is a directory,
then the default folder is set to f. If f is a regular file, the the
default folder is set to the parent directory of f. If f is null,
then the default folder is set to the System Property user.dir.imageClassToFilter - the Class of the image
(e.g. com.xinapse.multisliceimage.UNC.UNCImage.class) that will be the default image
type to filter on.oneLine - if the ImageSelectionPanel is to appear on only one line.acceptDicom - whether to allow selection of DICOM image files.| Method Detail |
|---|
public void setFile(java.io.File f)
f - the file to set.public void setWorkingDirectory(java.io.File f)
f - if a directory, the current working directory is set to f; if a regular file,
the current working directory is set to the directory containing f. If f is null, the
current working directory is set to null.public java.io.File getWorkingDirectory()
public void setImageFilterClass(java.lang.Class c)
c - the class of a valid image type to filter,
e.g. com.xinapse.multisliceimage.UNC.UNCImage.class.public java.lang.Class getImageFilterClass()
public void setEnabled(boolean b)
setEnabled in class javax.swing.JComponentb - if true, this ImageSelectionPanel is enabled; otherwise
it is disabled.
public java.io.File getFile()
throws UnsetFileException
UnsetFileException - if no File has been set.public void setImageButtonToolTipText(java.lang.String text)
text - the tool tip text for the set image button.public void setFileLabel(java.lang.String label)
label - the label for the file selection text field.public void setFolderLabel(java.lang.String label)
label - the label for the folder selection text field.public void setFileToolTipText(java.lang.String text)
text - the tool tip text for the file selection text field.public void setFolderToolTipText(java.lang.String text)
text - the tool tip text for the folder selection text field.public void setFileText(java.lang.String text)
text - the text for the file selection text field.public void setFolderText(java.lang.String text)
text - the text for the folder selection text field.public void setEditable(boolean editable)
editable - if true then the text fields will be editable; not editable
otherwise.public void addFileChangeCommitListener(javax.swing.event.ChangeListener l)
l - the listener to be added.public void removeFileChangeCommitListener(javax.swing.event.ChangeListener l)
l - the listener to be removed.public void addFileTextEditListener(javax.swing.event.ChangeListener l)
l - the listener to be added.public void removeFileTextEditListener(javax.swing.event.ChangeListener l)
l - the listener to be removed.public java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||