|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager
public class AutoCompletionManager
AutoCompletionManager holds a cache of keys with a list of possible auto completion values for each key. Each DataSet is assigned one AutoCompletionManager instance such that
Field Summary | |
---|---|
protected boolean |
dirty
If the dirty flag is set true, a rebuild is necessary. |
protected DataSet |
ds
The data set that is managed |
protected static java.util.Set<java.lang.String> |
presetRoleCache
the same as roleCache but for the preset roles can be accessed directly |
protected static MultiMap<java.lang.String,java.lang.String> |
presetTagCache
the same as tagCache but for the preset keys and values can be accessed directly |
protected java.util.Set<java.lang.String> |
roleCache
the cached list of member roles only accessed by getRoleCache(), rebuild() and cacheRelationMemberRoles() use getRoleCache() accessor |
protected MultiMap<java.lang.String,java.lang.String> |
tagCache
the cached tags given by a tag key and a list of values for this tag only accessed by getTagCache(), rebuild() and cachePrimitiveTags() use getTagCache() accessor |
Constructor Summary | |
---|---|
AutoCompletionManager(DataSet ds)
|
Method Summary | |
---|---|
static void |
cachePresets(java.util.Collection<TaggingPreset> presets)
Initialize the cache for presets. |
protected void |
cachePrimitives(java.util.Collection<? extends OsmPrimitive> primitives)
|
protected void |
cachePrimitiveTags(OsmPrimitive primitive)
make sure, the keys and values of all tags held by primitive are in the auto completion cache |
protected void |
cacheRelationMemberRoles(Relation relation)
Caches all member roles of the relation relation |
void |
dataChanged(DataChangedEvent event)
Called after big changes in dataset. |
protected java.util.List<java.lang.String> |
getDataKeys()
replies the keys held by the cache |
protected java.util.List<java.lang.String> |
getDataValues(java.lang.String key)
replies the auto completion values allowed for a specific key. |
java.util.List<AutoCompletionListItem> |
getKeys()
Returns the currently cached tag keys. |
java.util.List<java.lang.String> |
getMemberRoles()
Replies the list of member roles |
protected java.util.List<java.lang.String> |
getPresetKeys()
|
protected static java.util.List<java.lang.String> |
getPresetValues(java.lang.String key)
|
protected java.util.Set<java.lang.String> |
getRoleCache()
|
protected MultiMap<java.lang.String,java.lang.String> |
getTagCache()
|
java.util.List<AutoCompletionListItem> |
getValues(java.util.List<java.lang.String> keys)
Returns the currently cached tag values for a given list of tag keys. |
java.util.List<AutoCompletionListItem> |
getValues(java.lang.String key)
Returns the currently cached tag values for a given tag key. |
void |
nodeMoved(NodeMovedEvent event)
A node's coordinates were modified. |
void |
otherDatasetChange(AbstractDatasetChangedEvent event)
Minor dataset change, currently only changeset id changed is supported, but can be extended in future. |
void |
populateWithKeys(AutoCompletionList list)
Populates the an AutoCompletionList with the currently cached
tag keys |
void |
populateWithMemberRoles(AutoCompletionList list)
Populates the an AutoCompletionList with the currently cached
member roles. |
void |
populateWithTagValues(AutoCompletionList list,
java.util.List<java.lang.String> keys)
Populates the an AutoCompletionList with the currently cached
values for some given tags |
void |
populateWithTagValues(AutoCompletionList list,
java.lang.String key)
Populates the an AutoCompletionList with the currently cached
values for a tag |
void |
primitivesAdded(PrimitivesAddedEvent event)
Implementation of the DataSetListener interface |
void |
primitivesRemoved(PrimitivesRemovedEvent event)
A bunch of primitives were removed from the DataSet, or preexisting primitives were marked as deleted. |
protected void |
rebuild()
initializes the cache from the primitives in the dataset |
void |
relationMembersChanged(RelationMembersChangedEvent event)
A relation's members have changed. |
void |
tagsChanged(TagsChangedEvent event)
There was some change in the tag set of a primitive. |
void |
wayNodesChanged(WayNodesChangedEvent event)
A way's node list was changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean dirty
protected DataSet ds
protected MultiMap<java.lang.String,java.lang.String> tagCache
protected static final MultiMap<java.lang.String,java.lang.String> presetTagCache
protected java.util.Set<java.lang.String> roleCache
protected static final java.util.Set<java.lang.String> presetRoleCache
Constructor Detail |
---|
public AutoCompletionManager(DataSet ds)
Method Detail |
---|
protected MultiMap<java.lang.String,java.lang.String> getTagCache()
protected java.util.Set<java.lang.String> getRoleCache()
protected void rebuild()
protected void cachePrimitives(java.util.Collection<? extends OsmPrimitive> primitives)
protected void cachePrimitiveTags(OsmPrimitive primitive)
primitive
- an OSM primitiveprotected void cacheRelationMemberRoles(Relation relation)
relation
relation
- the relationpublic static void cachePresets(java.util.Collection<TaggingPreset> presets)
protected java.util.List<java.lang.String> getDataKeys()
protected java.util.List<java.lang.String> getPresetKeys()
protected java.util.List<java.lang.String> getDataValues(java.lang.String key)
getKeys()
.
key
-
protected static java.util.List<java.lang.String> getPresetValues(java.lang.String key)
public java.util.List<java.lang.String> getMemberRoles()
public void populateWithMemberRoles(AutoCompletionList list)
AutoCompletionList
with the currently cached
member roles.
list
- the list to populatepublic void populateWithKeys(AutoCompletionList list)
AutoCompletionList
with the currently cached
tag keys
list
- the list to populatepublic void populateWithTagValues(AutoCompletionList list, java.lang.String key)
AutoCompletionList
with the currently cached
values for a tag
list
- the list to populatekey
- the tag keypublic void populateWithTagValues(AutoCompletionList list, java.util.List<java.lang.String> keys)
AutoCompletionList
with the currently cached
values for some given tags
list
- the list to populatekeys
- the tag keyspublic java.util.List<AutoCompletionListItem> getKeys()
public java.util.List<AutoCompletionListItem> getValues(java.lang.String key)
key
- the tag key
public java.util.List<AutoCompletionListItem> getValues(java.util.List<java.lang.String> keys)
keys
- the tag keys
public void primitivesAdded(PrimitivesAddedEvent event)
primitivesAdded
in interface DataSetListener
public void primitivesRemoved(PrimitivesRemovedEvent event)
DataSetListener
primitivesRemoved
in interface DataSetListener
public void tagsChanged(TagsChangedEvent event)
DataSetListener
tagsChanged
in interface DataSetListener
public void nodeMoved(NodeMovedEvent event)
DataSetListener
nodeMoved
in interface DataSetListener
public void wayNodesChanged(WayNodesChangedEvent event)
DataSetListener
wayNodesChanged
in interface DataSetListener
public void relationMembersChanged(RelationMembersChangedEvent event)
DataSetListener
relationMembersChanged
in interface DataSetListener
public void otherDatasetChange(AbstractDatasetChangedEvent event)
DataSetListener
otherDatasetChange
in interface DataSetListener
public void dataChanged(DataChangedEvent event)
DataSetListener
#dataChanged()
is called.
dataChanged
in interface DataSetListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |