arcgissamples\scenario\toc\LayerNode.java
/* Copyright 2010 ESRI * * All rights reserved under the copyright laws of the United States * and applicable international laws, treaties, and conventions. * * You may freely redistribute and use this sample code, with or * without modification, provided you include the original copyright * notice and use restrictions. * * See the use restrictions. * */ package arcgissamples.scenario.toc; /**Class which defines the layer node * */ public class LayerNode extends Node { private static final long serialVersionUID = 1L; // map to which this layer belongs. String parentMapFrame; int ID; String layerName; boolean visible; public LayerNode() { super(); } public LayerNode(int ID, String layerName, boolean visible) { this(ID, layerName, "", visible, false); } public LayerNode(int ID, String layerName, String parentMapFrame, boolean visible, boolean allowsChildren) { super(layerName, allowsChildren); this.ID = ID; this.layerName = layerName; this.parentMapFrame = parentMapFrame; this.visible = visible; } /**Method to get layername associated with this node. * @return layer name */ public String getLayerName() { return layerName; } /**Method to get layer id. * @return layer id */ public int getLayerID() { return ID; } /**Sets the name of the map to which this layer belongs. * @param name String */ public void setParentMapFrame(String name) { parentMapFrame = name; } /**Method which returns the parent of this layer * @return */ public String getParentDataFrame() { return parentMapFrame; } /**String value of this object. * @see java.lang.Object#toString(); * @return String */ public String toString() { return layerName; } /** Checks visibility of this layer * @return boolean */ public boolean isVisible() { return visible; } /**Sets the visibility of this layer * @param value boolean */ public void setVisible(boolean value) { visible = value; } }