com.xinapse.multisliceimage
Class MultipleImageSelectionPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.xinapse.multisliceimage.MultipleImageSelectionPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class MultipleImageSelectionPanel
extends javax.swing.JPanel

A MultipleImageSelectionPanel shows a list of MultiSliceImage files, and contains the mechanism for selecting a new list of images, adding images to the list, removing images from the list, and changing the order of images in the list.
As images are added to the list, the list is sorted lexically. Usually used to select a set of input images for processing.

For an example of the use of a MultipleImageSelectionPanel, see the Perfusion/Permeability Tool in Jim.

See Also:
Serialized Form

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
 
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
MultipleImageSelectionPanel()
          Creates a new MultipleImageSelectionPanel with an empty list of images.
MultipleImageSelectionPanel(java.awt.Component parent)
          Creates a new MultipleImageSelectionPanel, that is contained within a parent Component, and with an empty list of images.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Add a ChangeListener to this MultipleImageSelectionPanel.
 void addFiles(java.util.List<java.io.File> files)
          Add a List of Files to this MultipleImageSelectionPanel.
 void clearFiles()
           
 java.io.File getFile(int index)
          Returns the java.io.File for the MultipleImageSelectionMemberPanel at particular location in the list of images.
 java.io.File[] getFiles()
          Returns an array of java.io.File with each array member being a file currently set in the MultipleImageSelectionMemberPanel.
 java.lang.Class getImageFilterClass()
          Returns the class of image that will be filtered when the user chooses a new image to set in the panel.
 int getNImages()
          Returns the number of images currently set in this MultipleImageSelectionMemberPanel.
 java.awt.Dimension getPreferredSize()
          Override the default getPreferredSize() method.
 java.lang.String getTitle()
          Returns the title for the list of images.
 java.io.File getWorkingDirectory()
          Returns the "current working directory" for this MultipleImageSelectionPanel.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Remove a ChangeListener from this MultipleImageSelectionPanel.
 void setImageFilterClass(java.lang.Class c)
          Sets the class of image that will be filtered when the user chooses a new image to set in the panel.
 void setParentFrame(java.awt.Component parent)
          Sets the parent Component for this MultipleImageSelectionPanel.
 void setTitle(java.lang.String title)
          Sets the title for the list of images.
 
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, setEnabled, 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
 

Constructor Detail

MultipleImageSelectionPanel

public MultipleImageSelectionPanel()
Creates a new MultipleImageSelectionPanel with an empty list of images.


MultipleImageSelectionPanel

public MultipleImageSelectionPanel(java.awt.Component parent)
Creates a new MultipleImageSelectionPanel, that is contained within a parent Component, and with an empty list of images.

Parameters:
parent - the parent Component that contains this MultipleImageSelectionPanel. If parent is non-null, it will have its cursor set appropriately when the MultipleImageSelectionPanel is busy.
Method Detail

setParentFrame

public void setParentFrame(java.awt.Component parent)
Sets the parent Component for this MultipleImageSelectionPanel.

Parameters:
parent - the parent Component that contains this MultipleImageSelectionPanel. If parent is non-null, it will have its cursor set appropriately when the MultipleImageSelectionPanel is busy.

getNImages

public int getNImages()
Returns the number of images currently set in this MultipleImageSelectionMemberPanel.

Returns:
the number of images currently set in this MultipleImageSelectionMemberPanel.

getFile

public java.io.File getFile(int index)
                     throws java.lang.IndexOutOfBoundsException
Returns the java.io.File for the MultipleImageSelectionMemberPanel at particular location in the list of images.

Parameters:
index - the position in the list (indexed from zero).
Returns:
the java.io.File set for the MultipleImageSelectionMemberPanel at the given position.
Throws:
java.lang.IndexOutOfBoundsException - if the index is less than zero or greater than or equal to the number of images in the list.

getFiles

public java.io.File[] getFiles()
Returns an array of java.io.File with each array member being a file currently set in the MultipleImageSelectionMemberPanel.

Returns:
an array of java.io.File, one array element for each file set in the MultipleImageSelectionMemberPanel. Returns null if there are are no images currently set.

getWorkingDirectory

public java.io.File getWorkingDirectory()
Returns the "current working directory" for this MultipleImageSelectionPanel. When the user chooses a new image to set in the panel, the ImageFileChooser used to select the image starts with the directory set to the current working directory. When the user, using the ImageFileChooser, moves to a different directory, the current working directory is set to the new directory.

Returns:
the current working directory for this MultipleImageSelectionPanel.

setImageFilterClass

public void setImageFilterClass(java.lang.Class c)
Sets the class of image that will be filtered when the user chooses a new image to set in the panel. The ImageFileChooser used to select the image starts with the correct image filter set.

Parameters:
c - the class of a valid image type to filter, e.g. com.xinapse.multisliceimage.UNC.UNCImage.

getImageFilterClass

public java.lang.Class getImageFilterClass()
Returns the class of image that will be filtered when the user chooses a new image to set in the panel. The ImageFileChooser used to select the image starts with the correct image filter set.

Returns:
the class of image that will be filtered when the user chooses a new image to set in the panel.

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Add a ChangeListener to this MultipleImageSelectionPanel. All listeners are notified with a ChangeEvent when the image file is changed by the user. The image file is changed either by the user pressing the button and selecting a new file via the ImageFileChooser, or by the user editing the folder or file text (after pressing carriage return).

Parameters:
l - the listener to be added.

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove a ChangeListener from this MultipleImageSelectionPanel.

Parameters:
l - the listener to be removed.

getTitle

public java.lang.String getTitle()
Returns the title for the list of images. The title appears just above the list.

Returns:
the current title for the list, or null if there is no title.

setTitle

public void setTitle(java.lang.String title)
Sets the title for the list of images. The title appears just above the list.

Parameters:
title - the new title for the list. If title is null, then no title is shown.

clearFiles

public void clearFiles()

getPreferredSize

public java.awt.Dimension getPreferredSize()
Override the default getPreferredSize() method. We don't want the MultipleImageSelectionPanel to resize itsself when files with long names are selected and the Component in which this component is embedded is packed(). Once the initial size has been set (and is non-zero), then this component will always have the same preferred size.

Overrides:
getPreferredSize in class javax.swing.JComponent

addFiles

public void addFiles(java.util.List<java.io.File> files)
Add a List of Files to this MultipleImageSelectionPanel.

Parameters:
files - the java.util.List of Files to add.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.