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 class
LayerManager.Entry
-
Field Summary
Fields Modifier and Type Field Description protected MapCanvas
canvas
protected java.util.HashMap<Layer,oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>>
entries
protected oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>
header
protected javax.swing.event.EventListenerList
listenerList
protected java.util.TreeMap<java.lang.Integer,oracle.spatial.network.nfe.vis.maps.core.LayerManager.LinkedEntry<java.lang.Integer,Layer>>
positionStartMap
protected java.beans.PropertyChangeSupport
propChangeSupport
-
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 boolean
add(Layer layer)
Inserts the specified layer at the end of this list.boolean
add(Layer layer, java.lang.Integer position)
Inserts the specified layer at the end of the specified position in this list.boolean
addAll(java.util.Collection<? extends Layer> c)
void
addChangeListener(javax.swing.event.ChangeListener l)
void
addEditChangeListener(EditChangeListener l)
boolean
addFirst(Layer layer)
Inserts the specified layer at the begining of this list.boolean
addFirst(Layer layer, java.lang.Integer position)
Inserts the specified layer at the begining of the specified position in this list.boolean
addLast(Layer layer)
Inserts the specified layer at the end of this list.boolean
addLast(Layer layer, java.lang.Integer position)
Inserts the specified layer at the end of the specified position in this list.void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
void
addSelectionListener(SelectionListener l)
void
clear()
void
clearAllHover()
void
clearAllSelections()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
java.util.Iterator<LayerManager.Entry>
descendingEntryIterator()
java.util.Iterator<Layer>
descendingLayerIterator()
void
editStateChanged(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)
boolean
equals(java.lang.Object o)
LayerManager
filterSet(Filter<Layer> filter)
LayerManager
filterSet(Filter<Layer> filter, int stopAt)
LayerManager
filterSetByTags(java.lang.String[] tags)
protected void
fireEditStateChanged(javax.swing.event.ChangeEvent evt)
protected void
fireSelectionChanged(SelectionEvent evt)
protected void
fireStateChanged(javax.swing.event.ChangeEvent event)
Layer
get(int i)
Gets the layer at the given positionjava.util.List<GeoObject>
getAllSelections()
Layer
getFirst()
Returns the first layer from this list, ornull
if this list is empty.Layer
getFirst(java.lang.Integer position)
Returns the first layer from the specified position in the list, ornull
if there are no layers at that position.Layer
getLast()
Returns the last layer from this list, ornull
if this list is empty.Layer
getLast(java.lang.Integer position)
Returns the last layer from the specified position in the list, ornull
if there are no layers at that position.Layer
getLayerByName(java.lang.String name)
Layer
getLayerByPosition(java.lang.Integer position)
Layer
getLayerByTag(java.lang.String tag)
MapCanvas
getMapCanvas()
java.lang.Integer
getPosition(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 tagsLayerManager
headSet(java.lang.Integer toPosition)
LayerManager
headSet(java.lang.Integer toPosition, boolean inclusive)
boolean
isEmpty()
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.Integer
moveDown(Layer layer, boolean crossPositions)
java.lang.Integer
moveUp(Layer layer, boolean crossPositions)
void
propertyChange(java.beans.PropertyChangeEvent evt)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
void
removeChangeListener(javax.swing.event.ChangeListener l)
void
removeEditChangeListener(EditChangeListener l)
Layer
removeFirst()
Removes and returns the first layer from this list, ornull
if this list is empty.Layer
removeFirst(java.lang.Integer position)
Removes and returns the first layer from the specified position in the list, ornull
if there are no layers at that position.Layer
removeLast()
Removes and returns the last layer from this list, ornull
if this list is empty.Layer
removeLast(java.lang.Integer position)
Removes and returns the last layer from the specified position in the list, ornull
if there are no layers at that position.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
void
removeSelectionListener(SelectionListener l)
boolean
retainAll(java.util.Collection<?> c)
void
selectionChanged(SelectionEvent evt)
This method is called when a selection event is fired.void
setMapCanvas(MapCanvas canvas)
java.lang.Integer
setPositionFirst(Layer layer, java.lang.Integer position)
java.lang.Integer
setPositionLast(Layer layer, java.lang.Integer position)
int
size()
LayerManager
subSet(java.lang.Integer fromPosition, boolean fromInclusive, java.lang.Integer toPosition, boolean toInclusive)
LayerManager
subSet(java.lang.Integer fromPosition, java.lang.Integer toPosition)
boolean
tag(Layer layer, java.lang.String tag)
Adds a a tag to the given layerboolean
tag(Layer layer, java.lang.String[] tags)
Adds tags to the given layerLayerManager
tailSet(java.lang.Integer fromPosition)
LayerManager
tailSet(java.lang.Integer fromPosition, boolean inclusive)
Layer[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
For debugging purposesorg.w3c.dom.Element
toXMLElement()
boolean
untag(java.lang.String tag)
Removes the given tag from all the layersboolean
untag(Layer layer, java.lang.String tag)
Removes the tag from the given layerboolean
untag(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:
add
in 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, ornull
if this list is empty.- Returns:
- the first layer from this list or
null
if empty
-
removeFirst
public Layer removeFirst(java.lang.Integer position)
Removes and returns the first layer from the specified position in the list, ornull
if 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, ornull
if this list is empty.- Returns:
- the last layer from this list or
null
if empty
-
removeLast
public Layer removeLast(java.lang.Integer position)
Removes and returns the last layer from the specified position in the list, ornull
if 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, ornull
if this list is empty.- Returns:
- the first layer from this list or
null
if empty
-
getFirst
public Layer getFirst(java.lang.Integer position)
Returns the first layer from the specified position in the list, ornull
if 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, ornull
if this list is empty.- Returns:
- the last layer from this list or
null
if empty
-
getLast
public Layer getLast(java.lang.Integer position)
Returns the last layer from the specified position in the list, ornull
if 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:
addAll
in 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:
equals
in interfacejava.util.Collection<Layer>
- Overrides:
equals
in classjava.lang.Object
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<Layer>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<Layer>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<Layer>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<Layer>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<Layer>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<Layer>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<Layer>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<Layer>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in 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:
toString
in classjava.lang.Object
- Returns:
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in 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:SelectionListener
This method is called when a selection event is fired.- Specified by:
selectionChanged
in 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:EditChangeListener
Invoked when the layer has changed as a result of editing it's objects- Specified by:
editStateChanged
in 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)
-
-