com.metamatrix.toolbox.ui.widget
Class AccumulatorPanel

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.metamatrix.toolbox.ui.widget.DialogPanel
                      extended by com.metamatrix.toolbox.ui.widget.AccumulatorPanel
All Implemented Interfaces:
IconConstants, UIConstants, ButtonConstants, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
ContextsAccumulatorPanel

public class AccumulatorPanel
extends DialogPanel
implements IconConstants

Since:
2.0
Version:
2.1
Author:
John P. A. Verhaeg
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 com.metamatrix.toolbox.ui.IconConstants
ADD_ICON_PROPERTY, ALL_LEFT_ICON_PROPERTY, ALL_RIGHT_ICON_PROPERTY, DELETE_ICON_PROPERTY, DOWN_ICON_PROPERTY, ERROR_ICON_PROPERTY, HEX_ICON_PROPERTY, ICON_PROPERTY_PREFIX, LEFT_ICON_PROPERTY, LOGO_AND_NAME_ICON_PROPERTY, LOGO_ICON_PROPERTY, NOTIFICATION_ICON_PROPERTY, RIGHT_ICON_PROPERTY, SUBTRACT_ICON_PROPERTY, UP_ICON_PROPERTY, WARNING_ICON_PROPERTY
 
Fields inherited from interface com.metamatrix.toolbox.ui.widget.ButtonConstants
ACCEPT_BUTTON, APPLY_BUTTON, BACK_BUTTON, CANCEL_BUTTON, CONTEXT_SENSITIVE_HELP, DEFAULTS_BUTTON, DETAILS_BUTTON, EXIT_BUTTON, FINISH_BUTTON, HELP_BUTTON, LOGIN_BUTTON, NEXT_BUTTON, NO_BUTTON, OVERWRITE_BUTTON, REPLACE_BUTTON, RETRY_BUTTON, SKIP_BUTTON, YES_BUTTON
 
Fields inherited from interface com.metamatrix.toolbox.ui.UIConstants
DATE_FORMAT_PROPERTY, SPACER_HORIZONTAL_LENGTH_PROPERTY, WINDOW_BORDER_PROPERTY
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AccumulatorPanel()
           
AccumulatorPanel(java.util.List initialAvailableValues)
           
AccumulatorPanel(java.util.List initialAvailableValues, java.util.List initialValues)
           
AccumulatorPanel(java.util.List initialAvailableValues, java.util.List initialValues, java.util.Comparator theComparator)
           
AccumulatorPanel(java.util.List initialAvailableValues, java.util.List initialValues, javax.swing.JButton[] additionalButtons, java.util.Comparator theComparator)
           
 
Method Summary
 void addAvailableValue(java.lang.Object value)
           
 void addListDataListener(javax.swing.event.ListDataListener listener)
          Adds the specified ListDataListener to the current values list.
 void addValue(java.lang.Object value)
           
 boolean allowsNewValues()
           
 boolean allowsReorderingValues()
           
 void clearValues()
           
protected  javax.swing.DefaultListModel createAvailableValuesListModel()
           
protected  ListWidget createAvailableValuesListWidget(javax.swing.DefaultListModel model)
           
protected  javax.swing.DefaultListModel createDefaultListModel()
           
protected  ListWidget createDefaultListWidget(javax.swing.DefaultListModel model)
           
protected  LabelWidget createHeader(java.lang.String text)
          Need to eventually break this out into separate method for available vs current
protected  javax.swing.DefaultListModel createValuesListModel()
           
protected  ListWidget createValuesListWidget(javax.swing.DefaultListModel model)
           
 java.util.List getAvailableValues()
           
 LabelWidget getAvailableValuesHeader()
           
 java.util.List getInitialAvailableValues()
           
 java.util.List getInitialValues()
           
 int getMaximumValuesAllowed()
           
 int getMinimumValuesAllowed()
           
 ButtonWidget getResetButton()
           
 java.util.List getValues()
           
protected  java.util.List getValues(javax.swing.DefaultListModel model)
           
 LabelWidget getValuesHeader()
           
protected  void initializeAccumulatorPanel()
           
protected  void maximumValuesAccumulated()
          Called whenever the user double-clicks the mouse on an available value, but the maximum number of accumulated values has already been reached.
protected  void minimumValuesAccumulated()
          Called whenever the user double-clicks the mouse on an accumulated value, but the minimum number of accumulated values has already been reached.
protected  void moveSelectedValuesRight()
           
 void removeAvailableValue(java.lang.Object value)
           
 void removeListDataListener(javax.swing.event.ListDataListener listener)
          Removes the specified ListDataListener from the current values list.
protected  void removeSelectedValues()
           
 void removeValue(java.lang.Object value)
           
 void removeValues(java.lang.Object[] values)
           
protected  void resetLists()
           
 void resetValues()
           
 void setAllowsNewValues(boolean allowsNewValues)
          When allowsNewValues is false, does NOT remove illegal values from initial and current value lists.
 void setAllowsReorderingValues(boolean allowsReorderingValues)
           
 void setAvailableListCellRenderer(javax.swing.ListCellRenderer renderer)
           
 void setAvailableValues(java.util.List values)
           
 void setEnabled(boolean enabled)
           
 void setInitialValues(java.util.List values)
           
 void setMaximumValuesAllowed(int maximum)
           
 void setMinimumValuesAllowed(int minimum)
           
 void setSelectionListCellRenderer(javax.swing.ListCellRenderer renderer)
           
 void setValues(java.util.List values)
           
protected  void updateButtonStatus()
           
 void updateListPreferredSize()
           
protected  void validateValue(java.lang.Object value)
           
 
Methods inherited from class com.metamatrix.toolbox.ui.widget.DialogPanel
accept, addAcceptButton, addAcceptButton, addCancelButton, addCancelButton, addHelpButton, addHelpButton, addNavigationButton, addNavigationButton, addNavigationComponent, addNavigationSpacer, addNavigationSpacer, buildNavigationBar, canAccept, canCancel, cancel, createAcceptButton, createCancelButton, createHelpButton, createNavigationBar, equalizeNavigationButtonWidths, getAcceptButton, getAcceptButtons, getCancelButton, getContent, getContentContainer, getHelpButton, getNavigationBar, getNavigationButton, getNavigationComponent, getNavigationComponentIndex, getSelectedButton, getWindowAncestor, initializeDialogPanel, removeNavigationButton, removeNavigationComponent, removeNavigationSpacer, setCanAccept, setCanCancel, setContent, setLayout, setVisible, validateState, windowActivated, windowAdded
 
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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, 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, 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

AccumulatorPanel

public AccumulatorPanel()
Since:
2.0

AccumulatorPanel

public AccumulatorPanel(java.util.List initialAvailableValues)
Since:
2.0

AccumulatorPanel

public AccumulatorPanel(java.util.List initialAvailableValues,
                        java.util.List initialValues)
Since:
2.0

AccumulatorPanel

public AccumulatorPanel(java.util.List initialAvailableValues,
                        java.util.List initialValues,
                        java.util.Comparator theComparator)
Since:
3.1

AccumulatorPanel

public AccumulatorPanel(java.util.List initialAvailableValues,
                        java.util.List initialValues,
                        javax.swing.JButton[] additionalButtons,
                        java.util.Comparator theComparator)
Since:
4.2
Method Detail

addAvailableValue

public void addAvailableValue(java.lang.Object value)
Since:
2.0

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener listener)
Adds the specified ListDataListener to the current values list.

Parameters:
listener - An implementation of ListDataListener
Since:
2.0

addValue

public void addValue(java.lang.Object value)
Since:
2.0

allowsNewValues

public boolean allowsNewValues()
Since:
2.0

allowsReorderingValues

public boolean allowsReorderingValues()
Since:
2.0

clearValues

public void clearValues()
Since:
2.0

createAvailableValuesListModel

protected javax.swing.DefaultListModel createAvailableValuesListModel()
Since:
2.1

createAvailableValuesListWidget

protected ListWidget createAvailableValuesListWidget(javax.swing.DefaultListModel model)
Since:
2.1

createDefaultListModel

protected javax.swing.DefaultListModel createDefaultListModel()
Since:
2.1

createDefaultListWidget

protected ListWidget createDefaultListWidget(javax.swing.DefaultListModel model)
Since:
2.1

createHeader

protected LabelWidget createHeader(java.lang.String text)
Need to eventually break this out into separate method for available vs current

Since:
2.0

createValuesListModel

protected javax.swing.DefaultListModel createValuesListModel()
Since:
2.1

createValuesListWidget

protected ListWidget createValuesListWidget(javax.swing.DefaultListModel model)
Since:
2.1

getAvailableValues

public java.util.List getAvailableValues()
Since:
2.0

getAvailableValuesHeader

public LabelWidget getAvailableValuesHeader()
Returns:
The header for the available values list
Since:
2.0

getInitialAvailableValues

public java.util.List getInitialAvailableValues()
Since:
2.0

getInitialValues

public java.util.List getInitialValues()
Since:
2.0

getMaximumValuesAllowed

public int getMaximumValuesAllowed()
Returns:
The maximum number of current values allowed
Since:
2.0

getMinimumValuesAllowed

public int getMinimumValuesAllowed()
Returns:
The minimum number of current values allowed
Since:
2.0

getResetButton

public ButtonWidget getResetButton()
Since:
3.1

getValues

public java.util.List getValues()
Since:
2.0

getValues

protected java.util.List getValues(javax.swing.DefaultListModel model)
Since:
2.0

getValuesHeader

public LabelWidget getValuesHeader()
Returns:
The header for the current values list
Since:
2.0

initializeAccumulatorPanel

protected void initializeAccumulatorPanel()
Since:
2.0

maximumValuesAccumulated

protected void maximumValuesAccumulated()
Called whenever the user double-clicks the mouse on an available value, but the maximum number of accumulated values has already been reached. Does nothing by default.

Since:
2.0

minimumValuesAccumulated

protected void minimumValuesAccumulated()
Called whenever the user double-clicks the mouse on an accumulated value, but the minimum number of accumulated values has already been reached. Does nothing by default.

Since:
2.0

moveSelectedValuesRight

protected void moveSelectedValuesRight()
Since:
2.0

removeSelectedValues

protected void removeSelectedValues()
Since:
2.0

removeAvailableValue

public void removeAvailableValue(java.lang.Object value)
Since:
2.0

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener listener)
Removes the specified ListDataListener from the current values list.

Parameters:
listener - An implementation of ListDataListener
Since:
2.0

removeValue

public void removeValue(java.lang.Object value)
Since:
2.0

removeValues

public void removeValues(java.lang.Object[] values)
Since:
2.0

resetValues

public void resetValues()
Since:
2.0

setAllowsNewValues

public void setAllowsNewValues(boolean allowsNewValues)
When allowsNewValues is false, does NOT remove illegal values from initial and current value lists.

Parameters:
allowsNewValues - True if values not in the initial available value list may be added to the value list. Default is false;
Since:
2.0

setAllowsReorderingValues

public void setAllowsReorderingValues(boolean allowsReorderingValues)
Since:
2.0

setAvailableValues

public void setAvailableValues(java.util.List values)
Since:
2.0

setSelectionListCellRenderer

public void setSelectionListCellRenderer(javax.swing.ListCellRenderer renderer)
Since:
3.0

setAvailableListCellRenderer

public void setAvailableListCellRenderer(javax.swing.ListCellRenderer renderer)
Since:
3.0

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class javax.swing.JComponent
Since:
2.1

setInitialValues

public void setInitialValues(java.util.List values)
Since:
2.0

setMaximumValuesAllowed

public void setMaximumValuesAllowed(int maximum)
Since:
2.0

setMinimumValuesAllowed

public void setMinimumValuesAllowed(int minimum)
Since:
2.0

setValues

public void setValues(java.util.List values)
Since:
2.0

resetLists

protected void resetLists()
Since:
3.1

updateButtonStatus

protected void updateButtonStatus()
Since:
2.0

updateListPreferredSize

public void updateListPreferredSize()
Since:
2.0

validateValue

protected void validateValue(java.lang.Object value)
Since:
2.0


Copyright © 2009. All Rights Reserved.