public class DefaultSelectionMapper extends java.lang.Object implements SelectionMapper
updates view selection on pipeline change. updates model selection on view selection change.
| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.DefaultListSelectionModel |
modelSelection
selection in model coordinates.
|
| Constructor and Description |
|---|
DefaultSelectionMapper(FilterPipeline pipeline,
javax.swing.ListSelectionModel selection)
PRE: selection != null;
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearModelSelection() |
javax.swing.ListSelectionModel |
getViewSelectionModel() |
void |
insertIndexInterval(int start,
int length,
boolean before)
Adjust the model by adding the specified rows.
|
boolean |
isEnabled() |
protected void |
mapTowardsView()
Populate view selection from model selection.
|
void |
removeIndexInterval(int start,
int end)
Adjust the model by removing the specified rows.
|
void |
setEnabled(boolean enabled)
Toggle whether selection mapping is active.
|
void |
setFilters(FilterPipeline pipeline)
Install the new filter pipeline and map the newly filtered data
towards the view.
|
void |
setViewSelectionModel(javax.swing.ListSelectionModel viewSelectionModel)
sets the view selection model.
|
protected final javax.swing.DefaultListSelectionModel modelSelection
public DefaultSelectionMapper(FilterPipeline pipeline, javax.swing.ListSelectionModel selection)
pipeline - selection - public void setViewSelectionModel(javax.swing.ListSelectionModel viewSelectionModel)
setViewSelectionModel in interface SelectionMapperviewSelectionModel - holding selected indices in view coordinatespublic javax.swing.ListSelectionModel getViewSelectionModel()
getViewSelectionModel in interface SelectionMapperpublic void setFilters(FilterPipeline pipeline)
SelectionMappersetFilters in interface SelectionMapperprotected void mapTowardsView()
public void setEnabled(boolean enabled)
setEnabled in interface SelectionMapperpublic boolean isEnabled()
isEnabled in interface SelectionMapperpublic void clearModelSelection()
clearModelSelection in interface SelectionMapperpublic void insertIndexInterval(int start,
int length,
boolean before)
SelectionMapperinsertIndexInterval in interface SelectionMapperpublic void removeIndexInterval(int start,
int end)
SelectionMapperremoveIndexInterval in interface SelectionMapper