/*---------------- FILE HEADER --------------------------------------- This file is part of Geoide. Copyright (C) 2005-2006 by: IDgis B.V. http://www.idgis.nl This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact: Herman Assink IDgis bv P.O. Box 15 7450 AA Holten The Netherlands E-Mail: herman.assink@idgis.nl * @version 1.4.0 * @author IDgis team * ------------------------------------------------------------------------*/ import nl.idgis.giclient.framework.bars.ButtonBarConfig; import nl.idgis.giclient.framework.bars.Position; import nl.idgis.giclient.framework.bars.PositionConfig; import nl.idgis.giclient.config.Colors; import nl.idgis.giclient.util.Debug; import nl.idgis.giclient.framework.buttons.GIButtonConfig; import nl.idgis.giclient.GIClient; import nl.idgis.giclient.framework.GIComponent; import nl.idgis.giclient.framework.buttons.ModeButtonConfig; import nl.idgis.giclient.modes.Mode; import nl.idgis.giclient.framework.MultiPaneComponent; import nl.idgis.giclient.framework.buttons.PaneButtonConfig; import nl.idgis.giclient.framework.SinglePaneComponent; import nl.idgis.giclient.util.URLTools; import nl.idgis.giclient.io.XMLServer; import nl.idgis.giclient.util.XMLTools; import nl.idgis.giclient.timeanimation.AnimationConfig; import nl.idgis.giclient.framework.buttons.ActionButtonConfig; import nl.idgis.giclient.util.Strings; class nl.idgis.giclient.GIClientConfig { private var giClient:GIClient = null; private var clientType:String = null; private var frameClass:String = null; private var buttonBarClass:String = null; private var rootNode:XMLNode = null; private var xmlServer:XMLServer = null; private var giContextURL:String = ""; private var guiConfigURL:String = ""; private var srsURL:String = ""; private var stringsURLS:Array = null; private var giServerURL:String = ""; private var giServerServletName:String = ""; private var giApplication:String = ""; private var giButtonConfigs:Array = null; private var mvModes:Array = null; private var buttonBarConfigs:Array = null; private var giComponents:Array = null; private var multiFeatureEdit:Boolean = false; private var animConfig:AnimationConfig = null; private var language = null; function GIClientConfig(giClient:GIClient) { this.giClient = giClient; if(_root["language"] != null) { language = _root["language"]; } else { language = System.capabilities.language; } if(_root["guiconfig"] != undefined) { guiConfigURL = _root["guiconfig"]; } else { guiConfigURL = "GIClientConfig.xml"; } stringsURLS = new Array(); giButtonConfigs = new Array(); buttonBarConfigs = new Array(); mvModes = new Array(); giComponents = new Array(); var xml:XML = new XML(); xml.ignoreWhite = true; var env:GIClientConfig = this; xml.onLoad = function(successful:Boolean) { if ((successful) && (this.firstChild != null)) { env.onLoadXML(this.firstChild); } else { _root.frameWork.state// ("Could not parse the client configuration file.", 0); (Strings.getFile("Api").getString("cantInterpretCall"), 0); } }; // Makes sure that the nl.idgis.giclient.GIClientConfig.xml is always searched for in the same path as the client, even if the html application is in another domain than the client. if(guiConfigURL.indexOf(":", 0) == -1) { xml.load(URLTools.getGIClientPath() + "/" + guiConfigURL); } else { xml.load(guiConfigURL); } } function onLoadXML(rootNode:XMLNode):Void { this.rootNode = rootNode; this.multiFeatureEdit = XMLTools.getBooleanValue("MultiFeatureEdit", rootNode); if (this.multiFeatureEdit == null) this.multiFeatureEdit = true; //default value this.clientType = XMLTools.getStringValue("Type", rootNode); if (this.clientType == null) this.clientType = "Normal"; //default value this.frameClass = XMLTools.getStringValue("FrameClass", rootNode); this.buttonBarClass = XMLTools.getStringValue("ButtonBarClass", rootNode); if (this.frameClass == null) this.frameClass = "Frame"; //default value if (this.buttonBarClass == null) this.buttonBarClass = "ButtonBar"; //default value var lang:String = XMLTools.getStringValue("Language", rootNode); if(lang != null) this.language = lang; loadDebugStatementsLevel(rootNode); loadColors(rootNode); //loadGIServerConfig(rootNode); loadGIContext(rootNode); loadSRSURL(rootNode); loadStringsURLS(rootNode); loadAnimationConfig(rootNode); loadActionButtonConfigs(rootNode); loadModeButtonConfigs(rootNode); loadPaneButtonConfigs(rootNode); loadModes(rootNode); loadButtonBars(rootNode); loadSinglePaneComponents(rootNode); loadMultiPaneComponents(rootNode); System.security.allowDomain(_root.scriptAccessDomain); // Allows the html application in another domain to use SetProperty on the client. giClient.onLoadGIClientConfig(); } private function loadColors(rootNode:XMLNode):Void { var colorsNode:XMLNode = XMLTools.getChild("Colors", rootNode); Colors.setColors(colorsNode); } private function loadDebugStatementsLevel(rootNode:XMLNode):Void { var debugStatementsLevel:Number = XMLTools.getNumberValue("DebugStatementsLevel", rootNode); Debug.setStatementsLevel(debugStatementsLevel); } private function loadAnimationConfig(rootNode:XMLNode):Void { var animationNode:XMLNode = XMLTools.getChild("Animation", rootNode); if (animationNode != null) { this.animConfig = new AnimationConfig(animationNode); } } function getAnimationConfig():AnimationConfig { return this.animConfig; } private function loadGIContext(rootNode:XMLNode):Void { var giContextNode:XMLNode = XMLTools.getChild("GIContext", rootNode); giContextURL = giContextNode.firstChild.toString(); } private function loadSRSURL(rootNode:XMLNode):Void { var srsNode:XMLNode = XMLTools.getChild("SRSInfo", rootNode); srsURL = srsNode.firstChild.toString(); if(srsURL == null || srsURL.length == 0) _root.frameWork.state( //"No SRSInfo url given", 0); Strings.getFile("Api").getString("noSRSUrlGiven"), 0); } private function loadStringsURLS(rootNode:XMLNode):Void { var stringsNode:XMLNode = XMLTools.getChild("Strings", rootNode); var languageNode:XMLNode = XMLTools.getChild(language, stringsNode); if(languageNode == null) languageNode = XMLTools.getChild("en", stringsNode); var files:Array = XMLTools.getChildNodes("File", languageNode); for(var i:Number = 0; i < files.length; i++) { var name:String = XMLTools.getStringValue("Name", files[i]); var url:String = XMLTools.getStringValue("Location", files[i]); stringsURLS.push(name); stringsURLS.push(url); } } /*private function loadGIServerConfig(rootNode:XMLNode):Void { var giServerNode:XMLNode = XMLTools.getChild("GIServer", rootNode); var alwaysUseConfig:Boolean = XMLTools.getBooleanValue("AlwaysUseConfig", giServerNode); if ((_root._url.substring(0, 4).toUpperCase() == "HTTP") && (!alwaysUseConfig)) { giServerURL = _root._url.substring(0, _root._url.lastIndexOf("/")); } else { giServerURL = XMLTools.getStringValue("URL", giServerNode); } giServerServletName = XMLTools.getStringValue("ServletName", giServerNode); giApplication = XMLTools.getStringValue("Application", giServerNode); xmlServer = new XMLServer(getServerURLPrefix()); var hostName:String = giServerURL.substring(giServerURL.indexOf("//") + 2); hostName = hostName.substring(0, hostName.indexOf("/")); if (hostName.indexOf(":") != -1) { hostName = hostName.substring(0, hostName.indexOf(":")); } System.security.allowDomain(hostName); // Allows the map layers's graphics to fire ready events. System.security.allowDomain(_root.scriptAccessDomain); // Allows the html application in another domain to use SetProperty on the client. }*/ private function loadActionButtonConfigs(rootNode:XMLNode):Void { var actionButtonsNode:XMLNode = XMLTools.getChild("ActionButtons", rootNode); var actionButtonNodes:Array = XMLTools.getChildNodes("ActionButton", actionButtonsNode); var node:XMLNode = null; var name:String = null; //trace("actionButtonNodes.length = " + actionButtonNodes.length); for (var i:Number = 0; i < actionButtonNodes.length; i++) { node = actionButtonNodes[i]; name = XMLTools.getStringValue("Name", node); var labelTextNode:XMLNode = null; var labelText:String = null; var toolTipTextNode:XMLNode = null; var toolTipText:String = null; var baseURL:String = ""; var iconURL:String = null; var actionClass:String = null; var actionButtonConfig:ActionButtonConfig = null; labelTextNode = XMLTools.getChild("Label", node); if(labelTextNode != null) { labelText = XMLTools.getStringValue(language, labelTextNode); if(labelText == null) { labelText = XMLTools.getStringValue("en", labelTextNode); } } toolTipTextNode = XMLTools.getChild("ToolTipText", node); toolTipText = XMLTools.getStringValue(language, toolTipTextNode); if(toolTipText == null) { toolTipText = XMLTools.getStringValue("en", toolTipTextNode); } baseURL = XMLTools.getStringValue("BaseURL", node); iconURL = XMLTools.getStringValue("IconURL", node); actionClass = XMLTools.getStringValue("Action", node); //trace("name = " + name + " labelText = " + labelText + " toolTipText = " + toolTipText + " baseURL = " + baseURL + " iconURL = " + iconURL + " actionClass = " + actionClass); actionButtonConfig = new ActionButtonConfig(name, labelText, toolTipText, baseURL, iconURL, actionClass); giButtonConfigs.push(actionButtonConfig); } } private function loadModeButtonConfigs(rootNode:XMLNode):Void { var modeButtonsNode:XMLNode = XMLTools.getChild("ModeButtons", rootNode); var modeButtonNodes:Array = XMLTools.getChildNodes("ModeButton", modeButtonsNode); if (modeButtonsNode == null) { modeButtonsNode = XMLTools.getChild("MapViewerButtons", rootNode); modeButtonNodes = XMLTools.getChildNodes("MapViewerButton", modeButtonsNode); } var node:XMLNode = null; var name:String = null; var labelTextNode:XMLNode = null; var labelText:String = null; var toolTipTextNode:XMLNode = null; var toolTipText:String = null; var baseURL:String = ""; var iconURL:String = null; var modeButtonConfig:ModeButtonConfig = null; //trace("modeButtonNodes.length = " + modeButtonNodes.length); for (var i:Number = 0; i < modeButtonNodes.length; i++) { node = modeButtonNodes[i]; name = XMLTools.getStringValue("Name", node); labelTextNode = XMLTools.getChild("Label", node); if(labelTextNode != null) { labelText = XMLTools.getStringValue(language, labelTextNode); if(labelText == null) { labelText = XMLTools.getStringValue("en", labelTextNode); } } toolTipTextNode = XMLTools.getChild("ToolTipText", node); toolTipText = XMLTools.getStringValue(language, toolTipTextNode); if(toolTipText == null) { toolTipText = XMLTools.getStringValue("en", toolTipTextNode); } baseURL = XMLTools.getStringValue("BaseURL", node); iconURL = XMLTools.getStringValue("IconURL", node); //trace("name = " + name + " labelText = " + labelText + " toolTipText = " + toolTipText + " baseURL = " + baseURL + " iconURL = " + iconURL); modeButtonConfig = new ModeButtonConfig(name,labelText,toolTipText, baseURL, iconURL); giButtonConfigs.push(modeButtonConfig); } } private function loadPaneButtonConfigs(rootNode:XMLNode):Void { var paneButtonsNode:XMLNode = XMLTools.getChild("PaneButtons", rootNode); var paneButtonNodes:Array = XMLTools.getChildNodes("PaneButton", paneButtonsNode); var node:XMLNode = null; var name:String = null; var toolTipTextNode:XMLNode = null; var toolTipText:String = null; var baseURL:String = ""; var iconURL:String = null; var labelTextNode:XMLNode = null; var labelText:String = null; var labelPlacement:String = null; var paneButtonConfig:PaneButtonConfig = null; //trace("paneButtonNodes.length = " + paneButtonNodes.length); for (var i:Number = 0; i < paneButtonNodes.length; i++) { node = paneButtonNodes[i]; name = XMLTools.getStringValue("Name", node); toolTipTextNode = XMLTools.getChild("ToolTipText", node); toolTipText = XMLTools.getStringValue(language, toolTipTextNode); if(toolTipText == null) { toolTipText = XMLTools.getStringValue("en", toolTipTextNode); } baseURL = XMLTools.getStringValue("BaseURL", node); iconURL = XMLTools.getStringValue("IconURL", node); labelTextNode = XMLTools.getChild("Label", node); if(labelTextNode != null) { labelText = XMLTools.getStringValue(language, labelTextNode); if(labelText == null) { labelText = XMLTools.getStringValue("en", labelTextNode); } } labelPlacement = XMLTools.getStringValue("LabelPlacement", node); //trace("name = " + name + " labelText = " + labelText + " toolTipText = " + toolTipText + " baseURL = " + baseURL + " iconURL = " + iconURL); paneButtonConfig = new PaneButtonConfig(name, labelText, toolTipText, baseURL, iconURL); if ((labelText != null) && (labelPlacement != null)) { paneButtonConfig.setLabel(labelPlacement); } giButtonConfigs.push(paneButtonConfig); } } private function loadModes(rootNode:XMLNode):Void { var modesNode:XMLNode = XMLTools.getChild("Modes", rootNode); var modeNodes:Array = XMLTools.getChildNodes("Mode", modesNode); var node:XMLNode = null; var name:String = null; var mapViewerButtonNode:XMLNode = null; var mapViewerButtonName:String = null; var modeButtonConfig:ModeButtonConfig = null; var customCursorURL:String = null; var mapViewerActionURL:String = null; var editMode:Boolean = false; var mode:Mode = null; var selectionTypeString:String = null; var selectionType:Number = -1; var targetLayerString:String = null; var targetLayer:Number = -1; for (var i:Number = 0; i < modeNodes.length; i++) { node = modeNodes[i]; name = XMLTools.getStringValue("Name", node); mapViewerButtonNode = XMLTools.getChild("MapViewerButton", node); mapViewerButtonName = XMLTools.getStringValue("name", mapViewerButtonNode); modeButtonConfig = getModeButtonConfig(mapViewerButtonName); customCursorURL = XMLTools.getStringValue("CustomCursorURL", node); mapViewerActionURL = XMLTools.getStringValue("MapViewerActionURL", node); editMode = XMLTools.getBooleanValue("EditMode", node); var contextItemsNode:XMLNode = XMLTools.getChild("ContextMenuItems", node); var contextItemNodes:Array = null; if (contextItemsNode != null) { contextItemNodes = XMLTools.getChildNodes("ContextMenuItem", contextItemsNode); } mode = new Mode(name, customCursorURL, mapViewerActionURL, editMode, contextItemNodes, language); mvModes.push(mode); modeButtonConfig.setMode(mode); } } private function loadButtonBars(rootNode:XMLNode):Void { var buttonBarsNode:XMLNode = XMLTools.getChild("ButtonBars", rootNode); var buttonBarNodes:Array = XMLTools.getChildNodes("ButtonBar", buttonBarsNode); var node:XMLNode = null; var name:String = null; var x:Number = -1; var y:Number = -1; var initVisible:Boolean = false; var buttonSize:Number = -1; var buttonsNode:XMLNode = null; var positionConfigs:Array = null; var positionNode:XMLNode = null; var positionName:String = null; var positionWidth:Number = -1; var positionHeight:Number = -1; var buttonNode:XMLNode = null; var position:Position = null; var buttonName:String = null; var buttonConfig:GIButtonConfig = null; var buttonBarConfig:ButtonBarConfig = null; for (var i:Number = 0; i < buttonBarNodes.length; i++) { node = XMLNode(buttonBarNodes[i]); name = XMLTools.getStringValue("Name", node); x = XMLTools.getNumberValue("X", node); y = XMLTools.getNumberValue("Y", node); initVisible = XMLTools.getBooleanValue("InitVisible", node); buttonSize = XMLTools.getNumberValue("ButtonSize", node); buttonsNode = XMLTools.getChild("Buttons", node); positionConfigs = new Array(); for (var j:Number = 0; buttonsNode.childNodes[j] != null; j++) { positionNode = XMLNode(buttonsNode.childNodes[j]); if (positionNode.nodeName == "Button") { positionName = "Position" + j; positionWidth = buttonSize; positionHeight = buttonSize; buttonNode = positionNode; } else if (positionNode.nodeName == "Position") { positionName = XMLTools.getStringValue("name", positionNode); positionWidth = XMLTools.getNumberValue("Width", positionNode); if (positionWidth == -1) { positionWidth = buttonSize; } positionHeight = XMLTools.getNumberValue("Height", positionNode); if (positionHeight == -1) { positionHeight = buttonSize; } buttonNode = XMLTools.getChild("Button", positionNode); } else { continue; // There may be empty nodes in the child nodes collection. This is because Flash doesn't cope right with end of lines in xml documents. } buttonName = XMLTools.getStringValue("name", buttonNode); buttonConfig = getGIButtonConfig(buttonName); positionConfigs.push(new PositionConfig(positionName, positionWidth, positionHeight, buttonConfig)); } buttonBarConfig = new ButtonBarConfig(name, x, y, buttonSize, positionConfigs, this, buttonBarClass); buttonBarConfigs.push(buttonBarConfig); if (initVisible) { _root.frameWork.addButtonBar(buttonBarConfig); } } } private function loadSinglePaneComponents(rootNode:XMLNode):Void { var singlePaneComponentsNode:XMLNode = XMLTools.getChild("SinglePaneComponents", rootNode); var singlePaneComponentNodes:Array = XMLTools.getChildNodes("SinglePaneComponent", singlePaneComponentsNode); var node:XMLNode = null; var name:String = ""; var url:String = ""; var contentUrlNode:XMLNode = null; var contentUrl:String = ""; var titleNode:XMLNode = null; var title:String = ""; var scrollable:Boolean = false; var resizable:Boolean = false; var closeable:Boolean = false; var lightColor:Number = -1; var darkColor:Number = -1; var transparent:Boolean = false; var x:Number = -1; var y:Number = -1; var width:String = ""; var height:String = ""; var initVisible:Boolean = false; var adapters:String = null; var paneButtonNode:XMLNode = null; var paneButtonName:String = null; var paneButtonConfig:PaneButtonConfig = null; var buttonsNode:XMLNode = null; var buttonNode:XMLNode = null; var buttonName:String = null; var singlePaneComponent:SinglePaneComponent = null; for (var i:Number = 0; i < singlePaneComponentNodes.length; i++) { var giButtonConfigs:Array = new Array(); node = singlePaneComponentNodes[i]; name = XMLTools.getStringValue("Name", node); url = XMLTools.getStringValue("URL", node); contentUrlNode = XMLTools.getChild("contentUrl", node); contentUrl = XMLTools.getStringValue(language, contentUrlNode); if(contentUrl == null) contentUrl = XMLTools.getStringValue("en", contentUrlNode); titleNode = XMLTools.getChild("Title", node); title = XMLTools.getStringValue(language, titleNode); if(title == null) title = XMLTools.getStringValue("en", titleNode); scrollable = XMLTools.getBooleanValue("Scrollable", node); resizable = XMLTools.getBooleanValue("Resizable", node); closeable = XMLTools.getBooleanValue("Closeable", node); lightColor = XMLTools.getNumberValue("LightColor", node); darkColor = XMLTools.getNumberValue("DarkColor", node); transparent = XMLTools.getBooleanValue("Transparent", node); x = XMLTools.getNumberValue("X", node); y = XMLTools.getNumberValue("Y", node); width = XMLTools.getStringValue("Width", node); height = XMLTools.getStringValue("Height", node); initVisible = XMLTools.getBooleanValue("InitVisible", node); adapters = XMLTools.getStringValue("Adapters", node); paneButtonNode = XMLTools.getChild("PaneButton", node); paneButtonName = XMLTools.getStringValue("name", paneButtonNode); paneButtonConfig = getPaneButtonConfig(paneButtonName); buttonsNode = XMLTools.getChild("Buttons", node); var buttonNodes:Array = XMLTools.getChildNodes("Button", buttonsNode); for (var j:Number = 0; j < buttonNodes.length; j++) { buttonName = XMLTools.getStringValue("name", buttonNodes[j]); var giButtonConfig:GIButtonConfig = getGIButtonConfig(buttonName); if (giButtonConfig!=null){ giButtonConfigs.push(giButtonConfig); } } singlePaneComponent = new SinglePaneComponent(name, paneButtonConfig, giButtonConfigs, url,contentUrl, title, scrollable, resizable, closeable,lightColor, darkColor, transparent, x, y, width, height, initVisible, frameClass); if (adapters != null) { singlePaneComponent.setAdapters(adapters); } giComponents.push(singlePaneComponent); } } private function loadMultiPaneComponents(rootNode:XMLNode):Void { var multiPaneComponentsNode:XMLNode = XMLTools.getChild("MultiPaneComponents", rootNode); var multiPaneComponentNodes:Array = XMLTools.getChildNodes("MultiPaneComponent", multiPaneComponentsNode); var node:XMLNode = null; var name:String = ""; var url:String = ""; var titleNode:XMLNode = null; var title:String = ""; var scrollable:Boolean = false; var resizable:Boolean = false; var closeable:Boolean = false; var lightColor:Number = -1; var darkColor:Number = -1; var transparent:Boolean = false; var x:Number = -1; var y:Number = -1; var width:String = ""; var height:String = ""; var adapters:String = null; var multiPaneComponent:MultiPaneComponent = null; for (var i:Number = 0; i < multiPaneComponentNodes.length; i++) { node = multiPaneComponentNodes[i]; name = XMLTools.getStringValue("Name", node); url = XMLTools.getStringValue("URL", node); titleNode = XMLTools.getChild("Title", node); title = XMLTools.getStringValue(language, titleNode); if(title == null) title = XMLTools.getStringValue("en", titleNode); scrollable = XMLTools.getBooleanValue("Scrollable", node); resizable = XMLTools.getBooleanValue("Resizable", node); closeable = XMLTools.getBooleanValue("Closeable", node); lightColor = XMLTools.getNumberValue("LightColor", node); darkColor = XMLTools.getNumberValue("DarkColor", node); transparent = XMLTools.getBooleanValue("Transparent", node); x = XMLTools.getNumberValue("X", node); y = XMLTools.getNumberValue("Y", node); width = XMLTools.getStringValue("Width", node); height = XMLTools.getStringValue("Height", node); adapters = XMLTools.getStringValue("Adapters", node); multiPaneComponent = new MultiPaneComponent(name, url, title, scrollable, resizable, closeable, lightColor, darkColor, transparent, x, y, width, height); if (adapters != null) { multiPaneComponent.setAdapters(adapters); } giComponents.push(multiPaneComponent); } } //function getXMLServer():XMLServer { // return xmlServer; //} //function getServerPath():String { // return giServerURL + "/"; //} /*function getServerURLPrefix():String { if (giApplication == null) { return giServerURL + "/" + giServerServletName + "?"; } else { return giServerURL + "/" + giServerServletName + "?App=" + giApplication + "&"; } }*/ function getContextURL():String { return giContextURL; } function getSRSURL():String { return srsURL; } function getStringsURLS():Array { return stringsURLS; } function getButtonConfigs():Array { return giButtonConfigs; } function getActionButtonConfigs():Array { var giButtonConfig:GIButtonConfig = null; var actionButtonConfigs:Array = new Array(); for (var i:Number = 0; i < giButtonConfigs.length; i++) { giButtonConfig = GIButtonConfig(giButtonConfigs[i]); if (giButtonConfig instanceof ActionButtonConfig) { actionButtonConfigs.push(giButtonConfig); } } return actionButtonConfigs; } function getModeButtonConfigs():Array { var giButtonConfig:GIButtonConfig = null; var modeButtonConfigs:Array = new Array(); for (var i:Number = 0; i < giButtonConfigs.length; i++) { giButtonConfig = GIButtonConfig(giButtonConfigs[i]); if (giButtonConfig instanceof ModeButtonConfig) { modeButtonConfigs.push(giButtonConfig); } } return modeButtonConfigs; } function getPaneButtonConfigs():Array { var giButtonConfig:GIButtonConfig = null; var paneButtonConfigs:Array = new Array(); for (var i:Number = 0; i < giButtonConfigs.length; i++) { giButtonConfig = GIButtonConfig(giButtonConfigs[i]); if (giButtonConfig instanceof PaneButtonConfig) { paneButtonConfigs.push(giButtonConfig); } } return paneButtonConfigs; } function getGIButtonConfig(name:String):GIButtonConfig { var giButtonConfig:GIButtonConfig = null; for (var i:Number = 0; i < giButtonConfigs.length; i++) { giButtonConfig = giButtonConfigs[i]; if (giButtonConfig.getName() == name) { return giButtonConfig; break; } } return null; } function getModeButtonConfig(name:String):ModeButtonConfig { var giButtonConfig:GIButtonConfig = null; var modeButtonConfig:ModeButtonConfig = null; for (var i:Number = 0; i < giButtonConfigs.length; i++) { giButtonConfig = GIButtonConfig(giButtonConfigs[i]); if ((giButtonConfig instanceof ModeButtonConfig) && (giButtonConfig.getName() == name)) { modeButtonConfig = ModeButtonConfig(giButtonConfig); return modeButtonConfig; } } return null; } function getPaneButtonConfig(name:String):PaneButtonConfig { var giButtonConfig:GIButtonConfig = null; var paneButtonConfig:PaneButtonConfig = null; for (var i:Number = 0; i < giButtonConfigs.length; i++) { giButtonConfig = GIButtonConfig(giButtonConfigs[i]); if ((giButtonConfig instanceof PaneButtonConfig) && (giButtonConfig.getName() == name)) { paneButtonConfig = PaneButtonConfig(giButtonConfig); return paneButtonConfig; } } return null; } function getModes():Array { return mvModes; } function getEditModes():Array { var mode:Mode = null; var editModes:Array = new Array(); for (var i:Number = 0; i < mvModes.length; i++) { mode = Mode(mvModes[i]); if (mode.isEditMode()) { editModes.push(mode); } } return editModes; } function getMode(name:String):Mode { var mode:Mode = null; for (var i:String in mvModes) { mode = Mode(mvModes[i]); if (mode.getName() == name) { return mode; } } return null; } function getButtonBarConfig(name:String):ButtonBarConfig { var buttonBarConfig:ButtonBarConfig = null; for (var i:String in buttonBarConfigs) { buttonBarConfig = ButtonBarConfig(buttonBarConfigs[i]); if (buttonBarConfig.getName() == name) { return buttonBarConfig; } } return null; } function getGIComponents():Array { return giComponents; } function getGIComponent(name:String):GIComponent { var giComponent:GIComponent = null; for (var i:String in giComponents) { giComponent = giComponents[i]; if (giComponent.getName() == name) { return giComponent; break; } } return null; } function getType():String { return clientType; } function isMultiFeatureEdit():Boolean { return multiFeatureEdit; } function getLanguage():String { return language; } }