|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ILayer
TODO Purpose of net.refractions.udig.project
Field Summary | |
---|---|
static int |
DONE
DONE rendering process completed normally |
static int |
ERROR
ERROR render process was unable to complete normally |
static int |
MISSING
MISSING cannot locate a GeoResource for this layer |
static int |
UNCONFIGURED
UNCONFIGURED associated GeoResource is unconfigured, or is unavailable |
static CoordinateReferenceSystem |
UNKNOWN_CRS
Indicates the crs that will be used if the layer does not declare a crs. |
static int |
WAIT
WAIT layer is waiting for information. |
static int |
WARNING
WARNING render process has produced warning(s) in the log. |
static int |
WORKING
WORKING rendering process is underway. |
Method Summary | ||
---|---|---|
void |
addListener(ILayerListener listener)
Listen to changes on this layer. |
|
Filter |
createBBoxFilter(Envelope boundingBox,
IProgressMonitor monitor)
Creates A geometry filter for the layer. |
|
|
findGeoResource(java.lang.Class<T> clazz)
Locate the first IGeoResource that canResolve the provided resource type. |
|
IBlackboard |
getBlackboard()
Temporary layer properties, used for lightweight collaboration. |
|
ReferencedEnvelope |
getBounds(IProgressMonitor monitor,
CoordinateReferenceSystem crs)
Returns the bounds of the layer as best estimated. |
|
CoordinateReferenceSystem |
getCRS()
Gets the CRS for the layer. |
|
CoordinateReferenceSystem |
getCRS(IProgressMonitor monitor)
Deprecated. |
|
Filter |
getFilter()
Filter indicating the selected features. |
|
IGeoResource |
getGeoResource()
Resource the user associates with this layer. |
|
|
getGeoResource(java.lang.Class<T> clazz)
Deprecated. |
|
java.util.List<IGeoResource> |
getGeoResources()
Access to resources that hold data for this layer. |
|
ImageDescriptor |
getGlyph()
ImageDescriptor for this Layer. |
|
java.net.URL |
getID()
Gets the unique id, unique within a context model |
|
IMap |
getMap()
The Map that "owns" or "contains" the current layer. |
|
java.lang.String |
getName()
Gets the name from the associated metadata. |
|
IBlackboard |
getProperties()
Deprecated. |
|
Query |
getQuery(boolean selection)
Query that selects all the features for the layer. |
|
|
getResource(java.lang.Class<E> resourceType,
IProgressMonitor monitor)
Returns a real resource that one of the GeoResources can resolved to. |
|
FeatureType |
getSchema()
Retrieve a schema description of this Layer. |
|
int |
getStatus()
Indication of Layer status. |
|
java.lang.String |
getStatusMessage()
A message to provide the user with additional feed back about the current rendering status. |
|
IStyleBlackboard |
getStyleBlackboard()
StyleBlackboard used for collaboration with the rendering process. |
|
int |
getZorder()
Returns the ZOrder of the Layer. |
|
|
hasResource(java.lang.Class<T> resourceType)
Check if a IGeoResource exists that canResolve to the provided resource type. |
|
boolean |
isApplicable(java.lang.String toolCategoryId)
Check toolset applicability. |
|
|
isType(java.lang.Class<T> resourceType)
Deprecated. use hasResource(Class) |
|
boolean |
isVisible()
Returns whether this layer is currently visible |
|
MathTransform |
layerToMapTransform()
Returns the Mathtransform from this layers CRS to the map's CRS (modelled as part of the viewport model). |
|
MathTransform |
mapToLayerTransform()
Returns the Mathtransform from the map's CRS (modeled as part of the viewport model) to this layers CRS . |
|
void |
refresh(Envelope bounds)
Triggers the layer to rerender if it is currently displayed. |
|
void |
removeListener(ILayerListener listener)
remove LayerListener |
|
void |
setStatus(int status)
Sets the current status of the Layer. |
|
void |
setStatusMessage(java.lang.String string)
Sets the current status message |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
static final CoordinateReferenceSystem UNKNOWN_CRS
static final int UNCONFIGURED
UNCONFIGURED
associated GeoResource is unconfigured, or is unavailable
static final int MISSING
MISSING
cannot locate a GeoResource for this layer
static final int DONE
DONE
rendering process completed normally
static final int WAIT
WAIT
layer is waiting for information.
static final int ERROR
ERROR
render process was unable to complete normally
static final int WARNING
WARNING
render process has produced warning(s) in the log.
static final int WORKING
WORKING
rendering process is underway.
Note the default Label decorator makes use of a WORKING_HINT layer property. The rendering process will clear this HINT when starting work, subsequence calls to setState( WORKING ) will cycle the to update the clock.
Method Detail |
---|
void addListener(ILayerListener listener)
void removeListener(ILayerListener listener)
IGeoResource getGeoResource()
<T> IGeoResource getGeoResource(java.lang.Class<T> clazz)
clazz
- the clazz that the returned georesource can resolve to.
<T> IGeoResource findGeoResource(java.lang.Class<T> clazz)
Example implementation:
for( IGeoResource resource : getGeoResources() ) {
if (resource.canResolve(FeatureSource.class)) {
return resource;
}
}
return null;
clazz
- class of the resource that the IGeoResource claims it can adapt to.
IStyleBlackboard getStyleBlackboard()
This Blackboard is persisted, any modications made to the blackboard will result refresh of the effected layers.
<T> boolean hasResource(java.lang.Class<T> resourceType)
Example:
if (layer.hasResource(FeatureSource.class)) {
return handle.getResource(FeatureSource.class, monitor);
}
The blocking getResource(Class, IProgressMonitor) method allow the object to be
obtained.
resourceType
- the type of resource calleer is interested in.
<T> boolean isType(java.lang.Class<T> resourceType)
hasResource(Class)
hasResource(Class)
<E> E getResource(java.lang.Class<E> resourceType, IProgressMonitor monitor) throws java.io.IOException
Note: examples of resources are: FeatureSource, WebMapServer, etc... GeoResources are handles for real resources.
Example implementation:
for( IGeoResource resource : getGeoResources() ) {
if (resource.canResolve(FeatureSource.class)) {
return resource;
}
}
return null;
IMPORTANT: unlike using IGeoResource#resolve(Class, IProgressMonitor)
getResource(Class, IProgressMonitor)
returns the same instance of the resource. The IGeoResource#resolve(Class, IProgressMonitor)
method returns a new instance
each time and therefore should NOT be used as a replacement for getResource(Class, IProgressMonitor)
.
resourceType
-
java.io.IOException
Filter getFilter()
In order for this value to be useful the layer should be selectable, often a single fid filter during user edit opperations.
Note: Filter.ALL indicates no selected Features. (All features are filtered out)
A tool may wish to record the previous Filter, before replacing (or adding to) this value.
Will never return null.
int getZorder()
int getStatus()
This is used to provide feedback for a Layers rendering status.
Future versions will return an enum.
java.lang.String getStatusMessage()
This is used to provide feedback for a Layers rendering status.
boolean isApplicable(java.lang.String toolCategoryId)
Note: some layers may not ever be applicable for certaint toolsets. Sometimes this is can be determined quickly from a layer property like "selectable" for the selection toolset. Other toolsets may need to perform a more detailed examination.
toolCategoryId
-
isSelectable
java.lang.String getName()
java.net.URL getID()
boolean isVisible()
java.util.List<IGeoResource> getGeoResources()
ImageDescriptor getGlyph()
Note we need to do the decorator exention on Layer to reflect status.
Query getQuery(boolean selection)
The selected flag is used with respect to getFilter()
:
Convenience method
layer
- The layer the Query is associated with.selection
- true will return a query for the selected features.
FeatureType getSchema()
This schema can be used to determine the available attributes for use in Style Rule construction. That is we will need to construct an "answer" for this query even if we just have a WMS layer.
This is similar to the following check:
data = getResource();
<b>return</b> data != null ? data.getSchema() : null;
CoordinateReferenceSystem getCRS(IProgressMonitor monitor)
monitor
- may be null.
CoordinateReferenceSystem getCRS()
void refresh(Envelope bounds)
bounds
- The area to render or the entire viewport if null.MathTransform layerToMapTransform() throws java.io.IOException
getMap().getViewportModel() will return the ViewportModel.
java.io.IOException
IViewportModel
MathTransform mapToLayerTransform() throws java.io.IOException
getMap().getViewportModel() will return the ViewportModel.
java.io.IOException
IViewportModel
IBlackboard getProperties()
Note these values are not persisted, this can act as a blackboard for plugin collabaration. These properties are not saved and are reset when a map is opened.
If you need long term collaboration we can set up a persistent blackboard in the same manner as StyleBlackbord.Note: Please don't use this to work around limitations of our object model, instead send email and we can set up a long term solution.
IBlackboard getBlackboard()
Note these values are not persisted, this can act as a blackboard for plugin collabaration. These properties are not saved and are reset when a map is opened.
If you need long term collaboration we can set up a persistent blackboard in the same manner asIMap.getBlackboard()
.
Note: Please don't use this to work around limitations of our object model, instead send email and we can set up a long term solution.
ReferencedEnvelope getBounds(IProgressMonitor monitor, CoordinateReferenceSystem crs) throws java.io.IOException
monitor
- crs
- the desired CRS for the returned envelope.
java.io.IOException
Filter createBBoxFilter(Envelope boundingBox, IProgressMonitor monitor)
getMap().getViewportModel() will return the ViewportModel.
boundingBox
- in the same crs as the viewport model.
IViewportModel
IMap getMap()
void setStatus(int status)
status
- the status. Will be an enum in the future but current EMF implementation
prevents this.void setStatusMessage(java.lang.String string)
message
- the status message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |