001: /* uDig - User Friendly Desktop Internet GIS client
002: * http://udig.refractions.net
003: * (C) 2004, Refractions Research Inc.
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation;
008: * version 2.1 of the License.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: */
015: package net.refractions.udig.project.internal.render;
016:
017: import java.awt.Rectangle;
018: import java.util.List;
019:
020: import net.refractions.udig.project.ILayer;
021: import net.refractions.udig.project.render.IRenderListener;
022: import net.refractions.udig.project.render.displayAdapter.IMapDisplay;
023:
024: import org.geotools.geometry.jts.ReferencedEnvelope;
025:
026: /**
027: * Coordinates the starting/stopping of renderers and updating of the
028: * {@link IMapDisplay}
029: *
030: * @author Jesse
031: * @since 1.1.0
032: */
033: public class RenderingCoordinator {
034: /**
035: * Adds a listener to the RenderCoordinator.
036: *
037: * @param listener listener to add.
038: */
039: public void addRenderListener(IRenderListener listener) {
040:
041: }
042:
043: /**
044: * Removes a listener from the RenderCoordinator.
045: *
046: * @param listener listener to remove.
047: */
048: public void removeRenderListener(IRenderListener listener) {
049:
050: }
051:
052: /**
053: * This method is inherently thread un-safe. It will return a state that the renderer was in recently but
054: * the renderer may have moved on since. Use a listener to be notified when the state changes.
055: */
056: public boolean isRendering() {
057: //TODO
058: return false;
059: }
060:
061: /**
062: * Requests that the area indicated by the rectangle on the screen be rendered for all layers.
063: *
064: * @param screen area to render.
065: */
066: public void render(Rectangle screen) {
067:
068: }
069:
070: /**
071: * Requests that the area indicated by the envelope be rendered for all layers.
072: *
073: * @param envelope area to render.
074: */
075: public void render(ReferencedEnvelope envelope) {
076:
077: }
078:
079: /**
080: * Requests that the entire viewport and all of the layers be rendered.
081: */
082: public void render() {
083:
084: }
085:
086: /**
087: * Requests that the area indicated by the rectangle on the screen be rendered for layers the indicated layers.
088: *
089: * @param screen area to render.
090: * @param layers layer to render
091: */
092: public void render(Rectangle screen, List<ILayer> layers) {
093:
094: }
095:
096: /**
097: * Requests that the area indicated by the rectangle on the screen be rendered for layers the indicated layers.
098: *
099: * @param envelope area to render.
100: * @param layers layer to render
101: */
102: public void render(ReferencedEnvelope envelope, List<ILayer> layers) {
103:
104: }
105:
106: /**
107: * Requests that the entire viewport be rendered for the indicated layers only.
108: *
109: * @param layers layers to be rendered.
110: */
111: public void render(List<ILayer> layers) {
112:
113: }
114:
115: /**
116: * Returns the rendered image. The return type is determined by the parameter passed in. The {@link RenderingCoordinator} will
117: * try to create an image of the requested type but if it is not possible then null will be returned.
118: *
119: * @param <T> The desired type of image to return. For example org.eclipse.swt.Image or java.awt.BufferedImage.
120: * @param imageTypeToReturn the class of the type of the image that is desired.
121: * @return The rendered image in the requested type or null if that is not possible with this {@link RenderingCoordinator}
122: */
123: public <T> T getImage(Class<T> imageTypeToReturn) {
124: return null;
125: }
126:
127: }
|