Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Quick code review for Layer changes

I am about to regenerate the model based on the following modification to layer. - infoability, recast as applicability allowing this concept to be used across toolkits
- state, used to indicate results of the last renderer
- dirty, marks layers with uncommited

I would also like to remove Layer.Utitlities as well, just not this week.

Review, comments appricated. I will hit the generate button tomorrow.

Jody

/**
* Layer defines visual appearance of map, indicating geospatial information and presentation. * </p>
 * <p>
 * Responsibilities:
 * <ul>
 * <li>Locate IGeoResource used to access geospatial information</li>
* <li>Store appearnce information on the StyleBlackboard under user control</li> * <li>Maintain a "Filter" of selected contents for the Layer, used for opperations such as edit * <li>Provide a general purpose Blackboard for plugin collaboration * </ul>
 * </p>
* A Layer is central to the description of Map, Layers are stored with in a Z-Order defining * draw order. Drawing is provided the applicable Renderer, determined according to the current
 * context: available IGeoResources, StyleBlackboard and ViewContext.
 * <p>
 *
 * @author Jesse
 * @since 0.5
 * @model
 */
public interface Layer extends EObject, Comparable<Layer>{

/** <code>UNCONFIGURED</code> GeoResource is unconfigured, or is unavailable */
    public static final int UNCONFIGURED = -1;
/** <code>DONE</code> rendering process completed normally */
    public static final int DONE = 0;
/** <code>WORKING</code> rendering process is underway. */
    public static final int WORKING = 1;
/** <code>BROKEN</code> render process was unable to complete normally */
    public static final int BROKEN = 2;
/** <code>WARNING</code> render process has produced warning(s) in the log */ public static final int WARNING = 3; /**
     * Returns the owning ContextModel object
     * <p>
* TODO: Remove Context Model (1 to 1 relationship does not added anything)
     * </p>
     * @return the owning ContextModel object
     * @model many="false" opposite="layers"
     */
    public ContextModel getContextModel();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#getContextModel <em>Context Model</em>}' container reference.
     * <!-- begin-user-doc -->
* TODO: Remove Context Model (1 to 1 relationship does not added anything)
     * <!-- end-user-doc -->
* @param value the new value of the '<em>Context Model</em>' container reference.
     * @see #getContextModel()
     * @generated
     */
    void setContextModel(ContextModel value);

    /**
     * Filter indicating the selected features.
     * <p>
* In order for this value to be useful the layer should be selectable,
     * often a single fid filter during user edit opperations.
     * </p>
* <p>Note: Filter.ALL indicates no selected Features. (All features are filtered out)</p>
     * <p>
     * A tool may wish to record the previous Filter, before replacing
     * (or adding to) this value.
     * </p>
     * XXX: Consider making use of the General Purpose Blackboard
     *
* @return Filter indicating the selected features. Filter.ALL indicates no selected Features.
     * @model transient="true" dataType="org.geotools.filter.Filter"
     */
    Filter getFilter();
/** * Sets the value of the '{@link net.refractions.udig.project.Layer#getFilter <em>Filter</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @param value the new value of the '<em>Filter</em>' attribute.
     * @see #getFilter()
     * @generated
     */
    void setFilter(Filter value);

    /**
* Returns the StyleDefinition that is to be used when rendering this Layer
     *
* @return the StyleDefinition that is to be used when rendering this Layer
     * @model many="false" containment="true"
     *
    public Style getStyle();*/
/**
     * StyleBlackboard used to persist user supplied appearance settings.
     *
     * @model many="false" containment="true"
     */
    public StyleBlackboard getStyleBlackboard();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#getStyleBlackboard <em>Style Blackboard</em>}' containment reference.
     * <!-- begin-user-doc -->
* Note: The Rendering Process will be restarted as appearance information changes, this is usual
     * limited to a single Layer.
     * <!-- end-user-doc -->
* @param value the new value of the '<em>Style Blackboard</em>' containment reference.
     * @see #getStyleBlackboard()
     * @generated
     */
    void setStyleBlackboard(StyleBlackboard value);

    /**
     * Returns the ZOrder of the Layer.
     *
     * The ZOrder dictates the order in which the Layer is rendered High
* z-orders are rendered first and lower z-orders overwrite high z-orders.
     *
     * @return the ZOrder of the Layer.
     * @model volatile="true" transient="true"
     */
    public int getZorder();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#getZorder <em>Zorder</em>}' attribute.
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @param value the new value of the '<em>Zorder</em>' attribute.
     * @see #getZorder()
     * @generated
     */
    void setZorder(int value);
/**
     * Indication of Layer status.
     * <p>
     * This is used to provide feedback for a Layers rendering status.
     * </p>
     * @return
     */
    public int getStatus();
/**
     * Check toolset applicability.
     * <p>
* 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.
     * </p>
     * @see isSelectable
     * @param toolset
     * @return
     */
    public boolean isApplicable( String toolsetID );
/**
     * Set toolset applicability.
     *
     * @param toolset
     * @return
     */
    public boolean setApplicable( String toolsetID, boolean applicable );
/**
     * Indicates this layer is capable of selectable.
     * <p>
* A Selectable Layer can be used with the Utilities.getQuery opperation. * The selection tool category will maintain a separate user interface concept of * applicability. The selection tool will not be capabile of considering
     * a non selectable layer applicable.
     * </p>
* * @return <code>true</code> if layer is selectable, <code>false</code> otherwise.
     * @model default="true"
     */
    public boolean isSelectable();
/** * Sets the value of the '{@link net.refractions.udig.project.Layer#isSelectable <em>Selectable</em>}' attribute.
     * <!-- begin-user-doc -->
* Used by the user to control which layers are selectable, may be ignored for GeoResources that do not
     * support editing.
     * <!-- end-user-doc -->
     * @param value the new value of the '<em>Selectable</em>' attribute.
     * @see #isSelectable()
     * @generated
     */
    void setSelectable(boolean value);

    /**
     * Indicate layer has been modified, due to user editing or
     * aRandomPlugin requesting a FeatureStore.
     *
* @return <code>true </code> if layer has changed content requiring a commit
     */
    boolean isDirty();
/**
     * Indicate that a user, or aRandomPlugin, has unchanged content
     * that requires a commit.
     *
* @param changed <code>true</code> if layer has changed content requiring a commit, * <code>false><code> when commit or rollback is called.
     */
    boolean setDirty( boolean changed );
    /**
     * Gets the name from the associated metadata.
     *
     * @return the name from the associated metadata
     * @model
     */
    public String getName();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#getName <em>Name</em>}' attribute.
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @param value the new value of the '<em>Name</em>' attribute.
     * @see #getName()
     * @generated
     */
    void setName(String value);

    /**
     * Returns the layer reference information..
     *
     * @model
     */
    LayerRef getCatalogRef();
/** * Sets the value of the '{@link net.refractions.udig.project.Layer#getCatalogRef <em>Catalog Ref</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @param value the new value of the '<em>Catalog Ref</em>' attribute.
     * @see #getCatalogRef()
     * @generated
     */
    void setCatalogRef(LayerRef value);

    /**
     * Gets the unique id, unique within a context model
     *
     * @return the id of the layerRef
     * @model id="true"
     */
    public URL getID();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#getID <em>ID</em>}' attribute.
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @param value the new value of the '<em>ID</em>' attribute.
     * @see #getID()
     * @generated
     */
    void setID(URL value);

    /**
     * Returns whether this layer is currently visible
     *
     * @return whether this layer is currently visible
     * @model
     */
    public boolean isVisible();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#isVisible <em>Visible</em>}' attribute.
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @param value the new value of the '<em>Visible</em>' attribute.
     * @see #isVisible()
     * @generated
     */
    void setVisible(boolean value);

    /**
     * Access to resources that hold data for this layer.
     * <p>
     * Yes you can have more then one, please see getFeatureSource(),
     * getFeatureStore(), getWMSLayer() for a resource appropriate to
     * your needs. You can query this list quickly using isType( mask ).
     * </p>
     * @see resources() for type safe access
     * @return IGeoResources that can used to obtain layer data
     *
* @model type="net.refractions.udig.catalog.IGeoResource" transient="true" changeable="false"
     */
    public List getGeoResources();

/**
     * Access to resources that hold data for this layer.
     * <p>
     * Yes you can have more then one, please see getFeatureSource(),
     * getFeatureStore(), getWMSLayer() for a resource appropriate to
     * your needs. You can query this list quickly using isType( mask ).
     * </p>
     *
     * @see getResource for the EMF data model
     * @return IGeoResources that can used to obtain layer data
     */
    public List<IGeoResource> resources();
/** * @param type Type of IGeoResources to return. See Enumeration of values in
     * IGeoResource.
* @return List of GeoResources of the indicated type. */
    public List<IGeoResource> getGeoResources( int type );

    /**
     * Type check on available GeoResources.
     *
     * @param typeMask
     * @return true if GeoResource is available of the indicated type
     * @model
     */
    public boolean isType( int typeMask);
/**
     * ImageDescriptor for this Layer.
     * <p>
* Note we need to do the decorator exention on Layer to reflect status.
     *
     * @return Custom glyph - or null if none available.
     * @model transient="true"
     */
    public ImageDescriptor getGlyph();

    /**
* Sets the value of the '{@link net.refractions.udig.project.Layer#getGlyph <em>Glyph</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @param value the new value of the '<em>Glyph</em>' attribute.
     * @see #getGlyph()
     * @generated
     */
    void setGlyph(ImageDescriptor value);

    /**
     * Query that selects all the features for the layer.
     * <p>
     * The selected flag is used with respect to {@link getFilter()}:
     * <ul>
     * <li><b>false</b>: Query for layers contents
     * <li><b>true</b>: Query for the layer's selected features
     * </ul>
     * </p>
     *
     * @param layer The layer the Query is associated with.
     * @param selection
     *            true will return a query for the selected features.
     *
* @return If selection if false then the features that are not selected are
     *         returned, otherwise a query that selects all the selected
     *         features is returned.
     * @model volatile="true"
     */
    public Query getQuery(boolean selection);
/**
     * FeatureStore if available.
     * <p>
     * This is similar to the following check:
     * <pre><code>
     * data = getFeatureSource();
* <b>return</b> data instanceof FeatureStore ? (FeatureStore) data : null;
     * </code></pre>
     * </p>
* @return FeatureStore (read write access) for this layer, or null if unavailable.
     */
    public FeatureStore getFeatureStore();

    /**
     * Retrieve a schema description of this Layer.
     * <p>
     * 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.
     * </p>
     * <p>
     * This is similar to the following check:
     * <pre><code>
     * data = getFeatureSource();
     * <b>return</b> data != null ? data.getSchema() : null;
     * </code></pre>
     * </p>
     * @return Schema information if available
     */
    public FeatureType getSchema();
/**
     * FeatureSource,  if available.
     * <p>
     * This method will return <code>null</code> if this Layer
     * does have access to a FeatureSource.
     * </p>
     * @return FeatureSource or <code>null</code> if unavailable.
     */
    public FeatureSource getFeatureSource();

    /**
     * Access {@link org.geotools.data.ows.Layer}, if available.
     * <p>
     * This method will return <code>null</code> if the Layer
     * does have a WMS Layer not have one.
     * </p>
     * @return a {@link org.geotools.data.ows.Layer} if available or null.
     */
    public org.geotools.data.ows.Layer getWMSLayer();

    /**
     * Access {@link WebMapServer}, available.
     *
     * This method will return <code>null</code> if the Layer
     * does have a WebMapServer not have one.
     *
     * @return a {@link WebMapServer} if available or <code>null</code>.
     */
    public WebMapServer getWMS();
}



Back to the top