com.moximedia.ows
Class Folder

java.lang.Object
  extended bycom.moximedia.ows.Folder
All Implemented Interfaces:
java.io.Serializable

public class Folder
extends java.lang.Object
implements java.io.Serializable

Folders are used to organize layers in the IMF. A folder can contain layers, be set to be opened or closed, and has a name. The Folder object is one of a group of folders that can be added to an Folders object.

Author:
Doug Cates
See Also:
Serialized Form

Field Summary
protected static int NEXT_FOLDER_ID
           
 
Constructor Summary
Folder()
          Creates new Folder
Folder(java.lang.String folderName)
          Creates new Folder with a specified name
Folder(java.lang.String folderName, boolean isOpen)
          Creates new Folder with a name and initial state
 
Method Summary
 void addFolder(Folder folder)
          Adds a folder to the folder.
 void addGroup(LayerGroup group)
          Adds a layer group to the folder.
 void addLayer(java.lang.Object layer)
          Adds a layer to the folder.
 boolean canSetVisibilityOff()
          Returns an indicator of whether the user can set the folder's visibility to off.
 boolean canSetVisibilityOn()
          Returns an indicator of whether the user can set the folder's visibility to on.
 boolean controlsSubfolderVisibility()
          Returns an indicator of whether the subfolder's visibility is also changed when the user can set the folder's visibility.
 Folder getFolderByName(java.lang.String name)
          Gets the folder with the specified name that is contained in this folder or any of it's subfolders.
 Folder getFolderByObjectId(int objectId)
          Gets the folder with the specified object id that is contained in this folder or any of it's subfolders.
 Folders getFolders()
          Gets the folders that are subfolders of this folder
 LayerGroup getLayerGroupByObjectId(int objectId)
          Gets the layer group with the specified object id that is contained in this folder or any of it's subfolders.
 Layers getLayers()
          Returns the layers contained in the folder in an Layers object.
 int getLevel()
          Gets the nesting level of this folder.
 java.lang.String getMetadataUrl()
          Gets the URL for metadata associated with this folder.
 java.lang.String getName()
          Returns a String containing the folder name.
 int getObjectId()
          Returns the IMF internal id for this folder.
 java.util.ArrayList getObjects()
          Returns the layers and groups contained in the folder in a ArrayList object.
 boolean hasLayerListLegends(double scale)
          Returns an indicator of whether this folder or any subfolders have layer list legends for the specified scale.
 boolean isClosed()
          Returns the current open/closed state of the folder.
 boolean isOpen()
          Returns the current open/closed state of the folder.
 boolean isRadio()
          Returns whether the folder is a radio folder where only one layer or group can be turned on at a time.
 void removeLayerByName(java.lang.String name)
          Removes layers with the specified name from this folder.
 void removeLayerByTitle(java.lang.String title)
          Removes layers with the specified title from this folder.
 void setClosed()
          Sets the open/closed state of the folder to open.
 void setIsRadio(boolean isRadio)
          Sets whether the folder is a radio folder.
 void setLevel(int level)
          Sets the nesting level of the folder.
 void setMetadataUrl(java.lang.String href)
          Sets the URL for metadata associated with this folder.
 void setOpen()
          Sets the open/closed state of the folder to open.
 void setOpen(boolean isOpen)
          Sets the open/closed state of the folder.
 void setVisible(boolean isVisible)
          Sets the visibility of all the layers or layer groups in the folder, respecting the canSetVisibility and controlSubfolderVisibility settings of this folder and subfolders.
 void setXmlAttribute(java.lang.String tag, java.lang.String name, java.lang.String value, java.lang.String frameworkPath, java.lang.String mapConfigPath)
          Sets one of the attributes of this object using a string value.
 void toggle()
          Toggles the open/closed state of the folder.
 java.lang.String toString()
          Returns a text representation of of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEXT_FOLDER_ID

protected static int NEXT_FOLDER_ID
Constructor Detail

Folder

public Folder()
Creates new Folder


Folder

public Folder(java.lang.String folderName)
Creates new Folder with a specified name

Parameters:
folderName - The name of the folder

Folder

public Folder(java.lang.String folderName,
              boolean isOpen)
Creates new Folder with a name and initial state

Parameters:
folderName - The name of the folder
isOpen - True if the folder should be open, otherwise false
Method Detail

getMetadataUrl

public java.lang.String getMetadataUrl()
Gets the URL for metadata associated with this folder.

Returns:
The URL of the metadata, or null.

setMetadataUrl

public void setMetadataUrl(java.lang.String href)
Sets the URL for metadata associated with this folder.

Parameters:
href - The URL of the metadata, or null.

canSetVisibilityOn

public boolean canSetVisibilityOn()
Returns an indicator of whether the user can set the folder's visibility to on. This controls the visibility of the icon in the layer list in the IMF interface.

Returns:
True if the user can set the folder's visibility, otherwise false.

canSetVisibilityOff

public boolean canSetVisibilityOff()
Returns an indicator of whether the user can set the folder's visibility to off. This controls the visibility of the icon in the layer list in the IMF interface.

Returns:
True if the user can set the folder's visibility, otherwise false.

controlsSubfolderVisibility

public boolean controlsSubfolderVisibility()
Returns an indicator of whether the subfolder's visibility is also changed when the user can set the folder's visibility.

Returns:
True if the subfolders visibility is also changed, otherwise false.

setVisible

public void setVisible(boolean isVisible)
Sets the visibility of all the layers or layer groups in the folder, respecting the canSetVisibility and controlSubfolderVisibility settings of this folder and subfolders.

Parameters:
isVisible - True if the content should be turned on, otherwise false.

getFolderByName

public Folder getFolderByName(java.lang.String name)
Gets the folder with the specified name that is contained in this folder or any of it's subfolders.

Parameters:
name - The name of the folder to search for.
Returns:
The folder, or null if the folder isn't found.

getFolderByObjectId

public Folder getFolderByObjectId(int objectId)
Gets the folder with the specified object id that is contained in this folder or any of it's subfolders.

Parameters:
objectId - The object id of the folder to search for.
Returns:
The folder, or null if the folder isn't found.

getLayerGroupByObjectId

public LayerGroup getLayerGroupByObjectId(int objectId)
Gets the layer group with the specified object id that is contained in this folder or any of it's subfolders.

Parameters:
objectId - The object id of the layer group to search for.
Returns:
The layer group, or null if the folder isn't found.

getObjectId

public int getObjectId()
Returns the IMF internal id for this folder.

Returns:
The internal id for the folder.

setLevel

public void setLevel(int level)
Sets the nesting level of the folder.

Parameters:
level - The depth of the folder in nested folders.

getLevel

public int getLevel()
Gets the nesting level of this folder.

Returns:
The depth of the folder in nested folders.

addLayer

public void addLayer(java.lang.Object layer)
Adds a layer to the folder.

Parameters:
layer - A Layer.

addFolder

public void addFolder(Folder folder)
Adds a folder to the folder.

Parameters:
folder - A folder to add to the folder.

addGroup

public void addGroup(LayerGroup group)
Adds a layer group to the folder.

Parameters:
group - A group to add to the folder.

getFolders

public Folders getFolders()
Gets the folders that are subfolders of this folder

Returns:
The folders, or null if there are no subfolders.

getLayers

public Layers getLayers()
Returns the layers contained in the folder in an Layers object.

Returns:
A Layers object containing the layers in the folder.

hasLayerListLegends

public boolean hasLayerListLegends(double scale)
Returns an indicator of whether this folder or any subfolders have layer list legends for the specified scale.

Parameters:
scale - The scale to check for.
Returns:
True if any legends, otherwise false.

getObjects

public java.util.ArrayList getObjects()
Returns the layers and groups contained in the folder in a ArrayList object.

Returns:
An ArrayList object containing the layers and groups in the folder.

getName

public java.lang.String getName()
Returns a String containing the folder name.

Returns:
The name of the folder.

isOpen

public boolean isOpen()
Returns the current open/closed state of the folder.

Returns:
True if open, false if closed.

isRadio

public boolean isRadio()
Returns whether the folder is a radio folder where only one layer or group can be turned on at a time.

Returns:
True if it is a radio folder, false if not.

isClosed

public boolean isClosed()
Returns the current open/closed state of the folder.

Returns:
True if closed, false if open.

setOpen

public void setOpen(boolean isOpen)
Sets the open/closed state of the folder.

Parameters:
isOpen - True to open the folder, false to close.

setOpen

public void setOpen()
Sets the open/closed state of the folder to open.


setIsRadio

public void setIsRadio(boolean isRadio)
Sets whether the folder is a radio folder.

Parameters:
isRadio - True if the folder is a radio folder, otherwise false.

setClosed

public void setClosed()
Sets the open/closed state of the folder to open.


toggle

public void toggle()
Toggles the open/closed state of the folder.


toString

public java.lang.String toString()
Returns a text representation of of this class.

Returns:
A string describing the class

setXmlAttribute

public void setXmlAttribute(java.lang.String tag,
                            java.lang.String name,
                            java.lang.String value,
                            java.lang.String frameworkPath,
                            java.lang.String mapConfigPath)
Sets one of the attributes of this object using a string value. This method should only be called from the SAX event handler.

Parameters:
frameworkPath - The URL path to the IMF installation.
mapConfigPath - The URL path to the map configuration file.
tag - The XML element tag containing this attribute (not used).
name - The XML attribute name.
value - The XML attribute value.

removeLayerByName

public void removeLayerByName(java.lang.String name)
Removes layers with the specified name from this folder.

Parameters:
name - The name of a layer.

removeLayerByTitle

public void removeLayerByTitle(java.lang.String title)
Removes layers with the specified title from this folder.

Parameters:
title - The title of a layer.


Internet Mapping Framework for OpenGIS Java Object Model API (v1.3.007)
Copyright © 2005 Moxi Media Inc. and Province of British Columbia. All Rights Reserved.