fr.ifremer.coser.ui.util
Class CoserListSelectionModel

java.lang.Object
  extended by jaxx.runtime.swing.OneClicListSelectionModel
      extended by fr.ifremer.coser.ui.util.CoserListSelectionModel
All Implemented Interfaces:
EventListener, ListDataListener, ListSelectionModel

public class CoserListSelectionModel
extends jaxx.runtime.swing.OneClicListSelectionModel
implements ListDataListener

Model de selection fonctionnant avec les intances des objects selectionnée et non par indices. Etend OneClicListSelectionModel pour sélectionner par simple clic. Implemente ListDataListener pour que la selection apres changement des données reste la même au niveau des objets (sinon, les indices ne correspondent pas au données précédent le changement. ATTENTION : selectedObjects ne reflete pas la selection de la liste. Certains de ces élements peuvent être mémorisé selectionné, mais non présente dans le modele de la liste, donc hors selection.

Version:
$Revision: 932 $ Last update : $Date: 2011-12-23 16:13:27 +0100 (Fri, 23 Dec 2011) $ By : $Author: echatellier $
Author:
chatellier

Field Summary
protected  CoserListModel coserListModel
          List model.
protected  Set<Object> selectedObjects
          Selection objects.
 
Fields inherited from class jaxx.runtime.swing.OneClicListSelectionModel
delegate, model
 
Fields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
CoserListSelectionModel(ListSelectionModel delegate, CoserListModel coserListModel)
          Constuctor.
 
Method Summary
 void addSelectionInterval(int index0, int index1)
           
 void clearSelection()
           
 void contentsChanged(ListDataEvent e)
           
 void fillSelection()
          Fill selection.
 void intervalAdded(ListDataEvent e)
           
 void intervalRemoved(ListDataEvent e)
           
protected  void registerSelection(int index0, int index1)
           
 void setSelectedObjects(Collection<?> objects)
          Replace selection.
 void setSelectionInterval(int index0, int index1)
           
 
Methods inherited from class jaxx.runtime.swing.OneClicListSelectionModel
addListSelectionListener, getAnchorSelectionIndex, getLeadSelectionIndex, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getStates, getValueIsAdjusting, insertIndexInterval, isSelectedIndex, isSelectionEmpty, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadSelectionIndex, setSelectionMode, setValueIsAdjusting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectedObjects

protected Set<Object> selectedObjects
Selection objects.


coserListModel

protected CoserListModel coserListModel
List model.

Constructor Detail

CoserListSelectionModel

public CoserListSelectionModel(ListSelectionModel delegate,
                               CoserListModel coserListModel)
Constuctor.

Parameters:
delegate -
coserListModel -
Method Detail

setSelectedObjects

public void setSelectedObjects(Collection<?> objects)
Replace selection.

Parameters:
objects - new selected objects

intervalAdded

public void intervalAdded(ListDataEvent e)
Specified by:
intervalAdded in interface ListDataListener

intervalRemoved

public void intervalRemoved(ListDataEvent e)
Specified by:
intervalRemoved in interface ListDataListener

contentsChanged

public void contentsChanged(ListDataEvent e)
Specified by:
contentsChanged in interface ListDataListener

setSelectionInterval

public void setSelectionInterval(int index0,
                                 int index1)
Specified by:
setSelectionInterval in interface ListSelectionModel
Overrides:
setSelectionInterval in class jaxx.runtime.swing.OneClicListSelectionModel

addSelectionInterval

public void addSelectionInterval(int index0,
                                 int index1)
Specified by:
addSelectionInterval in interface ListSelectionModel
Overrides:
addSelectionInterval in class jaxx.runtime.swing.OneClicListSelectionModel

registerSelection

protected void registerSelection(int index0,
                                 int index1)

fillSelection

public void fillSelection()
Fill selection.


clearSelection

public void clearSelection()
Specified by:
clearSelection in interface ListSelectionModel
Overrides:
clearSelection in class jaxx.runtime.swing.OneClicListSelectionModel


Copyright © 2010-2012 Ifremer. All Rights Reserved.