org.jdesktop.swingx.decorator
Class Selection

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

public class Selection
extends java.lang.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  javax.swing.DefaultListSelectionModel modelSelection
          selection in model coordinates.
 
Constructor Summary
Selection(FilterPipeline pipeline, javax.swing.ListSelectionModel selection)
          PRE: selection != null;
 
Method Summary
 void clearModelSelection()
           
 void insertIndexInterval(int start, int length, boolean before)
           
 void lock()
           
 void removeIndexInterval(int start, int end)
           
 void restoreSelection()
           
 void setFilters(FilterPipeline pipeline)
           
 void setViewSelectionModel(javax.swing.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 javax.swing.DefaultListSelectionModel modelSelection
selection in model coordinates.

Constructor Detail

Selection

public Selection(FilterPipeline pipeline,
                 javax.swing.ListSelectionModel selection)
PRE: selection != null;

Parameters:
pipeline -
selection -
Method Detail

setViewSelectionModel

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

Parameters:
selection - holding selected indices in view coordinates

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()