com.sas.visuals
Class DualSelector

com.sas.visuals.DualSelector
All Implemented Interfaces:
CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.collection.ContentsChangedListener, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, ValidatorInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class DualSelector
implements java.awt.event.ActionListener, java.awt.event.ItemListener, com.sas.collection.ContentsChangedListener

DualSelector is a class used for manipulating items between two lists. Items are initially in one (or two) ListBoxes and are moved within or tranferred between each of the Listboxes. When items are moved between Listboxes, either all of the items can be moved at once, or only selected items can be moved. Furthermore, restrictions can be placed on the number of items that are allowed in each Listbox.

Creation:

  1. Create a DualSelector

    DualSelector dualSelector1 = new DualSelector();
    dualSelector1.initialize();

Default Size:
Required Interfaces:
DualSelector requires a model that implements the com.sas.collection.StaticOrderedCollectionInterface interface.

Events:
DualSelector fires PropertyChangeEvents whenever any of its properties change.

Notes:

See Also:
StaticOrderedCollectionInterface, OrderedCollectionInterface, TransformInterface, Serialized Form

Field Summary
protected  PushButton allLeftButton
          PushButton used to transfer all items from list two to list one.
protected  PushButton allRightButton
          PushButton used to transfer all items from list one to list two.
protected  PushButton alternatingButton
          PushButton used to transfer one or more items between lists.
protected  PushButton down1Button
          PushButton used to move items down in list one when reordering.
protected  PushButton down2Button
          PushButton used to move items down in list two when reordering.
protected  Label label1
          Label for the first list.
protected  Label label2
          Label for the second list.
protected  ListBox listBox1
          ListBox for the first list.
protected  ListBox listBox2
          ListBox for the second list.
protected  PushButton up1Button
          PushButton used to move items up in list one when reordering.
protected  PushButton up2Button
          PushButton used to move items up in list two when reordering.
 
Constructor Summary
DualSelector()
          Constructs a DualSelector object.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called whenever one of the buttons has been clicked and performs an action based on whichever button was clicked.
 void attachModel(com.sas.ModelInterface mi)
          Attaches a model supporting the required interface to a DualSelector.
 java.awt.Dimension computePreferredSize()
          Computes the preferred size.
 void contentsChanged(com.sas.collection.ContentsChangedEvent event)
          Event handler for the ContentsChangedEvents received from the models.
 void detachModel(com.sas.ModelInterface mi)
          Detaches an attached model.
 int dragOver(java.awt.Point point, int representation, int keyState, java.util.Vector data)
          Override the dragOver method of com.sas.awt.Panel.
static int getDefaultHeight()
          Returns the default height in pixels
static int getDefaultWidth()
          Returns the default width in pixels
 com.sas.util.transforms.TransformInterface getDisplayTransform()
          Returns the display transform.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about a DualSelector.
 int getList1Count()
          Returns the number of items in list 1.
 com.sas.util.transforms.TransformInterface getList1DisplayTransform()
          Returns the display transform for list 1.
 com.sas.collection.StaticOrderedCollectionInterface getList1Items()
          Returns a copy of the items in list 1.
 java.lang.String getList1Label()
          Returns the value of list 1's label.
 int getList1MaximumCount()
          Returns the value of the list1MaximumCount property.
 int getList2Count()
          Returns the number of items in list 2.
 com.sas.util.transforms.TransformInterface getList2DisplayTransform()
          Returns the display transform for list 2.
 com.sas.collection.StaticOrderedCollectionInterface getList2Items()
          Returns a copy of the items in list 2.
 java.lang.String getList2Label()
          Returns the value of list 2's label.
 int getList2MaximumCount()
          Returns the value of the list2MaximumCount property.
 com.sas.ModelInterface getList2ModelInterface()
          Returns the ModelInterface for list 2.
 java.awt.Dimension getMinimumSize()
          Returns the minimum size.
 java.util.Vector getRequiredInterfaces()
          Returns the required interfaces Vector for this component.
 boolean isDynamic()
          Returns the value of the dynamic property.
 boolean isList1ControlsVisible()
          Returns the value of the list1ControlsVisible property.
 boolean isList2ControlsVisible()
          Returns the value of the list2ControlsVisible property.
 boolean isModelEventsIgnored()
          Returns the value of the modelEventsIgnored property.
 boolean isTransferAllControlsVisible()
          Returns the value of the transferAllControlsVisible property.
 void itemStateChanged(java.awt.event.ItemEvent ie)
          Event handler for the ItemEvent's received.
 void moveList1ItemDown()
          Moves the selected item(s) in list 1 down one position.
 void moveList1ItemUp()
          Moves the selected item(s) in list 1 up one position.
 void moveList2ItemDown()
          Moves the selected item(s) in list 2 down one position.
 void moveList2ItemUp()
          Moves the selected item(s) in list 2 up one position.
protected  void moveListItem(com.sas.collection.OrderedCollectionInterface list, boolean moveItemUp)
          Moves the selected item or items in list either up or down one position.
 void refresh()
          Signals the DualSelector selector to refresh its data from its models.
 void refresh(com.sas.ModelInterface mi)
          Signals the DualSelector selector to refresh its data from the specified model.
 void setBackground(java.awt.Color color)
          Overrides setBackground in java.awt.Component.
static void setDefaultHeight(int newValue)
          Sets the default height in pixels
 void setDefaultValues()
          Creates the components and sets the default values for the DualSelector.
static void setDefaultWidth(int newValue)
          Sets the default width in pixels.
 void setDisplayTransform(com.sas.util.transforms.TransformInterface newValue)
          Sets the display transform.
 void setDynamic(boolean newValue)
          Sets the value of the dynamic property.
 void setFont(java.awt.Font font)
          Overrides super.setFont.
 void setForeground(java.awt.Color color)
          Overrides setForeground in java.awt.Component.
 void setList1ControlsVisible(boolean newValue)
          Sets the value of the list1ControlsVisible property.
 void setList1DisplayTransform(com.sas.util.transforms.TransformInterface newValue)
          Sets the display transform for list 1.
 void setList1Label(java.lang.String newValue)
          Sets the value of list 1's label.
 void setList1MaximumCount(int newValue)
          Sets the value of the list1MaximumCount property.
 void setList2ControlsVisible(boolean newValue)
          Sets the value of the list2ControlsVisible property.
 void setList2DisplayTransform(com.sas.util.transforms.TransformInterface newValue)
          Sets the display transform for list 2.
 void setList2Label(java.lang.String newValue)
          Set the value of list 2's label.
 void setList2MaximumCount(int newValue)
          Sets the value of the list2MaximumCount property.
 void setList2ModelInterface(com.sas.ModelInterface mi)
          Sets the ModelInterface for list 2.
 void setModelEventsIgnored(boolean newValue)
          Sets the value of the modelEventsIgnored property.
 void setModelInterface(com.sas.ModelInterface mi)
          Sets the models interface for list 1.
 void setTransferAllControlsVisible(boolean newValue)
          Sets the value of the transferAllControlsVisible property.
protected  void transferAllItems(com.sas.collection.OrderedCollectionInterface fromList, com.sas.collection.OrderedCollectionInterface toList)
          Transfers all of the items from fromList to toList.
 void transferAllList1Items()
          Transfer all items from list 1 to list 2.
 void transferAllList2Items()
          Transfer all items from list 2 to list 1.
 void transferList1Items()
          Transfer all the selected items from list 1 to list 2.
 void transferList2Items()
          Transfer all the selected items from list 2 to list 1.
protected  void transferListItems(com.sas.collection.OrderedCollectionInterface fromList, com.sas.collection.OrderedCollectionInterface toList)
          Transfer all selected items from fromList to toList.
 
Methods inherited from class com.sas.awt.Panel
remove, remove, removeAll
 
Methods inherited from class com.sas.awt.PanelContainerComponent
addNotify, clone, dragEnter, dragLeave, drop, getContainerInterfaceSupportInfo, getErrorHandler, getInsets, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.PanelVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachView, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, paint, print, printFinalize, printInitialize, propertyChange, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setEnabled, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getPreferredSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBackgroundColor, setBorder, setBounds, setEnabled, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate
 

Field Detail

label1

protected Label label1
Label for the first list.


label2

protected Label label2
Label for the second list.


listBox1

protected ListBox listBox1
ListBox for the first list.


listBox2

protected ListBox listBox2
ListBox for the second list.


alternatingButton

protected PushButton alternatingButton
PushButton used to transfer one or more items between lists.


allRightButton

protected PushButton allRightButton
PushButton used to transfer all items from list one to list two.


allLeftButton

protected PushButton allLeftButton
PushButton used to transfer all items from list two to list one.


down1Button

protected PushButton down1Button
PushButton used to move items down in list one when reordering.


down2Button

protected PushButton down2Button
PushButton used to move items down in list two when reordering.


up1Button

protected PushButton up1Button
PushButton used to move items up in list one when reordering.


up2Button

protected PushButton up2Button
PushButton used to move items up in list two when reordering.

Constructor Detail

DualSelector

public DualSelector()
Constructs a DualSelector object.

Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about a DualSelector.

Returns:
the ExtendedBeanInfo for this class

getDefaultWidth

public static int getDefaultWidth()
Returns the default width in pixels

Returns:
the default width in pixels

setDefaultWidth

public static void setDefaultWidth(int newValue)
Sets the default width in pixels.

Parameters:
newValue - the new default width in pixels

getDefaultHeight

public static int getDefaultHeight()
Returns the default height in pixels

Returns:
the default height in pixels

setDefaultHeight

public static void setDefaultHeight(int newValue)
Sets the default height in pixels

Parameters:
newValue - the default height in pixels

getDisplayTransform

public com.sas.util.transforms.TransformInterface getDisplayTransform()
Returns the display transform. The display transform is used for both ListBoxes to transform the data prior to it being displayed

Returns:
the display transform
See Also:
setDisplayTransform(com.sas.util.transforms.TransformInterface)

setDisplayTransform

public void setDisplayTransform(com.sas.util.transforms.TransformInterface newValue)
Sets the display transform. The same display transform is used for both ListBoxes when set with this method.

Parameters:
newValue - the new value for the display transform property
See Also:
getDisplayTransform()

isDynamic

public boolean isDynamic()
Returns the value of the dynamic property. If the DualSelector is dynamic, then any changes in the DualSelector will also be made in the models if both of the models are instances of com.sas.collection.OrderedCollectionInterface. Otherwise, copies of the models will be made and only these copies will be modified.

Returns:
true if the DualSelector is dynamic, false otherwise.
See Also:
setDynamic(boolean)

setDynamic

public void setDynamic(boolean newValue)
Sets the value of the dynamic property. If the DualSelector is dynamic, then any changes in the DualSelector will also be made in the models if both of the models are instances of com.sas.collection.OrderedCollectionInterface. Otherwise, copies of the models will be made and only these copies will be modified.

Parameters:
dynamic - the new value of the dynamic property
Throws:
java.lang.IllegalStateException - if dynamic is set to true and the models do not support OrderedCollectionInterface
See Also:
isDynamic()

isList1ControlsVisible

public boolean isList1ControlsVisible()
Returns the value of the list1ControlsVisible property. The list1ControlsVisible property controls whether the buttons that allow list 1 to be reordered are visible beneath the ListBox that displays the items of list 1.

Returns:
true if the controls for list 1 are visible, false otherwise.
See Also:
setList1ControlsVisible(boolean)

setList1ControlsVisible

public void setList1ControlsVisible(boolean newValue)
Sets the value of the list1ControlsVisible property. The list1ControlsVisible property controls whether the buttons that allow list 1 to be reordered are visible beneath the ListBox that displays the items of list 1.

Parameters:
newValue - the new value of the list1ControlsVisible property
See Also:
isList1ControlsVisible()

getList1Count

public int getList1Count()
Returns the number of items in list 1.

Returns:
the number of items in list 1.

getList1DisplayTransform

public com.sas.util.transforms.TransformInterface getList1DisplayTransform()
Returns the display transform for list 1. The display transform controls how the items in list 1 are displayed. It transforms each item into an appropriate representation for display.

Returns:
display transform for list 1
See Also:
setList1DisplayTransform(com.sas.util.transforms.TransformInterface)

setList1DisplayTransform

public void setList1DisplayTransform(com.sas.util.transforms.TransformInterface newValue)
Sets the display transform for list 1. The display transform controls how the items in list 1 are displayed. It transforms each item into an appropriate representation for display.

Parameters:
newValue - the new value for the list 1 display transform
See Also:
getList1DisplayTransform()

getList1Items

public com.sas.collection.StaticOrderedCollectionInterface getList1Items()
Returns a copy of the items in list 1.

Returns:
a copy of the items in list 1

getList1Label

public java.lang.String getList1Label()
Returns the value of list 1's label.

Returns:
the value of list 1's label
See Also:
setList1Label(java.lang.String)

setList1Label

public void setList1Label(java.lang.String newValue)
Sets the value of list 1's label.

Parameters:
newValue - the new value of list 1's label
See Also:
getList1Label()

getList1MaximumCount

public int getList1MaximumCount()
Returns the value of the list1MaximumCount property. The list1MaximumCount property controls the number of items that are allowed to either exist or be moved into list 1. A value of -1 indicates that an unlimited number of items is allowed in list 1.

Returns:
the maximum number of allowed items for list 1
See Also:
setList1MaximumCount(int)

setList1MaximumCount

public void setList1MaximumCount(int newValue)
Sets the value of the list1MaximumCount property. The list1MaximumCount property controls the number of items that are allowed to either exist or be moved into list 1. A value of -1 indicates that an unlimited number of items is allowed in list 1.

Parameters:
newValue - the new value of the list1MaximumCount property.
Throws:
java.lang.IllegalStateException - if newValue != -1 and newValue < getList1Count()
See Also:
getList1MaximumCount()

isList2ControlsVisible

public boolean isList2ControlsVisible()
Returns the value of the list2ControlsVisible property. The list2ControlsVisible property controls whether the buttons that allow list 2 to be reordered are visible beneath the ListBox that displays the items of list 2.

Returns:
true if the controls for list 2 are visible, false otherwise.
See Also:
setList2ControlsVisible(boolean)

setList2ControlsVisible

public void setList2ControlsVisible(boolean newValue)
Sets the value of the list2ControlsVisible property. The list2ControlsVisible property controls whether the buttons that allow list 2 to be reordered are visible beneath the ListBox that displays the items of list 2.

Parameters:
newValue - the new value of the list2ControlsVisible property
See Also:
getList2Count()

getList2Count

public int getList2Count()
Returns the number of items in list 2.

Returns:
the number of items in list 2.

getList2DisplayTransform

public com.sas.util.transforms.TransformInterface getList2DisplayTransform()
Returns the display transform for list 2. The display transform controls how the items in list 2 are displayed. It transforms each item into an appropriate representation for display.

Returns:
the display transform for list 2
See Also:
setList2DisplayTransform(com.sas.util.transforms.TransformInterface)

setList2DisplayTransform

public void setList2DisplayTransform(com.sas.util.transforms.TransformInterface newValue)
Sets the display transform for list 2. The display transform controls how the items in list 2 are displayed. It transforms each item into an appropriate representation for display.

Parameters:
newValue - the new value for the list 2 display transform
See Also:
getList1DisplayTransform()

getList2Items

public com.sas.collection.StaticOrderedCollectionInterface getList2Items()
Returns a copy of the items in list 2.

Returns:
a copy of the items in list 2

getList2Label

public java.lang.String getList2Label()
Returns the value of list 2's label.

Returns:
the value of list 2's label
See Also:
setList2Label(java.lang.String)

setList2Label

public void setList2Label(java.lang.String newValue)
Set the value of list 2's label.

Parameters:
newValue - the new value of list 2's label
See Also:
getList2Label()

getList2MaximumCount

public int getList2MaximumCount()
Returns the value of the list2MaximumCount property. The list2MaximumCount property controls the number of items that are allowed to either exist or be moved into list 2. A value of -1 indicates that an unlimited number of items is allowed in list 2.

Returns:
the maximum number of allowed items for list 2
Throws:
java.lang.IllegalStateException - if newValue != -1 and newValue < getList2Count()
See Also:
setList2MaximumCount(int)

setList2MaximumCount

public void setList2MaximumCount(int newValue)
Sets the value of the list2MaximumCount property. The list2MaximumCount property controls the number of items that are allowed to either exist or be moved into list 2. A value of -1 indicates that an unlimited number of items is allowed in list 2.

Parameters:
newValue - the new value of the list2MaximumCount property
See Also:
getList2MaximumCount()

isModelEventsIgnored

public boolean isModelEventsIgnored()
Returns the value of the modelEventsIgnored property. This is an expert property which signals the DualSelector to either respond to ContentsChangedEvent events from its models or to ignore them. This property is only checked when the dynamic property is false.

Returns:
true if the DualSelector ignores events from its models, false otherwise
See Also:
setModelEventsIgnored(boolean)

setModelEventsIgnored

public void setModelEventsIgnored(boolean newValue)
Sets the value of the modelEventsIgnored property. This is an expert property which signals the DualSelector to either respond to ContentsChangedEvent events from its models or to ignore them. This property is only checked when the dynamic property is true.

Parameters:
newValue - the new value of the modelEventsIgnored attribute.
See Also:
isModelEventsIgnored()

isTransferAllControlsVisible

public boolean isTransferAllControlsVisible()
Returns the value of the transferAllControlsVisible property. The transferAllControlsVisible property controls whether the two buttons that allow all items to be moved from list 1 to list 2 and from list 2 to list 1 are visible or hidden.

Returns:
true if the buttons which move all items are visible, false otherwise
See Also:
setTransferAllControlsVisible(boolean)

setTransferAllControlsVisible

public void setTransferAllControlsVisible(boolean newValue)
Sets the value of the transferAllControlsVisible property. The transferAllControlsVisible property controls whether the two buttons that allow all items to be moved from list 1 to list 2 and from list 2 to list 1 are visible or hidden.

Parameters:
newValue - the new value of the transferAllControlsVisible property
See Also:
isTransferAllControlsVisible()

moveListItem

protected void moveListItem(com.sas.collection.OrderedCollectionInterface list,
                            boolean moveItemUp)
Moves the selected item or items in list either up or down one position. If the destination of an item is outside of the bounds of list, then the item is not moved. This method is called by moveList1ItemUp, moveList1ItemDown, moveList2ItemUp and moveList2ItemDown. Subclasses should override this method to modify behavior.

Parameters:
list - the list of which to move the item or items
moveItemUp - true to move the item(s) up, false to move the item(s) down
See Also:
moveList1ItemUp(), moveList1ItemDown(), moveList2ItemUp(), moveList2ItemDown()

moveList1ItemUp

public void moveList1ItemUp()
Moves the selected item(s) in list 1 up one position. If the destination is less than 0, the selected item is not moved. This method is called in response to the list 1 up button being pressed. This method calls moveListItem(list1, true). Subclasses should override moveListItem to modify behavior.

See Also:
moveListItem(com.sas.collection.OrderedCollectionInterface, boolean)

moveList1ItemDown

public void moveList1ItemDown()
Moves the selected item(s) in list 1 down one position. If the destination is greater than list 1's count - 1, the selected item is not moved. This method is called in response to the list 1 down button being pressed. This method calls moveListItem(list1, false). Subclasses should override moveListItem to modify behavior.

See Also:
moveListItem(com.sas.collection.OrderedCollectionInterface, boolean)

moveList2ItemUp

public void moveList2ItemUp()
Moves the selected item(s) in list 2 up one position. If the destination is less than 0, the selected item is not moved. This method is called in response to the list 2 up button being pressed. This method calls moveListItem(list2, true). Subclasses should override moveListItem to modify behavior.

See Also:
moveListItem(com.sas.collection.OrderedCollectionInterface, boolean)

moveList2ItemDown

public void moveList2ItemDown()
Moves the selected item(s) in list 2 down one position. If the destination is greater than list 2's count - 1, the selected item is not moved. This method is called in response to the list 2 down button being pressed. This method calls moveListItem(list2, false). Subclasses should override moveListItem to modify behavior.

See Also:
moveListItem(com.sas.collection.OrderedCollectionInterface, boolean)

transferAllItems

protected void transferAllItems(com.sas.collection.OrderedCollectionInterface fromList,
                                com.sas.collection.OrderedCollectionInterface toList)
Transfers all of the items from fromList to toList. No items are transferred if the maximum count for toList will be exceeded as a result of the transfer. After the transfer fromList will be empty and toList will contain the items that were in fromList and toList prior to the transfer. This method is called by transferAllList1Items and transferAllList2Items. Subclasses should override this method to modify behavior.

Parameters:
fromList - the list to move all items from
toList - the list to move all items to
See Also:
transferAllList1Items(), transferAllList2Items()

transferAllList1Items

public void transferAllList1Items()
Transfer all items from list 1 to list 2. This method is called in response to the top transfer all button being pressed. No items are transfered if the maximum count for list 2 will be exceeded as a result of the transfer. This method calls transferAllItems(list1, list2). Subclasses should override transferAllItems to modify behavior.

See Also:
transferAllItems(com.sas.collection.OrderedCollectionInterface, com.sas.collection.OrderedCollectionInterface)

transferListItems

protected void transferListItems(com.sas.collection.OrderedCollectionInterface fromList,
                                 com.sas.collection.OrderedCollectionInterface toList)
Transfer all selected items from fromList to toList. This method is called in response to the transfer items button being pressed. No items are transfered if the maximum count for toList will be exceeded as a result of the transfer. This method is called by transferList1Items and transferList2Items. Subclasses should override this method to modify behavior.

Parameters:
fromList - the list that the items are being transferred from
toList - the list that the items are being transferred to
See Also:
transferList1Items(), transferList2Items()

transferList1Items

public void transferList1Items()
Transfer all the selected items from list 1 to list 2. This method is called in response to the transfer items button being pressed. No items are transfered if the maximum count for list 2 will be exceeded as a result of the transfer. This method calls transferListItems(list1, list2). Subclasses should override transferListItems to modify behavior.

See Also:
transferListItems(com.sas.collection.OrderedCollectionInterface, com.sas.collection.OrderedCollectionInterface)

transferAllList2Items

public void transferAllList2Items()
Transfer all items from list 2 to list 1. This method is called in response to the top transfer all button being pressed. No items are transfered if the maximum count for list 1 will be exceeded as a result of the transfer. This methods calls transferAllItems(list2, list1). Subclasses should override transferAllItems to modify behavior.

See Also:
transferAllItems(com.sas.collection.OrderedCollectionInterface, com.sas.collection.OrderedCollectionInterface)

transferList2Items

public void transferList2Items()
Transfer all the selected items from list 2 to list 1. This method is called in response to the transfer items button being pressed. No items are transfered if the maximum count for list 1 will be exceeded as a result of the transfer. This method calls transferList2Items(list2, list1). Subclasses should override transferListItems to modify behavior.


attachModel

public void attachModel(com.sas.ModelInterface mi)
Attaches a model supporting the required interface to a DualSelector. DualSelector allows 2 models to be attached (1 for each ListBox). The model for list 1 is set with the first attachModel call and the model for list 2 is set with the second attachModel call. Any additional attachModel calls will result in a ComponentException being thrown if detachModel is not first called for one of the previously attached models.

The current required interfaces are com.sas.collection.StaticOrderedCollectionInterface or com.sas.collection.OrderedCollectionInterface

Specified by:
attachModel in interface com.sas.ViewInterface
Overrides:
attachModel in class PanelVisualComponent
Parameters:
mi - the object to set as the model.
See Also:
detachModel(com.sas.ModelInterface)

computePreferredSize

public java.awt.Dimension computePreferredSize()
Computes the preferred size. The preferred size is returned as the default width and height.

Specified by:
computePreferredSize in interface VisualInterface
Overrides:
computePreferredSize in class PanelVisualComponent
Returns:
the preferred size in pixels
See Also:
getDefaultWidth(), getDefaultHeight()

detachModel

public void detachModel(com.sas.ModelInterface mi)
Detaches an attached model.

Specified by:
detachModel in interface com.sas.ViewInterface
Overrides:
detachModel in class PanelVisualComponent
Parameters:
model - the object to detach as the model.
See Also:
attachModel(com.sas.ModelInterface)

dragOver

public int dragOver(java.awt.Point point,
                    int representation,
                    int keyState,
                    java.util.Vector data)
Override the dragOver method of com.sas.awt.Panel. Do not allow Viewers and Components to be dropped on the DualSelector. If anything else is dragged onto the DualSelector, let the container handle it.

Specified by:
dragOver in interface ContainerInterface
Specified by:
dragOver in interface com.sas.DesignTimeDropTargetInterface
Overrides:
dragOver in class PanelContainerComponent
Parameters:
point - The x/y coordinates of the mouse cursor inside the component.
representation - One of com.sas.DesignTimeDropResult.{representationComponent,representationModel,representationAttribute,representationViewer}
keyState - Unused.
data - A Vector containing information about the drag.
Returns:
One of com.sas.DesignTimeDropResult.{dragIndeterminate,dragMove,dragCopy,dragLink,dragNone}
See Also:
DesignTimeDropTargetInterface.dragOver(java.awt.Point, int, int, java.util.Vector)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size. The minimum size is the same as the preferred size (calls getPreferredSize()).

Specified by:
getMinimumSize in interface VisualInterface
Overrides:
getMinimumSize in class PanelVisualComponent
Returns:
the minimum size in pixels
See Also:
VisualInterface.getMinimumSize()

getRequiredInterfaces

public java.util.Vector getRequiredInterfaces()
Returns the required interfaces Vector for this component.

Specified by:
getRequiredInterfaces in interface com.sas.ViewInterface
Overrides:
getRequiredInterfaces in class PanelVisualComponent
Returns:
the required interfaces Vector for this component.
See Also:
ViewInterface.getRequiredInterfaces()

refresh

public void refresh()
Signals the DualSelector selector to refresh its data from its models.


refresh

public void refresh(com.sas.ModelInterface mi)
Signals the DualSelector selector to refresh its data from the specified model. This model must be one of the attached models.

Specified by:
refresh in interface com.sas.ViewInterface
Overrides:
refresh in class PanelVisualComponent
Parameters:
mi - the current model refresh to refresh from
See Also:
ViewInterface.refresh(com.sas.ModelInterface)

setBackground

public void setBackground(java.awt.Color color)
Overrides setBackground in java.awt.Component. This is overridden to get notification of a color change and to filter it to the contained components.

Overrides:
setBackground in class java.awt.Component
Parameters:
color - the new color for the background

setDefaultValues

public void setDefaultValues()
Creates the components and sets the default values for the DualSelector. This is a framework method and is not intended to be called by a user.

Specified by:
setDefaultValues in interface ContainerInterface
Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
Overrides:
setDefaultValues in class CompositePanel
See Also:
ContainerInterface.setDefaultValues()

setFont

public void setFont(java.awt.Font font)
Overrides super.setFont. This is overridden to notify children that the font has changed so that they can draw themselves using the correct font. This will be removed whenever the JDK bug is fixed.

Specified by:
setFont in interface VisualInterface
Overrides:
setFont in class PanelVisualComponent
Parameters:
font - the new font
See Also:
VisualInterface.setFont(java.awt.Font)

setForeground

public void setForeground(java.awt.Color color)
Overrides setForeground in java.awt.Component. This is overridden to get notification of a color change and to filter it to the contained components.

Overrides:
setForeground in class java.awt.Component
Parameters:
color - the new color for the foreground

setModelInterface

public void setModelInterface(com.sas.ModelInterface mi)
Sets the models interface for list 1.

Specified by:
setModelInterface in interface com.sas.ViewInterface
Overrides:
setModelInterface in class PanelVisualComponent
Parameters:
mi - the model interface to set on list 1
See Also:
setList2ModelInterface(com.sas.ModelInterface)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called whenever one of the buttons has been clicked and performs an action based on whichever button was clicked.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the action event.

contentsChanged

public void contentsChanged(com.sas.collection.ContentsChangedEvent event)
Event handler for the ContentsChangedEvents received from the models.

Specified by:
contentsChanged in interface com.sas.collection.ContentsChangedListener
Parameters:
event - the event to handle

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
Event handler for the ItemEvent's received.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
ie - the event to handle

getList2ModelInterface

public com.sas.ModelInterface getList2ModelInterface()
Returns the ModelInterface for list 2. The ModelInterface for list 1 can be obtained by calling getModelInterface.

Returns:
the ModelInterface for list 2
See Also:
setList2ModelInterface(com.sas.ModelInterface)

setList2ModelInterface

public void setList2ModelInterface(com.sas.ModelInterface mi)
Sets the ModelInterface for list 2. The ModelInterface for list 1 can be set by calling setModelInterace

Parameters:
mi - the ModelInterface to set for list 2
See Also:
setModelInterface(com.sas.ModelInterface)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.