com.esri.map
Class LayerInfo

java.lang.Object
  extended by com.esri.map.LayerInfo
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
WmsLayerInfo

public class LayerInfo
extends Object
implements Serializable

Holds meta-data about sub-layers of a dynamic layer and allows users to control the visibility of those sub-layers.

See Also:
Serialized Form

Field Summary
protected  int _id
          Index of the layer.
protected  String _name
          Name of the layer.
 
Constructor Summary
LayerInfo(String name, int id, boolean isVisible)
          Instantiates an object of ArcGISLayer.
 
Method Summary
 void addLayer(LayerInfo layer)
          Adds a child layer.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a property change listener.
protected  void firePropertyChanged(String propertyName, Object oldValue, Object newValue)
          Fire property changed.
 LayerInfo getChildLayer(int index)
          Gets a child of this layer by index.
 int getChildLayerIndex(LayerInfo child)
          Gets the index of the given child layer if it exists.
 String getDisplayName()
          Get the layer's display name.
 int getId()
          Gets the id.
 String getName()
          Gets the name.
 LayerInfo getParent()
          Gets the parent.
 HashMap<String,LayerInfo> getSubLayerInfos()
          Gets all sub-layers of this layer.
 boolean isVisible()
          Checks if is visible.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a property change listener.
protected  void resumeEvents()
          Resume events.
 void setParent(LayerInfo parent)
          Sets the parent.
 void setVisible(boolean visible)
          Sets the visible.
protected  void suspendEvents()
          Suspend events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected String _name
Name of the layer.


_id

protected int _id
Index of the layer.

Constructor Detail

LayerInfo

public LayerInfo(String name,
                 int id,
                 boolean isVisible)
Instantiates an object of ArcGISLayer.

Parameters:
name - the name of the layer
id - the index of the layer.
isVisible - the is visible
Method Detail

getSubLayerInfos

public HashMap<String,LayerInfo> getSubLayerInfos()
Gets all sub-layers of this layer.

Returns:
the sub layer information

addLayer

public void addLayer(LayerInfo layer)
Adds a child layer.

Parameters:
layer - the layer to add

isVisible

public boolean isVisible()
Checks if is visible.

Returns:
true if visible

setVisible

public void setVisible(boolean visible)
Sets the visible.

Parameters:
visible - true to set visible

getName

public String getName()
Gets the name.

Returns:
the name

getDisplayName

public String getDisplayName()
Get the layer's display name.

Returns:
the display name

getId

public int getId()
Gets the id.

Returns:
the id

getParent

public LayerInfo getParent()
Gets the parent.

Returns:
the parent

setParent

public void setParent(LayerInfo parent)
Sets the parent.

Parameters:
parent - the new parent

getChildLayer

public LayerInfo getChildLayer(int index)
Gets a child of this layer by index.

Parameters:
index - of child layer
Returns:
the matching child layer or null if it doesn't exist

getChildLayerIndex

public int getChildLayerIndex(LayerInfo child)
Gets the index of the given child layer if it exists. If the given layer cannot be found, -1 will be returned.

Parameters:
child - to return index of
Returns:
index of child layer or -1 if not found

addPropertyChangeListener

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

Parameters:
listener - the listener

removePropertyChangeListener

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

Parameters:
listener - the listener

suspendEvents

protected void suspendEvents()
Suspend events.


resumeEvents

protected void resumeEvents()
Resume events.


firePropertyChanged

protected void firePropertyChanged(String propertyName,
                                   Object oldValue,
                                   Object newValue)
Fire property changed.

Parameters:
propertyName - the property name
oldValue - the old value
newValue - the new value


Copyright © 2012. All Rights Reserved.