001: /*
002: * uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004,
003: * Refractions Research Inc. This library is free software; you can redistribute it and/or modify it
004: * under the terms of the GNU Lesser General Public License as published by the Free Software
005: * Foundation; version 2.1 of the License. This library is distributed in the hope that it will be
006: * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
007: * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
008: */
009: package net.refractions.udig.project;
010:
011: import org.geotools.feature.Feature;
012:
013: /**
014: * Defines and implements controllers a map. The EditManager is the central piece and has the
015: * following functionality:
016: * <ul>
017: * <li>Controlling transactions</li>
018: * <li>Modifying ContextModel</li>
019: * <li>Creating Layer Objects</li>
020: * </ul>
021: * <p>
022: * Transactions and locks are also part of map core.
023: * </p>
024: *
025: * @author jeichar
026: * @since 0.1
027: */
028: public interface IEditManager {
029:
030: /**
031: * Returns the map this EditManager is associated with
032: *
033: * @return the map this EditManager is associated with
034: */
035: public IMap getMap();
036:
037: /**
038: * Gets the Feature that that is currently being edited.
039: * <p>
040: * Returns null if there is currently no edit feature. This is different from the current
041: * selection. Each layer has a selection that may contain many features but there is only only
042: * feature that can be editted at one time.
043: * </p>
044: *
045: * @return the Feature that that is currently being edited.
046: */
047: public Feature getEditFeature();
048:
049: /**
050: * The layer that contains the edit features. Often feature edit commands will require the layer
051: * that contains the Edit feature so that the feature may be editted.
052: *
053: * @return the layer that contains the edit feature in its feature store.
054: */
055: public ILayer getEditLayer();
056:
057: /**
058: * Indicates whether the editlayer can be changed.
059: *
060: * @return true if the current editlayer is locked and cannot be changed.
061: */
062: public boolean isEditLayerLocked();
063:
064: /**
065: * Returns the layer that is "currently" selected. The workbench is monitored for changes to
066: * selection and this will reflect that layer.
067: *
068: * @return the layer that is "currently" selected
069: */
070: public ILayer getSelectedLayer();
071:
072: /**
073: * Returns true if there is a currently active transaction (editing has occured and not been
074: * committed). false is returned if there is no current transaction. If false is returned it is
075: * understood that no editing is occurring.
076: *
077: * @return Returns true if there is a currently active transaction. false is returned if there
078: * is no current transaction.
079: */
080: public boolean isEditing();
081:
082: /**
083: * Adds a EditManager Listener
084: *
085: * @param listener the new listener.
086: */
087: public void addListener(IEditManagerListener listener);
088:
089: /**
090: * Removes a EditManager Listener
091: *
092: * @param listener the listener to remove
093: */
094: public void removeListener(IEditManagerListener listener);
095:
096: /**
097: * Checks containment of the spesified EditManager listener in the
098: * list of already existing listeners.
099: *
100: * @param listener
101: * @return
102: */
103: public boolean containsListener(IEditManagerListener listener);
104: }
|