org.deegree.services.wms.utils
Class MapController

java.lang.Object
  extended by org.deegree.services.wms.utils.MapController

public class MapController
extends Object

Version:
$Revision: 31688 $, $Date: 2011-08-30 15:05:12 +0200 (Tue, 30 Aug 2011) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Constructor Summary
MapController(MapService service, ICRS crs, int width, int height)
           
 
Method Summary
 void endPanning()
           
 boolean finishZoomin(int x, int y)
          Zoom in into zoom rectangle.
 ICRS getCRS()
           
 Envelope getCurrentEnvelope()
           
 BufferedImage getCurrentImage()
           
 double getCurrentScale()
           
 FeatureCollection getFeatures(int radius, int x, int y)
           
 Layer getQueryLayer()
           
 boolean isRepainting()
           
 boolean isResizing()
           
 boolean needsRepaint()
           
 void paintMap(Graphics2D g, boolean preview)
           
 void pan(int sourcex, int sourcey, int currentx, int currenty)
           
 void setEnvelope(int minx, int miny, int maxx, int maxy)
          parameters are in window coordinates
 void setLayers(List<? extends Layer> layers)
           
 void setQueryLayer(Layer layer)
           
 void setSize(int width, int height)
           
 void setZoomRectEnd(int x, int y)
           
 void setZoomRectStart(int minx, int miny)
           
 void startPanning(int x, int y)
          Start panning with x/y as center/start point.
 void startResize()
           
 void stopResize()
           
 void stopZoomin()
          Throw away zoom rectangle.
 Pair<Double,Double> translate(int x, int y)
           
 void updatePanning(int x, int y)
           
 void zoom(double factor, int centerx, int centery)
           
 void zoomToMaxExtent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapController

public MapController(MapService service,
                     ICRS crs,
                     int width,
                     int height)
Parameters:
service -
crs -
width -
height -
Method Detail

isResizing

public boolean isResizing()
Returns:
true, if resizing is in progress

getCurrentImage

public BufferedImage getCurrentImage()
Returns:
the currently displayed map

getCRS

public ICRS getCRS()
Returns:
the crs of the map

getQueryLayer

public Layer getQueryLayer()
Returns:
the current query layer, or null, if none is selected

isRepainting

public boolean isRepainting()
Returns:
true, if the controller is currently repainting

paintMap

public void paintMap(Graphics2D g,
                     boolean preview)
Parameters:
g -
preview -

getFeatures

public FeatureCollection getFeatures(int radius,
                                     int x,
                                     int y)
Parameters:
radius -
x -
y -
Returns:
do a get feature info internally

setLayers

public void setLayers(List<? extends Layer> layers)
Parameters:
layers -

startResize

public void startResize()

stopResize

public void stopResize()

setSize

public void setSize(int width,
                    int height)
Parameters:
width -
height -

zoom

public void zoom(double factor,
                 int centerx,
                 int centery)
Parameters:
factor - if positive, zoom out
centerx - if negative, the center will remain unchanged
centery - if negative, the center will remain unchanged

startPanning

public void startPanning(int x,
                         int y)
Start panning with x/y as center/start point.

Parameters:
x -
y -

updatePanning

public void updatePanning(int x,
                          int y)
Parameters:
x -
y -

endPanning

public void endPanning()

setEnvelope

public void setEnvelope(int minx,
                        int miny,
                        int maxx,
                        int maxy)
parameters are in window coordinates

Parameters:
minx -
miny -
maxx -
maxy -

getCurrentEnvelope

public Envelope getCurrentEnvelope()
Returns:
the current envelope

pan

public void pan(int sourcex,
                int sourcey,
                int currentx,
                int currenty)
Parameters:
sourcex -
sourcey -
currentx -
currenty -

needsRepaint

public boolean needsRepaint()
Returns:
whether parameters have changed and the map needs repainting

translate

public Pair<Double,Double> translate(int x,
                                     int y)
Parameters:
x -
y -
Returns:
the world coordinates

zoomToMaxExtent

public void zoomToMaxExtent()

getCurrentScale

public double getCurrentScale()
Returns:
the current scale (0.28 mm pixelsize)

setQueryLayer

public void setQueryLayer(Layer layer)
Parameters:
layer -

setZoomRectStart

public void setZoomRectStart(int minx,
                             int miny)
Parameters:
minx -
miny -

setZoomRectEnd

public void setZoomRectEnd(int x,
                           int y)
Parameters:
x -
y -

stopZoomin

public void stopZoomin()
Throw away zoom rectangle.


finishZoomin

public boolean finishZoomin(int x,
                            int y)
Zoom in into zoom rectangle.

Returns:
true, if there was a rectangle, false, if the rectangles width and/or height were zero.


Copyright © 2011. All Rights Reserved.