Class LayerManager
- java.lang.Object
-
- oracle.spatial.network.nfe.vis.maps.core.LayerManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.lang.Iterable<Layer>,java.util.Collection<Layer>,java.util.EventListener,EditChangeListener,SelectionListener
public class LayerManager extends java.lang.Object implements java.util.Collection<Layer>, EditChangeListener, SelectionListener, java.beans.PropertyChangeListener
Contains and manages all the Layers to be displayed by the MapCanvas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLayerManager.Entry
-
Field Summary
Fields Modifier and Type Field Description protected MapCanvascanvasprotected java.util.HashMap<Layer,oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>>entriesprotected oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>headerprotected javax.swing.event.EventListenerListlistenerListprotected java.util.TreeMap<java.lang.Integer,oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>>positionStartMapprotected java.beans.PropertyChangeSupportpropChangeSupport
-
Constructor Summary
Constructors Constructor Description LayerManager(MapCanvas canvas)LayerManager(MapCanvas canvas, java.util.Collection<? extends Layer> lm)Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Layer layer)Inserts the specified layer at the end of this list.booleanadd(Layer layer, java.lang.Integer position)Inserts the specified layer at the end of the specified position in this list.booleanaddAll(java.util.Collection<? extends Layer> c)voidaddChangeListener(javax.swing.event.ChangeListener l)voidaddEditChangeListener(EditChangeListener l)booleanaddFirst(Layer layer)Inserts the specified layer at the begining of this list.booleanaddFirst(Layer layer, java.lang.Integer position)Inserts the specified layer at the begining of the specified position in this list.booleanaddLast(Layer layer)Inserts the specified layer at the end of this list.booleanaddLast(Layer layer, java.lang.Integer position)Inserts the specified layer at the end of the specified position in this list.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)voidaddPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)voidaddSelectionListener(SelectionListener l)voidclear()voidclearAllHover()voidclearAllSelections()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)java.util.Iterator<LayerManager.Entry>descendingEntryIterator()java.util.Iterator<Layer>descendingLayerIterator()voideditStateChanged(javax.swing.event.ChangeEvent e)Invoked when the layer has changed as a result of editing it's objectsjava.util.Iterator<LayerManager.Entry>entryIterator()java.util.ListIterator<LayerManager.Entry>entryIterator(java.lang.Integer position)java.util.ListIterator<LayerManager.Entry>entryIterator(Layer layer)booleanequals(java.lang.Object o)LayerManagerfilterSet(Filter<Layer> filter)LayerManagerfilterSet(Filter<Layer> filter, int stopAt)LayerManagerfilterSetByTags(java.lang.String[] tags)protected voidfireEditStateChanged(javax.swing.event.ChangeEvent evt)protected voidfireSelectionChanged(SelectionEvent evt)protected voidfireStateChanged(javax.swing.event.ChangeEvent event)Layerget(int i)Gets the layer at the given positionjava.util.List<GeoObject>getAllSelections()LayergetFirst()Returns the first layer from this list, ornullif this list is empty.LayergetFirst(java.lang.Integer position)Returns the first layer from the specified position in the list, ornullif there are no layers at that position.LayergetLast()Returns the last layer from this list, ornullif this list is empty.LayergetLast(java.lang.Integer position)Returns the last layer from the specified position in the list, ornullif there are no layers at that position.LayergetLayerByName(java.lang.String name)LayergetLayerByPosition(java.lang.Integer position)LayergetLayerByTag(java.lang.String tag)MapCanvasgetMapCanvas()java.lang.IntegergetPosition(Layer layer)Gets the layer positionjava.beans.PropertyChangeListener[]getPropertyChangeListeners()java.beans.PropertyChangeListener[]getPropertyChangeListeners(java.lang.String propertyName)java.util.Collection<java.lang.String>getTags(Layer layer)Returns the layer tagsLayerManagerheadSet(java.lang.Integer toPosition)LayerManagerheadSet(java.lang.Integer toPosition, boolean inclusive)booleanisEmpty()java.util.Iterator<Layer>iterator()java.util.Iterator<Layer>layerIterator()java.util.ListIterator<Layer>layerIterator(java.lang.Integer position)java.util.ListIterator<Layer>layerIterator(Layer layer)java.lang.IntegermoveDown(Layer layer, boolean crossPositions)java.lang.IntegermoveUp(Layer layer, boolean crossPositions)voidpropertyChange(java.beans.PropertyChangeEvent evt)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)voidremoveChangeListener(javax.swing.event.ChangeListener l)voidremoveEditChangeListener(EditChangeListener l)LayerremoveFirst()Removes and returns the first layer from this list, ornullif this list is empty.LayerremoveFirst(java.lang.Integer position)Removes and returns the first layer from the specified position in the list, ornullif there are no layers at that position.LayerremoveLast()Removes and returns the last layer from this list, ornullif this list is empty.LayerremoveLast(java.lang.Integer position)Removes and returns the last layer from the specified position in the list, ornullif there are no layers at that position.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)voidremovePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)voidremoveSelectionListener(SelectionListener l)booleanretainAll(java.util.Collection<?> c)voidselectionChanged(SelectionEvent evt)This method is called when a selection event is fired.voidsetMapCanvas(MapCanvas canvas)java.lang.IntegersetPositionFirst(Layer layer, java.lang.Integer position)java.lang.IntegersetPositionLast(Layer layer, java.lang.Integer position)intsize()LayerManagersubSet(java.lang.Integer fromPosition, boolean fromInclusive, java.lang.Integer toPosition, boolean toInclusive)LayerManagersubSet(java.lang.Integer fromPosition, java.lang.Integer toPosition)booleantag(Layer layer, java.lang.String tag)Adds a a tag to the given layerbooleantag(Layer layer, java.lang.String[] tags)Adds tags to the given layerLayerManagertailSet(java.lang.Integer fromPosition)LayerManagertailSet(java.lang.Integer fromPosition, boolean inclusive)Layer[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()For debugging purposesorg.w3c.dom.ElementtoXMLElement()booleanuntag(java.lang.String tag)Removes the given tag from all the layersbooleanuntag(Layer layer, java.lang.String tag)Removes the tag from the given layerbooleanuntag(Layer layer, java.lang.String[] tags)Removes tags from the given layer-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
canvas
protected MapCanvas canvas
-
positionStartMap
protected java.util.TreeMap<java.lang.Integer,oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>> positionStartMap
-
entries
protected java.util.HashMap<Layer,oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>> entries
-
header
protected oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer> header
-
listenerList
protected javax.swing.event.EventListenerList listenerList
-
propChangeSupport
protected java.beans.PropertyChangeSupport propChangeSupport
-
-
Constructor Detail
-
LayerManager
public LayerManager(MapCanvas canvas)
-
-
Method Detail
-
add
public boolean add(Layer layer)
Inserts the specified layer at the end of this list. If the list is not empty the layer will be assigned the same position of the layer previously at the end, or the default position of 1 if the list was empty.This method is equivalent to
addLast(Layer)- Specified by:
addin interfacejava.util.Collection<Layer>- Parameters:
layer- layer to be inserted- Returns:
- true (as specified by
Collection.add(E))
-
add
public boolean add(Layer layer, java.lang.Integer position)
Inserts the specified layer at the end of the specified position in this list. If there are other layers with the same position, this will be placed after them.This method is equivalent to
addLast(Layer, Integer)- Parameters:
layer- layer to be insertedposition- position at the end of which the specified layer is to be inserted- Returns:
-
addFirst
public boolean addFirst(Layer layer)
Inserts the specified layer at the begining of this list. If the list is not empty the layer will be assigned the same position of the layer previously at the begining, or the default position of 1 if the list was empty.- Parameters:
layer- layer to be inserted- Returns:
- true (as specified by
Collection.add(E))
-
addFirst
public boolean addFirst(Layer layer, java.lang.Integer position)
Inserts the specified layer at the begining of the specified position in this list. If there are other layers with the same position, this will be placed before them.- Parameters:
layer- layer to be insertedposition- position at the begining of which the specified layer is to be inserted- Returns:
- true (as specified by
Collection.add(E))
-
addLast
public boolean addLast(Layer layer)
Inserts the specified layer at the end of this list. If the list is not empty the layer will be assigned the same position of the layer previously at the end, or the default position of 1 if the list was empty.- Parameters:
layer- layer to be inserted- Returns:
- true (as specified by
Collection.add(E))
-
addLast
public boolean addLast(Layer layer, java.lang.Integer position)
Inserts the specified layer at the end of the specified position in this list. If there are other layers with the same position, this will be placed after them.- Parameters:
layer- layer to be insertedposition- position at the end of which the specified layer is to be inserted- Returns:
- true (as specified by
Collection.add(E))
-
removeFirst
public Layer removeFirst()
Removes and returns the first layer from this list, ornullif this list is empty.- Returns:
- the first layer from this list or
nullif empty
-
removeFirst
public Layer removeFirst(java.lang.Integer position)
Removes and returns the first layer from the specified position in the list, ornullif there are no layers at that position.- Returns:
- the first layer at the position or
null
-
removeLast
public Layer removeLast()
Removes and returns the last layer from this list, ornullif this list is empty.- Returns:
- the last layer from this list or
nullif empty
-
removeLast
public Layer removeLast(java.lang.Integer position)
Removes and returns the last layer from the specified position in the list, ornullif there are no layers at that position.- Returns:
- the last layer at the position or
null
-
get
public Layer get(int i)
Gets the layer at the given position- Parameters:
i-- Returns:
-
getFirst
public Layer getFirst()
Returns the first layer from this list, ornullif this list is empty.- Returns:
- the first layer from this list or
nullif empty
-
getFirst
public Layer getFirst(java.lang.Integer position)
Returns the first layer from the specified position in the list, ornullif there are no layers at that position.- Returns:
- the first layer at the position or
null
-
getLast
public Layer getLast()
Returns the last layer from this list, ornullif this list is empty.- Returns:
- the last layer from this list or
nullif empty
-
getLast
public Layer getLast(java.lang.Integer position)
Returns the last layer from the specified position in the list, ornullif there are no layers at that position.- Returns:
- the last layer at the position or
null
-
addAll
public boolean addAll(java.util.Collection<? extends Layer> c)
- Specified by:
addAllin interfacejava.util.Collection<Layer>
-
tag
public boolean tag(Layer layer, java.lang.String tag)
Adds a a tag to the given layer- Parameters:
layer-tag-- Returns:
-
tag
public boolean tag(Layer layer, java.lang.String[] tags)
Adds tags to the given layer- Parameters:
layer-tags-- Returns:
-
untag
public boolean untag(java.lang.String tag)
Removes the given tag from all the layers- Parameters:
tag-- Returns:
-
untag
public boolean untag(Layer layer, java.lang.String tag)
Removes the tag from the given layer- Parameters:
layer-tag-- Returns:
-
untag
public boolean untag(Layer layer, java.lang.String[] tags)
Removes tags from the given layer- Parameters:
layer-tags-- Returns:
-
getPosition
public java.lang.Integer getPosition(Layer layer)
Gets the layer position- Parameters:
layer-- Returns:
-
getTags
public java.util.Collection<java.lang.String> getTags(Layer layer)
Returns the layer tags- Parameters:
layer-- Returns:
-
setPositionFirst
public java.lang.Integer setPositionFirst(Layer layer, java.lang.Integer position)
-
setPositionLast
public java.lang.Integer setPositionLast(Layer layer, java.lang.Integer position)
-
moveUp
public java.lang.Integer moveUp(Layer layer, boolean crossPositions)
-
moveDown
public java.lang.Integer moveDown(Layer layer, boolean crossPositions)
-
filterSet
public LayerManager filterSet(Filter<Layer> filter, int stopAt)
-
filterSet
public LayerManager filterSet(Filter<Layer> filter)
-
filterSetByTags
public LayerManager filterSetByTags(java.lang.String[] tags)
-
getLayerByTag
public Layer getLayerByTag(java.lang.String tag)
-
getLayerByName
public Layer getLayerByName(java.lang.String name)
-
getLayerByPosition
public Layer getLayerByPosition(java.lang.Integer position)
-
entryIterator
public java.util.ListIterator<LayerManager.Entry> entryIterator(java.lang.Integer position)
-
layerIterator
public java.util.ListIterator<Layer> layerIterator(java.lang.Integer position)
-
entryIterator
public java.util.ListIterator<LayerManager.Entry> entryIterator(Layer layer)
-
entryIterator
public java.util.Iterator<LayerManager.Entry> entryIterator()
-
layerIterator
public java.util.Iterator<Layer> layerIterator()
-
descendingEntryIterator
public java.util.Iterator<LayerManager.Entry> descendingEntryIterator()
-
descendingLayerIterator
public java.util.Iterator<Layer> descendingLayerIterator()
-
iterator
public java.util.Iterator<Layer> iterator()
-
subSet
public LayerManager subSet(java.lang.Integer fromPosition, boolean fromInclusive, java.lang.Integer toPosition, boolean toInclusive)
-
subSet
public LayerManager subSet(java.lang.Integer fromPosition, java.lang.Integer toPosition)
-
headSet
public LayerManager headSet(java.lang.Integer toPosition)
-
headSet
public LayerManager headSet(java.lang.Integer toPosition, boolean inclusive)
-
tailSet
public LayerManager tailSet(java.lang.Integer fromPosition)
-
tailSet
public LayerManager tailSet(java.lang.Integer fromPosition, boolean inclusive)
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Collection<Layer>- Overrides:
equalsin classjava.lang.Object
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<Layer>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<Layer>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAllin interfacejava.util.Collection<Layer>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection<Layer>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
removein interfacejava.util.Collection<Layer>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAllin interfacejava.util.Collection<Layer>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAllin interfacejava.util.Collection<Layer>
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<Layer>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfacejava.util.Collection<Layer>
-
clearAllHover
public void clearAllHover()
-
clearAllSelections
public void clearAllSelections()
-
getAllSelections
public java.util.List<GeoObject> getAllSelections()
-
toXMLElement
public org.w3c.dom.Element toXMLElement()
-
toString
public java.lang.String toString()
For debugging purposes- Overrides:
toStringin classjava.lang.Object- Returns:
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
-
selectionChanged
public void selectionChanged(SelectionEvent evt)
Description copied from interface:SelectionListenerThis method is called when a selection event is fired.- Specified by:
selectionChangedin interfaceSelectionListener
-
addSelectionListener
public void addSelectionListener(SelectionListener l)
-
removeSelectionListener
public void removeSelectionListener(SelectionListener l)
-
fireSelectionChanged
protected void fireSelectionChanged(SelectionEvent evt)
-
editStateChanged
public void editStateChanged(javax.swing.event.ChangeEvent e)
Description copied from interface:EditChangeListenerInvoked when the layer has changed as a result of editing it's objects- Specified by:
editStateChangedin interfaceEditChangeListener- Parameters:
e- a ChangeEvent object
-
addEditChangeListener
public void addEditChangeListener(EditChangeListener l)
-
removeEditChangeListener
public void removeEditChangeListener(EditChangeListener l)
-
fireEditStateChanged
protected void fireEditStateChanged(javax.swing.event.ChangeEvent evt)
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
-
fireStateChanged
protected void fireStateChanged(javax.swing.event.ChangeEvent event)
-
getMapCanvas
public MapCanvas getMapCanvas()
-
setMapCanvas
public void setMapCanvas(MapCanvas canvas)
-
-