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.internal;
010:
011: import java.awt.Color;
012: import java.net.URL;
013: import java.util.List;
014:
015: import net.refractions.udig.catalog.IGeoResource;
016: import net.refractions.udig.catalog.IResolveChangeListener;
017: import net.refractions.udig.core.IBlockingAdaptable;
018: import net.refractions.udig.project.IBlackboard;
019: import net.refractions.udig.project.ILayer;
020: import net.refractions.udig.ui.palette.ColourScheme;
021:
022: import org.eclipse.core.runtime.IAdaptable;
023: import org.eclipse.core.runtime.IProgressMonitor;
024: import org.eclipse.emf.ecore.EObject;
025: import org.eclipse.jface.resource.ImageDescriptor;
026: import org.geotools.data.FeatureEvent;
027: import org.geotools.data.Query;
028: import org.geotools.filter.Filter;
029: import org.geotools.geometry.jts.ReferencedEnvelope;
030: import org.geotools.referencing.crs.DefaultGeographicCRS;
031: import org.opengis.referencing.crs.CoordinateReferenceSystem;
032:
033: /**
034: * Read/Write interface for layers
035: * @author Jesse
036: * @since 1.0.0
037: * @model
038: */
039: public interface Layer extends EObject, ILayer, IAdaptable,
040: IBlockingAdaptable, IResolveChangeListener {
041:
042: /**
043: * <!-- begin-user-doc --> <!-- end-user-doc -->
044: * @generated
045: */
046: String copyright = "uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004, Refractions Research Inc. 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; version 2.1 of the License. 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."; //$NON-NLS-1$
047:
048: /**
049: * Returns the owning ContextModel object
050: *
051: * @return the owning ContextModel object
052: * @model many="false" opposite="layers"
053: */
054: public ContextModel getContextModel();
055:
056: /**
057: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getContextModel <em>Context Model</em>}' container reference.
058: * <!-- begin-user-doc --> TODO: Remove Context Model (1 to 1 relationship
059: * does not added anything) <!-- end-user-doc -->
060: * @param value the new value of the '<em>Context Model</em>' container reference.
061: * @see #getContextModel()
062: * @generated
063: */
064: void setContextModel(ContextModel value);
065:
066: /**
067: * Filter indicating the selected features.
068: * <p>
069: * In order for this value to be useful the layer should be selectable, often a single fid
070: * filter during user edit opperations.
071: * </p>
072: * <p>
073: * Note: Filter.ALL indicates no selected Features. (All features are filtered out)
074: * </p>
075: * <p>
076: * A tool may wish to record the previous Filter, before replacing (or adding to) this value.
077: * </p>
078: * XXX: Consider making use of the General Purpose Blackboard
079: *
080: * @return Filter indicating the selected features. Filter.ALL indicates no selected Features.
081: * @uml.property name="filter"
082: * @model transient="true" dataType="org.geotools.filter.Filter"
083: */
084: Filter getFilter();
085:
086: /**
087: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getFilter <em>Filter</em>}' attribute.
088: * <!-- begin-user-doc --> <!-- end-user-doc -->
089: * @param value the new value of the '<em>Filter</em>' attribute.
090: * @see #getFilter()
091: * @generated
092: */
093: void setFilter(Filter value);
094:
095: /**
096: * Sets the spatial bounds of this layer. This property is normally
097: * derived from the IGeoResourceInfos, but this provides an override. This
098: * will affect the "Zoom to Extent" and "Zoom to Layer" actions.
099: *
100: * @param bounds a ReferencedEnvelope indicating the new bounds for the layer
101: */
102: public void setBounds(ReferencedEnvelope bounds);
103:
104: /**
105: * StyleBlackboard used to persist user supplied appearance settings.
106: * <p>
107: * This method forms part of the EMF model of a Layer, client code should use style(). The
108: * style() method allows access the StyleBlackboard without being troubled by all the model
109: * methods.
110: * </p>
111: *
112: * @see style();
113: * @model many="false" containment="true"
114: */
115: public StyleBlackboard getStyleBlackboard();
116:
117: /**
118: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getStyleBlackboard <em>Style Blackboard</em>}'
119: * containment reference. <!-- begin-user-doc --> Note: The Rendering Process will be restarted
120: * as appearance information changes, this is usual limited to a single Layer. <!-- end-user-doc
121: * -->
122: *
123: * @param value the new value of the '<em>Style Blackboard</em>' containment reference.
124: * @see #getStyleBlackboard()
125: * @generated
126: */
127: void setStyleBlackboard(StyleBlackboard value);
128:
129: public int getZorder();
130:
131: /**
132: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getZorder <em>Zorder</em>}' attribute.
133: * <!-- begin-user-doc --> <!-- end-user-doc -->
134: * @param value the new value of the '<em>Zorder</em>' attribute.
135: * @see #getZorder()
136: * @generated
137: */
138: void setZorder(int value);
139:
140: /**
141: * Indication of Layer status.
142: * <p>
143: * This is used to provide feedback for a Layers rendering status.
144: * </p>
145: *
146: * @return
147: * @uml.property name="status"
148: * @model transient='true' default='0'
149: */
150: public int getStatus();
151:
152: /**
153: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getStatus <em>Status</em>}' attribute.
154: * <!-- begin-user-doc --> Indication of Layer status.
155: * <p>
156: * This is used to provide feedback for a Layers rendering status.
157: * </p>
158: *
159: * @see ILayer#DONE
160: * @see ILayer#ERROR
161: * @see ILayer#MISSING
162: * @see ILayer#UNCONFIGURED
163: * @see ILayer#WARNING
164: * @see ILayer#WORKING
165: * @param status Status should be one of DONE, ERROR, MISSING, UNCONFIGURED, WARNING, WORKING
166: * <!-- end-user-doc -->
167: * @param value the new value of the '<em>Status</em>' attribute.
168: * @see #getStatus()
169: * @generated
170: */
171: void setStatus(int value);
172:
173: /**
174: * Sets the current rendering status message
175: *
176: * @param message the status message
177: */
178: void setStatusMessage(String message);
179:
180: /**
181: * Set toolset applicability.
182: *
183: * @param toolCategoryId ID of toolset being considered
184: * @param isApplicable true if layer is to be used with indicated toolset
185: */
186: public void setApplicable(String toolCategoryId,
187: boolean isApplicable);
188:
189: /**
190: * Indicates this layer is capable of selectable.
191: * <p>
192: * A Selectable Layer can be used with the Utilities.getQuery opperation. The selection tool
193: * category will maintain a separate user interface concept of applicability. The selection tool
194: * will not be capabile of considering a non selectable layer applicable.
195: * </p>
196: * IMPORTANT FUTURE CHANGE NOTE: future design: Instead of isSelectable and isInfoable a single
197: * boolean isApplicable( String toolkitID ) will be used to determine whether the layer is
198: * applicable to the current tool cateogry. If the layer is not capable of Each tool category
199: * extension will declare a color, which will be an underlay for the layer decorator, and an
200: * optional validator class, to determine whether the capability for the layer can be set.
201: * Indicates this layer is selectable.
202: *
203: * @return <code>true</code> if layer is selectable, <code>false</code> otherwise.
204: * @uml.property name="selectable"
205: * @model default="true"
206: */
207: public boolean isSelectable();
208:
209: /**
210: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#isSelectable <em>Selectable</em>}' attribute.
211: * <!-- begin-user-doc --> Used by the user to control which layers are selectable,
212: * may be ignored for GeoResources that do not support editing. <!-- end-user-doc -->
213: * @param value the new value of the '<em>Selectable</em>' attribute.
214: * @see #isSelectable()
215: * @generated
216: */
217: void setSelectable(boolean value);
218:
219: /**
220: * Gets the name from the associated metadata.
221: *
222: * @return the name from the associated metadata
223: * @uml.property name="name"
224: * @model
225: */
226: public String getName();
227:
228: /**
229: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getName <em>Name</em>}' attribute.
230: * <!-- begin-user-doc --> <!-- end-user-doc -->
231: * @param value the new value of the '<em>Name</em>' attribute.
232: * @see #getName()
233: * @generated
234: */
235: void setName(String value);
236:
237: /**
238: * Returns the layer reference information..
239: *
240: * @model type="net.refractions.udig.project.internal.CatalogRef"
241: */
242: CatalogRef getCatalogRef();
243:
244: /**
245: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getCatalogRef <em>Catalog Ref</em>}' attribute.
246: * <!-- begin-user-doc --> <!-- end-user-doc -->
247: * @param value the new value of the '<em>Catalog Ref</em>' attribute.
248: * @see #getCatalogRef()
249: * @generated
250: */
251: void setCatalogRef(CatalogRef value);
252:
253: /**
254: * Gets the unique id, unique within a context model
255: *
256: * @return the id of the layerRef
257: * @uml.property name="iD"
258: * @model id="true"
259: */
260: public URL getID();
261:
262: /**
263: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getID <em>ID</em>}' attribute.
264: * <!-- begin-user-doc --> <!-- end-user-doc -->
265: * @param value the new value of the '<em>ID</em>' attribute.
266: * @see #getID()
267: * @generated
268: */
269: void setID(URL value);
270:
271: /**
272: * Returns whether this layer is currently visible
273: *
274: * @return whether this layer is currently visible
275: * @uml.property name="visible"
276: * @model
277: */
278: public boolean isVisible();
279:
280: /**
281: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#isVisible <em>Visible</em>}' attribute.
282: * <!-- begin-user-doc --> <!-- end-user-doc -->
283: * @param value the new value of the '<em>Visible</em>' attribute.
284: * @see #isVisible()
285: * @generated
286: */
287: void setVisible(boolean value);
288:
289: /**
290: * Returns the currently preferred.
291: *
292: * @model transient="true" changeable="true"
293: */
294: public IGeoResource getGeoResource();
295:
296: /**
297: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getGeoResource <em>Geo Resource</em>}' attribute.
298: * <!-- begin-user-doc --> <!-- end-user-doc -->
299: * @param value the new value of the '<em>Geo Resource</em>' attribute.
300: * @see #getGeoResource()
301: * @generated
302: */
303: void setGeoResource(IGeoResource value);
304:
305: /**
306: * Access to resources that hold data for this layer.
307: *
308: * @see resources() for type safe access
309: * @return IGeoResources that can used to obtain layer data
310: * @model type="net.refractions.udig.catalog.IGeoResource" transient="true" changeable="false"
311: */
312: public List<IGeoResource> getGeoResources();
313:
314: /**
315: * ImageDescriptor for this Layer.
316: * <p>
317: * Note we need to do the decorator exention on Layer to reflect status.
318: *
319: * @return Custom glyph - or null if none available.
320: * @uml.property name="glyph"
321: * @model transient="true"
322: */
323: public ImageDescriptor getGlyph();
324:
325: /**
326: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getGlyph <em>Glyph</em>}' attribute.
327: * <!-- begin-user-doc --> <!-- end-user-doc -->
328: * @param value the new value of the '<em>Glyph</em>' attribute.
329: * @see #getGlyph()
330: * @generated
331: */
332: void setGlyph(ImageDescriptor value);
333:
334: /**
335: * Query that selects all the features for the layer.
336: * <p>
337: * The selected flag is used with respect to {@link getFilter()}:
338: * <ul>
339: * <li><b>false </b>: Query for layers contents
340: * <li><b>true </b>: Query for the layer's selected features
341: * </ul>
342: * </p>
343: *
344: * @param layer The layer the Query is associated with.
345: * @param selection true will return a query for the selected features.
346: * @return If selection if false then the features that are not selected are returned, otherwise
347: * a query that selects all the selected features is returned.
348: * @model volatile="true"
349: */
350: public Query getQuery(boolean selection);
351:
352: /**
353: * Gets the CRS for the layer. NOTE: THIS METHOD MAY BLOCK!!!
354: *
355: * @param monitor may be null.
356: * @return the CoordinateReferenceSystem of the layer or if the CRS cannot be determined. the
357: * current map's CRS will be returned, or if this fails the CRS will be WGS84.
358: * @model
359: */
360: CoordinateReferenceSystem getCRS(IProgressMonitor monitor);
361:
362: /**
363: * A convenience method for getCRS(null). Logs any exceptions with the Plugin log.
364: * <p>
365: * This method also allows the CRS to be viewed as an attribute by EMF so ui components and
366: * events can be raised. This method may block.
367: * </p>
368: *
369: * @return the CoordinateReferenceSystem of the layer or if the CRS cannot be determined.
370: * @uml.property name="cRS"
371: * @model transient="true" changeable="true"
372: */
373: CoordinateReferenceSystem getCRS();
374:
375: /**
376: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getCRS <em>CRS</em>}' attribute.
377: * <!-- begin-user-doc --> <!-- end-user-doc -->
378: * @param value the new value of the '<em>CRS</em>' attribute.
379: * @see #getCRS()
380: * @generated
381: */
382: void setCRS(CoordinateReferenceSystem value);
383:
384: /**
385: * Temporary layer properties, used for lightweight collaboration.
386: * <p>
387: * Note these values are not persisted, this can act as a blackboard for plugin collabaration.
388: * These properties are not saved and are reset when a map is opened.
389: * </p>
390: * If you need long term collaboration we can set up a persistent blackboard in the same manner
391: * as StyleBlackbord.
392: * </p>
393: * <p>
394: * Note: Please don't use this to work around limitations of our object model, instead send
395: * email and we can set up a long term solution.
396: * </p>
397: *
398: * @return Blackboard used for lightweight collaboration.
399: * @model changeable="false" transient="true" resolveProxies="false"
400: */
401: IBlackboard getProperties();
402:
403: /**
404: * Gets Containing Map.
405: *
406: * @return
407: */
408: Map getMapInternal();
409:
410: /**
411: * @return
412: * @model
413: */
414: ColourScheme getColourScheme();
415:
416: /**
417: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getColourScheme <em>Colour Scheme</em>}' attribute.
418: * <!-- begin-user-doc --> <!-- end-user-doc -->
419: * @param value the new value of the '<em>Colour Scheme</em>' attribute.
420: * @see #getColourScheme()
421: * @generated
422: */
423: void setColourScheme(ColourScheme value);
424:
425: /**
426: * @return
427: * @uml.property name="defaultColor"
428: * @model
429: */
430: Color getDefaultColor();
431:
432: /**
433: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getDefaultColor <em>Default Color</em>}' attribute.
434: * <!-- begin-user-doc --> <!-- end-user-doc -->
435: * @param value the new value of the '<em>Default Color</em>' attribute.
436: * @see #getDefaultColor()
437: * @generated
438: */
439: void setDefaultColor(Color value);
440:
441: /**
442: * Returns a list of all the FeatureEvents since the last commit.
443: *
444: * @return a list of all the FeatureEvents since the last commit.
445: * @model transient='true' type='org.geotools.data.FeatureEvent'
446: */
447: List<FeatureEvent> getFeatureChanges();
448:
449: /**
450: * @see ILayer#getMinScaleDenominator()
451: * @model
452: */
453: public double getMinScaleDenominator();
454:
455: /**
456: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getMinScaleDenominator <em>Min Scale Denominator</em>}' attribute.
457: * <!-- begin-user-doc -->
458: * <!-- end-user-doc -->
459: * @param value the new value of the '<em>Min Scale Denominator</em>' attribute.
460: * @see #getMinScaleDenominator()
461: * @generated
462: */
463: public void setMinScaleDenominator(double value);
464:
465: /**
466: * @see ILayer#getMaxScaleDenominator()
467: * @model
468: */
469: public double getMaxScaleDenominator();
470:
471: /**
472: * Sets the value of the '{@link net.refractions.udig.project.internal.Layer#getMaxScaleDenominator <em>Max Scale Denominator</em>}' attribute.
473: * <!-- begin-user-doc -->
474: * <!-- end-user-doc -->
475: * @param value the new value of the '<em>Max Scale Denominator</em>' attribute.
476: * @see #getMaxScaleDenominator()
477: * @generated
478: */
479: public void setMaxScaleDenominator(double value);
480: }
|