ilog.views.maps.beans
Class IlvMapLayer

java.lang.Object
  extended by ilog.views.maps.beans.IlvMapLayer
All Implemented Interfaces:
IlvPersistentObject

public class IlvMapLayer
extends Object
implements IlvPersistentObject

IlvMapLayer represents a map layer, that is, a cartographic theme. An IlvMapLayer instance encapsulates an IlvManagerLayer object. It can be styled with an IlvMapStyle object. A tree representation of the layers can be displayed using instances of IlvMapLayerTreeNode, IlvMapLayerTreeModel and IlvLayerTree.

Since:
JViews 7.5

Nested Class Summary
static class IlvMapLayer.MapLayerStyleListener
          MapLayerStyleListener is responsible for updating the layer-wide parameters when the layer style changes.
 
Field Summary
static String managerLayerPropertyName
          The name of the manager layer property.
static String namePropertyName
          The name of the layer name property.
static String stylePropertyName
          The name of the style property.
 
Constructor Summary
IlvMapLayer()
          Constructs an empty IlvMapLayer instance.
IlvMapLayer(IlvInputStream stream)
          Reads an IlvMapLayer object from an IlvInputStream.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Adds a property change listener.
 boolean contains(IlvManagerLayer layer)
          Indicates if this layer contains the specified IlvManagerLayer object.
 void dispose()
          Cleans this IlvMapLayer instance.
static IlvMapLayer get(IlvGraphic g)
          Returns the map layer which contains the specified IlvGraphic instance.
static IlvMapLayer get(IlvManagerLayer layer)
          Returns the IlvMapLayer object containing the specified IlvManagerLayer instance or null if the IlvManagerLayer specified does not belong to this layer.
 IlvMapLayer[] getChildren()
          Returns the child list for this IlvMapLayer instance.
 IlvMapDataSource getDataSource()
          Returns the data source associated with this layer.
 IlvManagerView[] getMainViews()
          Returns all the manager views that display the manager of this map layer and are not overviews.
 IlvManager getManager()
          Returns the IlvManager object associated with this layer.
 IlvManagerLayer getManagerLayer()
          Returns the IlvManagerLayer object associated with this layer.
 IlvManagerLayer getManagerLayer(int i)
          Returns the ith IlvManagerLayer object in this layer and its sublayers.
 IlvManagerLayer[] getManagerLayers()
          Returns an array containing the IlvManagerLayer objects contained in this layer and its sublayers.
 int getManagerLayersCount()
          Returns the IlvManagerLayer count.
 String getName()
          Returns the name of this layer.
 IlvMapLayerTreeNode getNode()
          Retrieves the associated IlvMapLayerTreeNode object.
 IlvMapLayer getParent()
          Returns the parent of this IlvMapLayer object.
 IlvMapStyle getStyle()
          Returns the style associated with this layer.
 boolean hasPropertyListener(PropertyChangeListener listener)
          Indicates if this layer has already registered the given listener.
 void insert(IlvManagerLayer layer)
          Inserts an IlvManagerLayer object into this layer.
 boolean isAllowingMoveObjects()
          Indicates if an interactor can or cannot move the objects in this layer.
static void processVisibility(IlvMapLayerTreeNode node, IlvManagerView view)
          This method is public but is only for internal use.
 void removeAll()
          Removes all IlvGraphic objects from the layer.
 void removeAllLayers()
          Removes all manager layers from the map layer and the manager.
 void removeAllObjects()
          Remove all objects contained in all the IlvManagerLayer instance of this layer.
 void removeDataSource(IlvMapDataSource ndataSource)
          Removes the data source associated with this layer.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a property listener.
 void selectAll(boolean select)
          Selects or deselects all the IlvGraphic objects contained in this layer.
 void setAllowingMoveObjects(boolean allow)
          Specifies if moving the objects in this layer is allowed or not.
 void setDataSource(IlvMapDataSource source)
          Sets the data source for this layer.
 void setManager(IlvManager manager)
          Sets the IlvManager object for this layer.
 void setName(String name)
          Sets the name for this layer.
 void setNode(IlvMapLayerTreeNode node)
          Sets the associated IlvMapLayerTreeNode instance.
 void setStyle(IlvMapStyle style)
          Sets the style of this layer.
 void setStyleControl(IlvMapLayerStyleControl styleControl)
          Adds the external object responsible for detecting if the layer content is not valid after the style changes.
 void setVisibleInView(IlvManagerView view, boolean b)
          Controls the visibility of the layer in the view specified.
 void write(IlvOutputStream stream)
          Writes this layer into an IlvOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stylePropertyName

public static final String stylePropertyName
The name of the style property. This is the name of the property that is fired when the style of a layer changes.

See Also:
Constant Field Values

namePropertyName

public static final String namePropertyName
The name of the layer name property. This is the name of the property that is fired when the name of a layer changes.

See Also:
Constant Field Values

managerLayerPropertyName

public static final String managerLayerPropertyName
The name of the manager layer property. This is the name of the property that is fired when the manager layer is set.

See Also:
Constant Field Values
Constructor Detail

IlvMapLayer

public IlvMapLayer(IlvInputStream stream)
            throws IlvReadFileException
Reads an IlvMapLayer object from an IlvInputStream.

Parameters:
stream - The stream to read from.
Throws:
IlvReadFileException - if there is a problem reading from stream.

IlvMapLayer

public IlvMapLayer()
Constructs an empty IlvMapLayer instance.

Method Detail

setStyleControl

public void setStyleControl(IlvMapLayerStyleControl styleControl)
Adds the external object responsible for detecting if the layer content is not valid after the style changes.

Parameters:
styleControl - The external object.

write

public void write(IlvOutputStream stream)
           throws IOException
Writes this layer into an IlvOutputStream.

Specified by:
write in interface IlvPersistentObject
Parameters:
stream - The stream to write to.
Throws:
IOException - if there is a problem writing to stream.

getName

public String getName()
Returns the name of this layer.

Returns:
The name of this layer.

setName

public void setName(String name)
Sets the name for this layer.

Parameters:
name - The layer name.

setNode

public void setNode(IlvMapLayerTreeNode node)
Sets the associated IlvMapLayerTreeNode instance.

Parameters:
node - The associated IlvMapLayerTreeNode instance.

getNode

public IlvMapLayerTreeNode getNode()
Retrieves the associated IlvMapLayerTreeNode object.

Returns:
The associated IlvMapLayerTreeNode object, if one exists.

insert

public void insert(IlvManagerLayer layer)
Inserts an IlvManagerLayer object into this layer. If the manager associated with this layer is non-null, the IlvManagerLayer object is inserted into the manager.

Parameters:
layer - The IlvManagerLayer object to insert.

removeAllLayers

public void removeAllLayers()
Removes all manager layers from the map layer and the manager.


setDataSource

public void setDataSource(IlvMapDataSource source)
Sets the data source for this layer.

Parameters:
source - The data source to set.

removeDataSource

public void removeDataSource(IlvMapDataSource ndataSource)
Removes the data source associated with this layer.

Parameters:
ndataSource - The data source to remove from this layer.

getDataSource

public IlvMapDataSource getDataSource()
Returns the data source associated with this layer.

Returns:
The data source associated with this layer.

setStyle

public void setStyle(IlvMapStyle style)
Sets the style of this layer. When rendering this layer, the style will be set to produce an IlvMapGraphic object if their is one.

Parameters:
style - The style of the layer.

getStyle

public IlvMapStyle getStyle()
Returns the style associated with this layer.

Returns:
The style associated with this layer.

getManagerLayer

public IlvManagerLayer getManagerLayer()
Returns the IlvManagerLayer object associated with this layer.

Returns:
The IlvManagerLayer object associated with this layer.

getManagerLayers

public IlvManagerLayer[] getManagerLayers()
Returns an array containing the IlvManagerLayer objects contained in this layer and its sublayers.

Returns:
The array of IlvManagerLayer objects contained in this layer.

getManagerLayersCount

public int getManagerLayersCount()
Returns the IlvManagerLayer count. This method traverses the subtree to include the child objects.

Returns:
The number of IlvManagerLayer objects contained in this layer.

getManagerLayer

public IlvManagerLayer getManagerLayer(int i)
Returns the ith IlvManagerLayer object in this layer and its sublayers.

Parameters:
i - The index of the IlvManagerLayer object to return.
Returns:
The ith IlvManagerLayer object contained in this layer and its sublayers.

setVisibleInView

public void setVisibleInView(IlvManagerView view,
                             boolean b)
Controls the visibility of the layer in the view specified.

Parameters:
view - The view.
b - Set to true if the layer is to be visible in the view.

contains

public boolean contains(IlvManagerLayer layer)
Indicates if this layer contains the specified IlvManagerLayer object.

Parameters:
layer - The IlvManagerLayer object to check.
Returns:
If the layer contains the specified IlvManagerLayer object, true is returned.

removeAllObjects

public void removeAllObjects()
Remove all objects contained in all the IlvManagerLayer instance of this layer. The IlvManagerLayer object is not removed.


get

public static IlvMapLayer get(IlvGraphic g)
Returns the map layer which contains the specified IlvGraphic instance.

Parameters:
g - The IlvGraphic instance.
Returns:
The map layer that contains g.

get

public static IlvMapLayer get(IlvManagerLayer layer)
Returns the IlvMapLayer object containing the specified IlvManagerLayer instance or null if the IlvManagerLayer specified does not belong to this layer.

Parameters:
layer - The IlvManagerLayer object.
Returns:
The IlvMapLayer containing layer.

isAllowingMoveObjects

public boolean isAllowingMoveObjects()
Indicates if an interactor can or cannot move the objects in this layer. The interactor must check the value returned by this method before moving or not moving objects.

Returns:
Set to true to allow object moving.

setAllowingMoveObjects

public void setAllowingMoveObjects(boolean allow)
Specifies if moving the objects in this layer is allowed or not.

Parameters:
allow - Set to true to allow object moving.

setManager

public void setManager(IlvManager manager)
Sets the IlvManager object for this layer.

Parameters:
manager - The IlvManager to set.

getManager

public IlvManager getManager()
Returns the IlvManager object associated with this layer.

Returns:
The IlvManager object associated with this layer.

removeAll

public void removeAll()
Removes all IlvGraphic objects from the layer.


selectAll

public void selectAll(boolean select)
Selects or deselects all the IlvGraphic objects contained in this layer.

Parameters:
select - Set to true to select all the objects of the layer, set to false to deselect all the objects of this layer.

getParent

public IlvMapLayer getParent()
Returns the parent of this IlvMapLayer object. To have a parent, this layer must have been attached to an IlvMapLayerTreeNode object, and the hierarchy of nodes must have been set up correctly.

Returns:
The parent of this layer or null if the layer is not attached to an IlvMapLayerTreeNode instance or has no parent.

getChildren

public IlvMapLayer[] getChildren()
Returns the child list for this IlvMapLayer instance. To have a child list, this layer must have been attached to an IlvMapLayerTreeNode object and the hierarchy of nodes must have been set up correctly.

Returns:
The array of children for this layer or null if the layer is not attached to an IlvMapLayerTreeNode instance or has no children.

getMainViews

public IlvManagerView[] getMainViews()
Returns all the manager views that display the manager of this map layer and are not overviews.

Returns:
The table of the manager views found.
Since:
JViews 7.5

processVisibility

public static void processVisibility(IlvMapLayerTreeNode node,
                                     IlvManagerView view)
This method is public but is only for internal use.

Parameters:
node -
view -
Since:
JViews 7.5

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Adds a property change listener.

Parameters:
l - The property listener to add.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Removes a property listener.

Parameters:
l - The property listener to remove.

hasPropertyListener

public boolean hasPropertyListener(PropertyChangeListener listener)
Indicates if this layer has already registered the given listener.

Parameters:
listener - The listener to test.
Returns:
If the listener has already been registered, true is returned.

dispose

public void dispose()
Cleans this IlvMapLayer instance. After this call, this IlvMapLayer should not be used anymore.

Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.