swingx
Version 2005-08-19

org.jdesktop.swingx.decorator
Class SelectionMapper

java.lang.Object
  extended by org.jdesktop.swingx.decorator.SelectionMapper

public class SelectionMapper
extends Object

Responsible for keeping track of selection in model coordinates.

updates view selection on pipeline change. updates model selection on view selection change.


Field Summary
protected  DefaultListSelectionModel modelSelection
          selection in model coordinates.
 
Constructor Summary
SelectionMapper(FilterPipeline pipeline, ListSelectionModel selection)
          PRE: selection !
 
Method Summary
 void clearModelSelection()
           
 ListSelectionModel getViewSelectionModel()
          TODO: temporarily added for testing...
 void insertIndexInterval(int start, int length, boolean before)
           
 void lock()
           
 void removeIndexInterval(int start, int end)
           
 void restoreSelection()
           
 void setFilters(FilterPipeline pipeline)
           
 void setViewSelectionModel(ListSelectionModel selection)
          sets the view selection model.
 void unlock()
           
protected  void updateFromPipelineChanged()
           
protected  void updateFromViewSelectionChanged(int firstIndex, int lastIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelSelection

protected DefaultListSelectionModel modelSelection
selection in model coordinates.

Constructor Detail

SelectionMapper

public SelectionMapper(FilterPipeline pipeline,
                       ListSelectionModel selection)
PRE: selection != null;

Parameters:
pipeline -
selection -
Method Detail

setViewSelectionModel

public void setViewSelectionModel(ListSelectionModel selection)
sets the view selection model. Must not be null.

Parameters:
selection - holding selected indices in view coordinates

getViewSelectionModel

public ListSelectionModel getViewSelectionModel()
TODO: temporarily added for testing...

Returns:
view selection model

setFilters

public void setFilters(FilterPipeline pipeline)

restoreSelection

public void restoreSelection()

unlock

public void unlock()

lock

public void lock()

clearModelSelection

public void clearModelSelection()

insertIndexInterval

public void insertIndexInterval(int start,
                                int length,
                                boolean before)

removeIndexInterval

public void removeIndexInterval(int start,
                                int end)

updateFromViewSelectionChanged

protected void updateFromViewSelectionChanged(int firstIndex,
                                              int lastIndex)

updateFromPipelineChanged

protected void updateFromPipelineChanged()

swingx
Version 2005-08-19