001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation;
009: * version 2.1 of the License.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: */
016: package org.geotools.event;
017:
018: /**
019: * Provides support for Parent/Child relationships for the event system.
020: * <p>
021: * Several of the GeoTools objects are produced in reference to
022: * specifications, in particular XML based specifications. Often
023: * we try and match the same abstractions present in a specification
024: * like SLD or Filter. But rather then make use of pure Java Beans, and
025: * make user interface code responsible for managing a host of listeners
026: * we are providing a single set of listeners located at the object
027: * matching the document base.
028: * <p>
029: * For more Details:
030: * <ul>
031: * <li>This design is similar to EMF, or JFace use (aka borrow code examples)
032: * <li>Not specific to Documents, the Catalog api will use these events
033: * <li>We do try and match the document structure perfectly for Feature/FeatureCollection/GML
034: * (so that the same XPath expressions can be respected). FeatureCollection and
035: * Feature have their own well explored structure and issues and will not be using
036: * this event system. Given the size of FeatureCollections it is not practicle for each
037: * child to "know" its parent.
038: * </ul>
039: * <p>
040: * @author Jody Garnett
041: *
042: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/event/GTComponent.java $
043: */
044: public interface GTComponent {
045: /**
046: * Used to locate our parent.
047: * <p>
048: * This method will return a "NULLObject", called GTRoot.NO_PARENT when
049: * no parent is present, client code should never have to be concerned
050: * this method return <code>null</code>.
051: * @deprecated use getNote().getParent()
052: * @return Parent GTComponent or GTRoot.NO_PARENT if none
053: */
054: GTComponent getParent();
055:
056: // /**
057: // * Used to set the parent, and associated placement information.
058: // *
059: // * @param newParent GTComponent or NULLGTRoot if none
060: // */
061: // void setParent(GTComponent newParent );
062: //
063: // /** Indicate name used during notification */
064: // public void setNotificationName( String name );
065: // /** Indicate name used during notification */
066: // public String getNotificationName();
067: // /** Indicate name position used during notification */
068: // public void setNotificationPosition( int index );
069: // /** Indicate position used during notification */
070: // public int getNotificationPosition();
071:
072: /**
073: * Small stratagy object passed in by our parent so we can call home.
074: * Used to pass change information "up" to our parent, to root parent
075: * will broadcast the events out to listeners.
076: */
077: public GTNote getNote();
078:
079: /**
080: * Small stratagy object passed in by our parent so we can call home.
081: * Used to pass change information "up" to our parent, to root parent
082: * will broadcast the events out to listeners.
083: * @param container
084: */
085: public void setNote(GTNote container);
086:
087: /**
088: * A child has been removed, issued before change.
089: * <p>
090: * This method is for use by children <b>only</b> it is implementor
091: * API and should not be called by client code.
092: * </p>
093: * Q:Why does it exist then?<br>
094: * So you can implement your own Symbolizer,
095: * and still allow the GeoTools Stroke implementation to pass change
096: * notification onto you.
097: * </p>
098: * <p>
099: * Q:GeoAPI does not support this?
100: * No they don't, their interface are set up to match specification
101: * for interoptability between toolkit implementations. By the time
102: * you pass a GeoAPI object around it should stop wiggling and just be
103: * viewed as stable data. But yes we should ask them about this...
104: * </p>
105: */
106: void removed(GTDelta delta);
107:
108: /**
109: * A child has been changed (maybe added), issued after change.
110: * <p>
111: * This method is for use by children <b>only</b> it is implementor
112: * API and should not be called by client code.
113: * </p>
114: * Q:Why does it exist then?<br>
115: * So you can implement your own Symbolizer,
116: * and still allow the GeoTools Stroke implementation to pass change
117: * notification onto you.
118: * </p>
119: * <p>
120: * Q:GeoAPI does not support this?
121: * No they don't, their interface are set up to match specification
122: * for interoptability between toolkit implementations. By the time
123: * you pass a GeoAPI object around it should stop wiggling and just be
124: * viewed as stable data. But yes we should ask them about this...
125: * </p>
126: */
127: void changed(GTDelta delta);
128: }
|