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.render;
010:
011: import java.awt.image.RenderedImage;
012: import java.util.List;
013:
014: import net.refractions.udig.project.ILayer;
015: import net.refractions.udig.project.IMap;
016: import net.refractions.udig.project.render.displayAdapter.IMapDisplay;
017:
018: import com.vividsolutions.jts.geom.Envelope;
019:
020: /**
021: * Used by the map viewers/editors to manage the rendering process. Responsibilities:
022: * <ul>
023: * <li>Respond to model change events and start rendering processes depending on the event. For
024: * example: If the Map CRS is changed then all layers must be rerendered with the new CRS.</li>
025: * <li>Create Renderers when a map editor is opened.</li>
026: * <li>Create and remove renderers when renderers are added or removed</li>
027: * </ul>
028: * </p>
029: *
030: * @author jeichar
031: * @since 0.1
032: */
033: public interface IRenderManager {
034:
035: /**
036: * Returns the Map associated with the current renderManager.
037: *
038: * @return the Map associated with the current renderManager.
039: */
040: public IMap getMap();
041:
042: /**
043: * Returns the root Renderer Executor.
044: *
045: * @return the root
046: */
047: List<IRenderer> getRenderers();
048:
049: /**
050: * Gets the ViewportPane for the current RenderManager.
051: *
052: * @return the ViewportPane for the current RenderManager
053: */
054: public IMapDisplay getMapDisplay();
055:
056: /**
057: * Forces the area in all layers to be re-rendered.
058: * <p>
059: * Depending on the renderer the entire viewport may be re-rendered.
060: * </p>
061: *
062: * @param bounds the area to be re-rendered
063: * @see #refresh(ILayer, Envelope)
064: * @see #refreshSelection(ILayer, Envelope)
065: */
066: public void refresh(Envelope bounds);
067:
068: /**
069: * Forces the selection in the area to be re-rendered.
070: * <p>
071: * Depending on the renderer the entire viewport may be re-rendered.
072: * </p>
073: * <p>
074: * If layer is null no layers will be rendered.
075: * </p>
076: *
077: * @param layer the layer whose selection layer should be rerendered
078: * @param the area that will be rerendered
079: * @see #refresh(Envelope)
080: * @see #refreshSelection(ILayer, Envelope)
081: */
082: public void refreshSelection(ILayer layer, Envelope bounds);
083:
084: /**
085: * Clears selection from the specified layer. It is used when
086: * the Filter.ALL is set as a filter to the layer and the old selection
087: * should be cleared.
088: *
089: * @param layer the layer whose selection should be cleared
090: */
091: public void clearSelection(ILayer layer);
092:
093: /**
094: * Forces layer to be re-rendered. Depending on the renderer the entire viewport may be
095: * re-rendered.
096: * <p>
097: * If layer is null no layers will be rendered.
098: * </p>
099: *
100: * @param layer the layer that will be re-rendered.
101: * @param bounds the area the re-render
102: * @see #refresh(Envelope)
103: * @see #refresh(ILayer, Envelope)
104: */
105: public void refresh(ILayer layer, Envelope bounds);
106:
107: /**
108: * Stops the current rendering process if currently rendering.
109: */
110: public void stopRendering();
111:
112: /**
113: * Returns the most recently rendered Image.
114: *
115: * @return Returns the most recently rendered Image. May return null if the none of the refresh() methods
116: * has been called previously.
117: */
118: public RenderedImage getImage();
119:
120: }
|