private class RelationListDialog.RelationListModel extends javax.swing.AbstractListModel<Relation>
Modifier and Type | Field and Description |
---|---|
private SearchCompiler.Match |
filter |
private java.util.List<Relation> |
filteredRelations |
private java.util.List<Relation> |
relations |
private javax.swing.DefaultListSelectionModel |
selectionModel |
Constructor and Description |
---|
RelationListModel(javax.swing.DefaultListSelectionModel selectionModel) |
Modifier and Type | Method and Description |
---|---|
void |
addRelations(java.util.Collection<? extends OsmPrimitive> addedPrimitives)
Add all relations in
addedPrimitives to the model for the
relation list dialog |
void |
clear()
Clears the model.
|
Relation |
getElementAt(int index) |
java.util.List<Relation> |
getSelectedRelations()
Replies the list of selected relations.
|
int |
getSize() |
private Relation |
getVisibleRelation(int index) |
private java.lang.Integer |
getVisibleRelationIndex(Relation rel) |
private java.util.List<Relation> |
getVisibleRelations() |
private boolean |
isValid(Relation r) |
void |
removeRelations(java.util.Collection<? extends OsmPrimitive> removedPrimitives)
Removes all relations in
removedPrimitives from the model |
void |
setFilter(SearchCompiler.Match filter) |
void |
setRelations(java.util.Collection<Relation> relations) |
void |
setSelectedRelations(java.util.Collection<Relation> sel)
Sets the selected relations.
|
void |
sort()
Sorts the model using
DefaultNameFormatter relation comparator. |
private void |
updateFilteredRelations() |
void |
updateTitle() |
private transient java.util.List<Relation> filteredRelations
private final javax.swing.DefaultListSelectionModel selectionModel
private transient SearchCompiler.Match filter
RelationListModel(javax.swing.DefaultListSelectionModel selectionModel)
public void clear()
public void sort()
DefaultNameFormatter
relation comparator.public void setRelations(java.util.Collection<Relation> relations)
public void addRelations(java.util.Collection<? extends OsmPrimitive> addedPrimitives)
addedPrimitives
to the model for the
relation list dialogaddedPrimitives
- the collection of added primitives. May include nodes,
ways, and relations.public void removeRelations(java.util.Collection<? extends OsmPrimitive> removedPrimitives)
removedPrimitives
from the modelremovedPrimitives
- the removed primitives. May include nodes, ways,
and relationsprivate void updateFilteredRelations()
public void setFilter(SearchCompiler.Match filter)
private java.util.List<Relation> getVisibleRelations()
private Relation getVisibleRelation(int index)
public Relation getElementAt(int index)
public int getSize()
public java.util.List<Relation> getSelectedRelations()
public void setSelectedRelations(java.util.Collection<Relation> sel)
sel
- the list of selected relationsprivate java.lang.Integer getVisibleRelationIndex(Relation rel)
public void updateTitle()