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.render;
010:
011: import java.awt.Point;
012: import java.awt.Rectangle;
013: import java.awt.image.BufferedImage;
014:
015: import net.refractions.udig.catalog.IGeoResource;
016: import net.refractions.udig.project.ILayer;
017: import net.refractions.udig.project.internal.AbstractContext;
018: import net.refractions.udig.project.internal.Layer;
019: import net.refractions.udig.project.render.IRenderContext;
020:
021: import org.geotools.data.Query;
022:
023: /**
024: * @see IRenderContext
025: *
026: * @author Jesse
027: * @since 1.0.0
028: * @model
029: */
030: public interface RenderContext extends AbstractContext,
031: Comparable<RenderContext>, IRenderContext {
032:
033: /**
034: * <!-- begin-user-doc --> <!-- end-user-doc -->
035: *
036: * @generated
037: */
038: 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$
039:
040: /**
041: * Test if content is rendered at the provided point.
042: * <p>
043: * Used to optimize getInfo and selection tools.
044: * </p>
045: *
046: * @param screenLocation
047: * @return true if non transparent pixel is rendered at screenLocation
048: * @model
049: */
050: public boolean hasContent(Point screenLocation);
051:
052: /**
053: * Grab a specific rectangle from the raster to provide instant feedback for geoInfo and
054: * selection tools.
055: * <p>
056: * Often this feedback takes place on the display under direction of the tool.
057: * </p>
058: *
059: * @param rectangle Rectangle indicating area of interest
060: * @return Buffered image copied from the raster, or null if unavailable
061: * @model
062: */
063: public BufferedImage copyImage(Rectangle rectangle);
064:
065: /**
066: * Returns a bufferedImage that a renderer can render to.
067: * <p>
068: * The method does not guarantee an image that is the same size as the request, only that the
069: * returned image will be at least the size requested
070: * </p>
071: * <p>
072: * The user of the image is required to clear the image. The image maybe cached and as a result
073: * may be dirty.
074: * </p>
075: *
076: * @return The bufferedImage that the renderer renders to.
077: * @model
078: */
079: public BufferedImage getImage(int width, int height);
080:
081: /**
082: * Returns a bufferedImage that a renderer can renders to.
083: * <p>
084: * The returned image will be the same size as the display or bigger
085: * </p>
086: *
087: * @return The bufferedImage that the renderer renders to.
088: * @model volatile="false" changeable="false"
089: */
090: public BufferedImage getImage();
091:
092: /**
093: * Returns the query that selects all the features that need to be rendered for the layer.
094: *
095: * @return the query that selects all the features that need to be rendered for the layer.
096: * @model
097: */
098: public Query getQuery(ILayer layer);
099:
100: /**
101: * Returns the layer in the renderer is responsible for.
102: * <p>
103: * Should normally be used when only one layer is being rendered.
104: * </p>
105: *
106: * @model many="false" resolveProxies="false"
107: */
108: Layer getLayerInternal();
109:
110: /**
111: * Sets the value of the '{@link net.refractions.udig.project.internal.render.RenderContext#getLayerInternal <em>Layer Internal</em>}'
112: * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
113: *
114: * @param value the new value of the '<em>Layer Internal</em>' reference.
115: * @see #getLayerInternal()
116: * @generated
117: */
118: void setLayerInternal(Layer value);
119:
120: /**
121: * Returns service associated with the first layer in the map.
122: * <p>
123: * Should normally be used when only one layer is being rendered.
124: * </p>
125: *
126: * @model many="false"
127: */
128: IGeoResource getGeoResourceInternal();
129:
130: /**
131: * Sets the value of the '{@link net.refractions.udig.project.internal.render.RenderContext#getGeoResourceInternal <em>Geo Resource Internal</em>}'
132: * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
133: *
134: * @param value the new value of the '<em>Geo Resource Internal</em>' attribute.
135: * @see #getGeoResourceInternal()
136: * @generated
137: */
138: void setGeoResourceInternal(IGeoResource value);
139:
140: /**
141: * Determines the zorder of the renderer.
142: * <p>
143: * In most cases it is recommended that the zorder=layer.getZorder()
144: * <p>
145: *
146: * @model changeable="false" transient="true" notify="true" volatile="true"
147: */
148: public int getZorder();
149:
150: /**
151: * Returns true if the renderer has visible data.
152: * <p>
153: * If not layer is not a CompositeRenderer then this is just a call to ILayer.isVisible().
154: * Otherwise if one of the layers is visible then it should return true
155: * </p>
156: *
157: * @return true if the renderer has visible data.
158: * @model volatile="true" changeable="false"
159: */
160: public boolean isVisible();
161:
162: /**
163: * Initialize context so it matches the argument.
164: *
165: * @param renderContext
166: */
167: public void init(RenderContext renderContext);
168:
169: /**
170: * Clears the image so it is all transparent
171: */
172: public void clearImage();
173:
174: /**
175: * @return The filter that will return all the features that need to be rendered
176: * @throws Exception In case something goes wrong, IOException, IllegalTransformException etc...
177: */
178: public Query getFeatureQuery();
179:
180: /**
181: * Clears the area.
182: *
183: * @param paintArea
184: */
185: public void clearImage(Rectangle paintArea);
186:
187: /**
188: * Sets the status of the layer contained by the context.
189: *
190: * @param error
191: */
192: public void setStatus(int status);
193:
194: public RenderContext copy();
195: }
|