LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJMultiSelector

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 leon.view.win.swing.component.LyJMultiSelector
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, LyActionListener, LyEventTransmitter, LySelectionListener

public class LyJMultiSelector
extends javax.swing.JPanel
implements LySelectionListener, LyActionListener, LyEventTransmitter

This class defines a component containing two lists and a set of buttons. It allows to choose some elements of the first list and to put them in the second one.

See Also:
Serialized Form

Nested Class Summary
 class LyJMultiSelector._LyJCellRenderer
          This class implements a customized renderer for list cell.
 class LyJMultiSelector._LyJMultiSelectorKeyListener
          Multiselector key listener.
 class LyJMultiSelector._LyJSpecialScrollPane
          This class implements the preferred size of its super component.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
LyJMultiSelector(LyEnvironment environment, int height)
          Creates a multiselector object with the specified attributes.
LyJMultiSelector(LyEnvironment environment, int height, boolean ordered)
          Creates a multiselector object with the specified attributes.
 
Method Summary
 void actionPerformed(LyActionEvent actionEvent)
          (non-Javadoc).
 void addItemAt(LyLink link, int index)
          Adds the specified link at the specified position.
 void addKeyListener(java.awt.event.KeyListener listener)
          Adds the specified key listener to both the selected and unselected lists.
 void checkButtons()
          Updates the buttons whether they are enabled or not.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 LyJListComponent getListComponent(int i)
          Returns the list associated with the given multiselector number.
 java.awt.Dimension getListPreferredSize()
          Gets the maximum size between the two lists.
 java.awt.Dimension getMinimumSize()
          (non-Javadoc).
 java.awt.Dimension getPreferredSize()
          (non-Javadoc).
 LySelectionTransmitter getSelectionTransmitter()
          This multiselector doesn't handle selection events, so it has no selection transmitter.
 java.lang.String getValue()
          Gets the list of selected elements' id.
 void select(LyLink link)
          Adds the specified link to the right list and removes it from the left list.
 void selectionPerformed(LySelectionEvent selectionEvent)
          (non-Javadoc).
 void set(java.util.Vector<LyLink> unSelectedLinks, java.util.Vector<LyLink> selectedLinks)
          Sets the content of this selector.
 void setBackground(java.awt.Color color)
          (non-Javadoc).
 void setEnabled(boolean status)
          (non-Javadoc).
 void setFont(java.awt.Font font)
          (non-Javadoc).
 void unselect(LyLink link)
          Removes the specified link from the right list and adds it to the left list.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyJMultiSelector

public LyJMultiSelector(LyEnvironment environment,
                        int height)
Creates a multiselector object with the specified attributes.

Parameters:
environment - the current environment
height - the height of this component

LyJMultiSelector

public LyJMultiSelector(LyEnvironment environment,
                        int height,
                        boolean ordered)
Creates a multiselector object with the specified attributes.

Parameters:
environment - the current environment
height - the height of this component
ordered - indicates whether this selector is ordered or not
Method Detail

getMinimumSize

public java.awt.Dimension getMinimumSize()
(non-Javadoc).

Overrides:
getMinimumSize in class javax.swing.JComponent
See Also:
Component.getMinimumSize()

getListPreferredSize

public java.awt.Dimension getListPreferredSize()
Gets the maximum size between the two lists. Used to ensure that the 2 lists have the same size.

Returns:
the list preferred size

getPreferredSize

public java.awt.Dimension getPreferredSize()
(non-Javadoc).

Overrides:
getPreferredSize in class javax.swing.JComponent
See Also:
Component.getPreferredSize()

checkButtons

public void checkButtons()
Updates the buttons whether they are enabled or not.


set

public void set(java.util.Vector<LyLink> unSelectedLinks,
                java.util.Vector<LyLink> selectedLinks)
Sets the content of this selector. The left list is set with the content of the unSelectedLinks argument and the right list is set with the selectedLinks content.

Parameters:
unSelectedLinks - list of unselected links for the left list
selectedLinks - lift of selected links for the right list

select

public void select(LyLink link)
Adds the specified link to the right list and removes it from the left list.

Parameters:
link - the link to select

unselect

public void unselect(LyLink link)
Removes the specified link from the right list and adds it to the left list.

Parameters:
link - the link to unselect

addItemAt

public void addItemAt(LyLink link,
                      int index)
Adds the specified link at the specified position. If the link is selected it is added to the right list, else to the left one.

Parameters:
link - the link to add
index - the position of the link to add

selectionPerformed

public void selectionPerformed(LySelectionEvent selectionEvent)
(non-Javadoc).

Specified by:
selectionPerformed in interface LySelectionListener
Parameters:
selectionEvent - description of the selection which has occured
See Also:
LySelectionListener.selectionPerformed(leon.view.event.LySelectionEvent)

actionPerformed

public void actionPerformed(LyActionEvent actionEvent)
(non-Javadoc).

Specified by:
actionPerformed in interface LyActionListener
See Also:
LyActionListener.actionPerformed(leon.view.event.LyActionEvent)

setEnabled

public void setEnabled(boolean status)
(non-Javadoc).

Overrides:
setEnabled in class javax.swing.JComponent
See Also:
Component.setEnabled(boolean)

setBackground

public void setBackground(java.awt.Color color)
(non-Javadoc).

Overrides:
setBackground in class javax.swing.JComponent
See Also:
Component.setBackground(java.awt.Color)

setFont

public void setFont(java.awt.Font font)
(non-Javadoc).

Overrides:
setFont in class javax.swing.JComponent
See Also:
Component.setFont(java.awt.Font)

getListComponent

public LyJListComponent getListComponent(int i)
Returns the list associated with the given multiselector number. If no multiselector is defined for the specified number, then returns null.

Parameters:
i - index of the listbox: 0 for the first one, 1 for the second one
Returns:
the corresponding listbox or null if not found

getValue

public java.lang.String getValue()
Gets the list of selected elements' id.

Returns:
the list of selected element ids. These ids are separated by LyJListComponent.ITEM_SEP.

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

Specified by:
getActionTransmitter in interface LyEventTransmitter
Returns:
the action transmitter of this component
See Also:
LyEventTransmitter.getActionTransmitter()

getSelectionTransmitter

public LySelectionTransmitter getSelectionTransmitter()
This multiselector doesn't handle selection events, so it has no selection transmitter.

Specified by:
getSelectionTransmitter in interface LyEventTransmitter
Returns:
null
See Also:
LyEventTransmitter.getSelectionTransmitter()

addKeyListener

public void addKeyListener(java.awt.event.KeyListener listener)
Adds the specified key listener to both the selected and unselected lists.

Overrides:
addKeyListener in class java.awt.Component
See Also:
Component.addKeyListener(java.awt.event.KeyListener)

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com