/*---------------- 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.actions.Action; import nl.idgis.giclient.actions.ClearFilterAction; import nl.idgis.giclient.actions.ClearSelectionAction; import nl.idgis.giclient.actions.FilterAndZoomAction; import nl.idgis.giclient.actions.FilterFeaturesAction; import nl.idgis.giclient.actions.SelectAndZoomAction; import nl.idgis.giclient.actions.SelectFeaturesByFilterAction; import nl.idgis.giclient.actions.ZoomByFilterAction; import nl.idgis.giclient.actions.ZoomToFilteredFeaturesAction; import nl.idgis.giclient.actions.ZoomToSelectedFeaturesAction; import nl.idgis.giclient.actions.SaveEditsAction; import nl.idgis.giclient.framework.buttons.GIButton; import nl.idgis.giclient.framework.buttons.GIButtonConfig; import nl.idgis.giclient.actions.CancelEditsAction; import nl.idgis.giclient.actions.ZoomToGPSPosition; import nl.idgis.giclient.gis.Layer; import nl.idgis.giclient.actions.RemoveFeatureAction; import nl.idgis.giclient.gps.GPSconnector; import nl.idgis.giclient.actions.CutAction; import nl.idgis.giclient.actions.CutClearAction; import nl.idgis.giclient.actions.CutSaveAction; import nl.idgis.giclient.actions.IntersectAction; import nl.idgis.giclient.actions.ClearUnboundFeatureLayerAction; import nl.idgis.giclient.actions.ZoomToXYAction; import nl.idgis.giclient.actions.CatalogSearchAction; class nl.idgis.giclient.framework.buttons.ActionButtonConfig extends GIButtonConfig { var actionClass:String; function ActionButtonConfig(name:String, labelText:String, toolTipText:String, baseURL:String, iconURL:String, actionClass:String) { super(name, labelText, toolTipText, baseURL, iconURL); this.actionClass = actionClass; } function getActionClass():String{ return actionClass; } function inflate(movieClip:MovieClip, depth:Number, actionObject:Object, initObject:Object):GIButton { if (giButton == null) { if(initObject == null){ initObject = new Object(); } initObject["name"] = name; initObject["label"] = labelText; initObject["toolTipText"] = toolTipText; initObject["baseURL"] = baseURL; initObject["iconURL"] = iconURL; var action:Action; switch( actionClass){ case "CatalogSearchAction" : action = new CatalogSearchAction(ruler); break; case "RemoveFeature" : action = new RemoveFeatureAction(ruler); break; case "ZoomByFilter" : action = new ZoomByFilterAction(ruler,actionObject); break; case "ClearSelection" : action = new ClearSelectionAction(ruler,actionObject); break; case "FilterAndZoom" : action = new FilterAndZoomAction(ruler,actionObject); break; case "SelectAndZoom" : action = new SelectAndZoomAction(ruler,actionObject); break; case "ClearFilter" : action = new ClearFilterAction(ruler,actionObject); break; case "FilterFeatures" : action = new FilterFeaturesAction(ruler,actionObject); break; case "SelectFeaturesByFilter" : action = new SelectFeaturesByFilterAction(ruler,actionObject); break; case "ZoomToSelectedFeatures" : action = new ZoomToSelectedFeaturesAction(ruler,actionObject); break; case "ZoomToFilteredFeatures" : action = new ZoomToFilteredFeaturesAction(ruler,actionObject); break; case "ZoomToXYAction" : action = new ZoomToXYAction(ruler,actionObject); break; //case "Intersect" : //action = new IntersectAction(ruler,actionObject); //break; case "CancelEditsAction" : action = new CancelEditsAction(ruler); break; case "SaveEditsAction" : action = new SaveEditsAction(ruler); break; case "ZoomToGPSPosition" : action = new ZoomToGPSPosition(ruler); break; case "Cut": action = new CutAction(ruler); break; case "CutClear": action = new CutClearAction(ruler); break; case "CutSave": action = new CutSaveAction(ruler); break; case "ClearUnboundFeatureLayerAction": action = new ClearUnboundFeatureLayerAction(ruler); break; default : action = null; } initObject["action"] = action; giButton = GIButton(movieClip.attachMovie("ActionButton", name + "_mc", depth, initObject)); giButton.setGlowing(glowing); if (ruler != null) { giButton.setRuler(ruler); } } return giButton; } }