com.xinapse.multisliceimage
Class ImageSelectionGroupPanel

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.ImageSelectionGroupPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ImageSelectionGroupPanel
extends javax.swing.JPanel

An ImageSelectionGroupPanel allows the selection of a group of MultiSliceImages and contains the mechanism for adding images to the group, removing images from the group, etc. Usually used to select a set of input images for processing.

For an example of the use of a ImageSelectionGroupPanel, see the Image Algebra Tool in Jim.

See Also:
Serialized Form

Nested Class Summary
static interface ImageSelectionGroupPanel.ComponentGenerator
          An interface implemented by classes that want to be able to generate user components to put into an ImageSelectionGroupPanel.
 
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
ImageSelectionGroupPanel()
          Creates a new ImageSelectionGroupPanel with initially one image in the set of images, and a minimum of one image in the set.
ImageSelectionGroupPanel(javax.swing.JFrame parent)
          Creates a new ImageSelectionGroupPanel, that is contained within a parent JFrame, and with initially one image in the set of images, and a minimum of one image in the set.
ImageSelectionGroupPanel(javax.swing.JFrame parent, int minNImages, ImageSelectionGroupPanel.ComponentGenerator componentGenerator, double weight)
          Creates a new ImageSelectionGroupPanel, that is contained within a parent JFrame, and with minimum number and initial number of images in the set given by the argument.
 
Method Summary
 void add()
          Adds another ImageSelectionGroupMemberPanel to this group.
 void addFileChangeCommitListener(javax.swing.event.ChangeListener listener)
           
 void addFileTextEditListener(javax.swing.event.ChangeListener listener)
           
 void clearAllImages()
          Clear all files from this ImageSelectionGroupPanel.
 java.io.File getFile(int index)
          Returns the java.io.File for the ImageSelectionGroupMemberPanel at particular location in the group.
 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.
 int getNImages()
          Returns the number of ImageSelectionGroupMemberPanels in this group.
 java.awt.Component getUserComponent(int i)
           
 java.awt.Component[] getUserComponents()
           
 java.io.File getWorkingDirectory()
          Returns the "current working directory" for this ImageSelectionGroupPanel.
 void removeFileChangeCommitListener(javax.swing.event.ChangeListener listener)
           
 void removeFileTextEditListener(javax.swing.event.ChangeListener listener)
           
 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 setMaxNImages(int max)
           
 void setNImages(int nImages)
          Sets the number of ImageSelectionGroupMemberPanels in this group.
 void setParentFrame(javax.swing.JFrame parent)
          Sets the parent frame for this ImageSelectionGroupPanel.
 
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, getPreferredSize, 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

ImageSelectionGroupPanel

public ImageSelectionGroupPanel()
Creates a new ImageSelectionGroupPanel with initially one image in the set of images, and a minimum of one image in the set.


ImageSelectionGroupPanel

public ImageSelectionGroupPanel(javax.swing.JFrame parent)
Creates a new ImageSelectionGroupPanel, that is contained within a parent JFrame, and with initially one image in the set of images, and a minimum of one image in the set.

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

ImageSelectionGroupPanel

public ImageSelectionGroupPanel(javax.swing.JFrame parent,
                                int minNImages,
                                ImageSelectionGroupPanel.ComponentGenerator componentGenerator,
                                double weight)
Creates a new ImageSelectionGroupPanel, that is contained within a parent JFrame, and with minimum number and initial number of images in the set given by the argument.

Parameters:
parent - the parent JFrame that contains this ImageSelectionGroupPanel. If parent is non-null, it will have its cursor set appropriately when the ImageSelectionGroupPanel is busy.
minNImages - the minimum number of images in the set of images in the group.
Method Detail

getUserComponent

public java.awt.Component getUserComponent(int i)

getUserComponents

public java.awt.Component[] getUserComponents()

addFileChangeCommitListener

public void addFileChangeCommitListener(javax.swing.event.ChangeListener listener)

removeFileChangeCommitListener

public void removeFileChangeCommitListener(javax.swing.event.ChangeListener listener)

addFileTextEditListener

public void addFileTextEditListener(javax.swing.event.ChangeListener listener)

removeFileTextEditListener

public void removeFileTextEditListener(javax.swing.event.ChangeListener listener)

setParentFrame

public void setParentFrame(javax.swing.JFrame parent)
Sets the parent frame for this ImageSelectionGroupPanel.

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

add

public void add()
Adds another ImageSelectionGroupMemberPanel to this group.


setMaxNImages

public void setMaxNImages(int max)

getNImages

public int getNImages()
Returns the number of ImageSelectionGroupMemberPanels in this group.

Returns:
the number of ImageSelectionGroupMemberPanels in this group.

getFile

public java.io.File getFile(int index)
                     throws java.lang.IndexOutOfBoundsException,
                            UnsetFileException
Returns the java.io.File for the ImageSelectionGroupMemberPanel at particular location in the group.

Parameters:
index - the position in the group (indexed from zero).
Returns:
the java.io.File set for the ImageSelectionGroupMemberPanel at the given position.
Throws:
java.lang.IndexOutOfBoundsException - if the index is less than zero or greater than or equal to the number of panels in the group.
UnsetFileException - if no image has been set in the ImageSelectionGroupMemberPanel at the given position.

clearAllImages

public void clearAllImages()
Clear all files from this ImageSelectionGroupPanel. All file fields are set to the current working directory.


getWorkingDirectory

public java.io.File getWorkingDirectory()
Returns the "current working directory" for this ImageSelectionGroupPanel. 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 ImageSelectionGroupPanel.

setImageFilterClass

public 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. 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 first 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 first chooses a new image to set in the panel.

setNImages

public void setNImages(int nImages)
Sets the number of ImageSelectionGroupMemberPanels in this group.

Parameters:
nImages - the number of ImageSelectionGroupMemberPanels to be set for this group.


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