LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJListComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JList
                  extended by leon.view.win.swing.component.LyJListComponent
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, LyActionListener, LyEventTransmitter, LySelectionListener

public class LyJListComponent
extends javax.swing.JList
implements LySelectionListener, LyActionListener, LyEventTransmitter

This class implements a list of data.

See Also:
JList, LyJMultiSelector, Serialized Form

Nested Class Summary
 class LyJListComponent._LyJListModel
          This class implements the access to the data to display in the list.
 class LyJListComponent._LyJListMouseListener
          This class manages the mouse events that occur on the table.
 class LyJListComponent._LyJListSelectionListener
          This class manages the selection events from the view to the model.
 
Nested classes/interfaces inherited from class javax.swing.JList
javax.swing.JList.DropLocation
 
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
           
static char ITEM_SEP
          Separator character.
 
Fields inherited from class javax.swing.JList
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP
 
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
LyJListComponent()
          Sole constructor.
 
Method Summary
 void actionPerformed(LyActionEvent e)
          (non-Javadoc).
 void addItem(java.lang.Object item)
          Adds an item at the end of this list.
 void addLyJListMouseListener()
          Registers the mouse events.
 void addLyJListSelectionListener()
          Registers the selection events.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 int getCount()
          Gets the number of items.
 java.lang.Object getItemAt(int index)
          Gets the item at the specified position.
 LyJListComponent._LyJListModel getLyJListModel()
          Gets this list data model.
 java.awt.Dimension getPreferredScrollableViewportSize()
          Gets the scrollable viewport to have more space in width.
 java.awt.Dimension getPreferredSize()
           
 int getSelectedCount()
          Gets the number of selected items it this list.
 LySelectionTransmitter getSelectionTransmitter()
          (non-Javadoc).
 int indexOf(java.lang.Object item)
          Gets the position in this list of the specified item.
 void insertItemAt(java.lang.Object item, int index)
          Inserts an item in this list at the specified position.
 void removeItem(java.lang.Object item)
          Removes an item from this list.
 void removeItemAt(int index)
          Removes an item from this list.
 void removeLyJListMouseListener()
          Unregisters the mouse events.
 void removeLyJListSelectionListener()
          Unregisters the selection events.
 void selectionPerformed(LySelectionEvent e)
          (non-Javadoc).
 void selectItem(java.lang.Object item, boolean select)
          Selects or deselects the specified list item.
 void setFixedHeight(int fixedHeight)
          Sets the fixed height of this component.
 void setItems(java.util.Vector<java.lang.Object> items)
          Resets the content of the list to the specified list content.
 
Methods inherited from class javax.swing.JList
addListSelectionListener, addSelectionInterval, clearSelection, ensureIndexIsVisible, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, 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, addKeyListener, 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

ITEM_SEP

public static final char ITEM_SEP
Separator character.

See Also:
Constant Field Values
Constructor Detail

LyJListComponent

public LyJListComponent()
Sole constructor. Initializes the list component and registers its event listeners.

Method Detail

addLyJListSelectionListener

public void addLyJListSelectionListener()
Registers the selection events.

See Also:
removeLyJListSelectionListener()

addLyJListMouseListener

public void addLyJListMouseListener()
Registers the mouse events.

See Also:
removeLyJListMouseListener()

removeLyJListSelectionListener

public void removeLyJListSelectionListener()
Unregisters the selection events.

See Also:
addLyJListSelectionListener()

removeLyJListMouseListener

public void removeLyJListMouseListener()
Unregisters the mouse events.

See Also:
addLyJListMouseListener()

selectItem

public void selectItem(java.lang.Object item,
                       boolean select)
Selects or deselects the specified list item.

Parameters:
item - the item to select
select - Indicates if the specified item element has to be selected or deselected.

setItems

public void setItems(java.util.Vector<java.lang.Object> items)
Resets the content of the list to the specified list content.

Parameters:
items - the new content of the list

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Gets the scrollable viewport to have more space in width.

Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable
Overrides:
getPreferredScrollableViewportSize in class javax.swing.JList
See Also:
Scrollable.getPreferredScrollableViewportSize()

setFixedHeight

public void setFixedHeight(int fixedHeight)
Sets the fixed height of this component.

Parameters:
fixedHeight - the fixed height of this component in pixels.

addItem

public void addItem(java.lang.Object item)
Adds an item at the end of this list.

Parameters:
item - the item to add

insertItemAt

public void insertItemAt(java.lang.Object item,
                         int index)
Inserts an item in this list at the specified position.

Parameters:
item - the item to add
index - the index where to add

removeItem

public void removeItem(java.lang.Object item)
Removes an item from this list.

Parameters:
item - the item to remove from the list

removeItemAt

public void removeItemAt(int index)
Removes an item from this list.

Parameters:
index - the index of the item to remove

getLyJListModel

public LyJListComponent._LyJListModel getLyJListModel()
Gets this list data model.

Returns:
the data model of the list

indexOf

public int indexOf(java.lang.Object item)
Gets the position in this list of the specified item.

Parameters:
item - the item
Returns:
the index of an item

getCount

public int getCount()
Gets the number of items.

Returns:
the count of items

getSelectedCount

public int getSelectedCount()
Gets the number of selected items it this list.

Returns:
the count of selected items

getItemAt

public java.lang.Object getItemAt(int index)
Gets the item at the specified position.

Parameters:
index - the position index of the object to retrieve
Returns:
the item at position index

actionPerformed

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

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

selectionPerformed

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

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

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()
(non-Javadoc).

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

(c) January 2013 - W4 S.A.

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