Class ChangesetListModel
java.lang.Object
javax.swing.AbstractListModel<E>
javax.swing.DefaultListModel<Changeset>
org.openstreetmap.josm.gui.dialogs.changeset.ChangesetListModel
- All Implemented Interfaces:
Serializable,ListModel<Changeset>,ChangesetCacheListener
- Direct Known Subclasses:
ChangesetInSelectionListModel,ChangesetsInActiveDataLayerListModel
public class ChangesetListModel
extends DefaultListModel<Changeset>
implements ChangesetCacheListener
This is the model that backs a list of changesets
- See Also:
-
Field Summary
FieldsFields inherited from class javax.swing.AbstractListModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionChangesetListModel(DefaultListSelectionModel selectionModel) Creates a newChangesetListModel -
Method Summary
Modifier and TypeMethodDescriptionvoidGets notified on changeset cache updatesgetElementAt(int idx) Gets the IDs of the changesets that are selectedGets the list of changesets that are currently selectedReplies the selected open changesetsintgetSize()booleanReplies true if there is at least one selected open changesetvoidLoads this list with the given changesetsvoidLoads this list with the given changesetsvoidinitFromPrimitives(Collection<? extends OsmPrimitive> primitives) Loads this list with the given changesetsprotected voidsetChangesets(Collection<Changeset> changesets) voidsetSelectedChangesets(Collection<Changeset> changesets) Sets the changesets to selectprotected voidsort()private voidMethods inherited from class javax.swing.DefaultListModel
add, addAll, addAll, addElement, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSizeMethods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Field Details
-
data
-
shownChangesets
-
selectionModel
-
-
Constructor Details
-
ChangesetListModel
Creates a newChangesetListModel- Parameters:
selectionModel- The selection model to use for this list
-
-
Method Details
-
getSelectedChangesets
Gets the list of changesets that are currently selected- Returns:
- The selected changesets
-
getSelectedChangesetIds
Gets the IDs of the changesets that are selected- Returns:
- The selected ids
-
setSelectedChangesets
Sets the changesets to select- Parameters:
changesets- The changesets
-
setChangesets
-
updateModel
-
initFromChangesetIds
Loads this list with the given changesets- Parameters:
ids- The ids of the changesets to display
-
initFromPrimitives
Loads this list with the given changesets- Parameters:
primitives- The primitives of which the changesets should be displayed
-
initFromDataSet
Loads this list with the given changesets- Parameters:
ds- The data set to get all changesets from
-
getElementAt
- Specified by:
getElementAtin interfaceListModel<Changeset>- Overrides:
getElementAtin classDefaultListModel<Changeset>
-
getSize
-
sort
-
hasSelectedOpenChangesets
Replies true if there is at least one selected open changeset- Returns:
- true if there is at least one selected open changeset
-
getSelectedOpenChangesets
Replies the selected open changesets- Returns:
- the selected open changesets
-
changesetCacheUpdated
Description copied from interface:ChangesetCacheListenerGets notified on changeset cache updates- Specified by:
changesetCacheUpdatedin interfaceChangesetCacheListener- Parameters:
event- The event that happened
-