Class RelationListDialog.RelationListModel
- java.lang.Object
-
- javax.swing.AbstractListModel<IRelation<?>>
-
- org.openstreetmap.josm.gui.dialogs.RelationListDialog.RelationListModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.ListModel<IRelation<?>>
- Enclosing class:
- RelationListDialog
private class RelationListDialog.RelationListModel extends javax.swing.AbstractListModel<IRelation<?>>
The list model for the list of relations displayed in the relation list dialog.
-
-
Field Summary
Fields Modifier and Type Field Description private SearchCompiler.Match
filter
private java.util.List<IRelation<?>>
filteredRelations
private java.util.List<IRelation<?>>
relations
private javax.swing.DefaultListSelectionModel
selectionModel
-
Constructor Summary
Constructors Constructor Description RelationListModel(javax.swing.DefaultListSelectionModel selectionModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRelations(java.util.Collection<? extends OsmPrimitive> addedPrimitives)
Add all relations inaddedPrimitives
to the model for the relation list dialogvoid
clear()
Clears the model.IRelation<?>
getElementAt(int index)
java.util.List<IRelation<?>>
getSelectedRelations()
Replies the list of selected relations.int
getSize()
private IRelation<?>
getVisibleRelation(int index)
private java.util.List<IRelation<?>>
getVisibleRelations()
private boolean
isValid(IRelation<?> r)
void
removeRelations(java.util.Collection<? extends OsmPrimitive> removedPrimitives)
Removes all relations inremovedPrimitives
from the modelvoid
setFilter(SearchCompiler.Match filter)
void
setRelations(java.util.Collection<? extends IRelation<?>> relations)
void
setSelectedRelations(java.util.Collection<? extends IRelation<?>> sel)
Sets the selected relations.void
sort()
Sorts the model usingDefaultNameFormatter
relation comparator.private void
updateFilteredRelations()
void
updateTitle()
Update the title for the relation list dialog
-
-
-
Field Detail
-
filteredRelations
private transient java.util.List<IRelation<?>> filteredRelations
-
selectionModel
private final javax.swing.DefaultListSelectionModel selectionModel
-
filter
private transient SearchCompiler.Match filter
-
-
Constructor Detail
-
RelationListModel
RelationListModel(javax.swing.DefaultListSelectionModel selectionModel)
-
-
Method Detail
-
clear
public void clear()
Clears the model.
-
sort
public void sort()
Sorts the model usingDefaultNameFormatter
relation comparator.
-
setRelations
public void setRelations(java.util.Collection<? extends IRelation<?>> relations)
-
addRelations
public void addRelations(java.util.Collection<? extends OsmPrimitive> addedPrimitives)
Add all relations inaddedPrimitives
to the model for the relation list dialog- Parameters:
addedPrimitives
- the collection of added primitives. May include nodes, ways, and relations.
-
removeRelations
public void removeRelations(java.util.Collection<? extends OsmPrimitive> removedPrimitives)
Removes all relations inremovedPrimitives
from the model- Parameters:
removedPrimitives
- the removed primitives. May include nodes, ways, and relations
-
updateFilteredRelations
private void updateFilteredRelations()
-
setFilter
public void setFilter(SearchCompiler.Match filter)
-
getVisibleRelations
private java.util.List<IRelation<?>> getVisibleRelations()
-
getVisibleRelation
private IRelation<?> getVisibleRelation(int index)
-
getElementAt
public IRelation<?> getElementAt(int index)
-
getSize
public int getSize()
-
getSelectedRelations
public java.util.List<IRelation<?>> getSelectedRelations()
Replies the list of selected relations. Empty list, if there are no selected relations.- Returns:
- the list of selected, non-new relations.
- Since:
- 13957 (signature)
-
setSelectedRelations
public void setSelectedRelations(java.util.Collection<? extends IRelation<?>> sel)
Sets the selected relations.- Parameters:
sel
- the list of selected relations- Since:
- 13957 (signature)
-
updateTitle
public void updateTitle()
Update the title for the relation list dialog
-
-