SelectionMapper
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 | Description |
---|---|---|
protected javax.swing.DefaultListSelectionModel |
modelSelection |
selection in model coordinates.
|
Constructor | Description |
---|---|
DefaultSelectionMapper(FilterPipeline pipeline,
javax.swing.ListSelectionModel selection) |
PRE: selection != null;
|
Modifier and Type | Method | 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 SelectionMapper
viewSelectionModel
- holding selected indices in view coordinatespublic javax.swing.ListSelectionModel getViewSelectionModel()
getViewSelectionModel
in interface SelectionMapper
public void setFilters(FilterPipeline pipeline)
SelectionMapper
setFilters
in interface SelectionMapper
protected void mapTowardsView()
public void setEnabled(boolean enabled)
setEnabled
in interface SelectionMapper
public boolean isEnabled()
isEnabled
in interface SelectionMapper
public void clearModelSelection()
clearModelSelection
in interface SelectionMapper
public void insertIndexInterval(int start, int length, boolean before)
SelectionMapper
insertIndexInterval
in interface SelectionMapper
public void removeIndexInterval(int start, int end)
SelectionMapper
removeIndexInterval
in interface SelectionMapper