|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IAbstractContext
Provides access to contextual information.
Toolkits are used by extensions to access Map and Project information. A Toolkit should never be instantiated by a developer. The framework provides Toolkits to extensions.
Responsibilities:
Method Summary | |
---|---|
IAbstractContext |
copy()
Makes a deep copy of this object, if necessary. |
ReferencedEnvelope |
getBoundingBox(java.awt.Point screenLocation,
int scalefactor)
Returns a world bounding box the scalefactor * (size of a pixel) at the location corresponding to the point on the screen. |
CoordinateReferenceSystem |
getCRS()
CoordinateReferenceSystem of the map. |
IEditManager |
getEditManager()
The map's edit manager. |
FeatureCollection |
getFeaturesInBbox(ILayer layer,
Envelope bbox)
Returns all the features that intersect with the bounding box. |
IMap |
getMap()
The context's map. |
IMapDisplay |
getMapDisplay()
The map's display object. |
java.util.List<ILayer> |
getMapLayers()
Returns the list of layers in the current map. |
Envelope |
getPixelBoundingBox(java.awt.Point screenLocation)
Returns a world bounding box the size of a pixel at the location corresponding to the point on the screen. |
Coordinate |
getPixelSize()
Returns the size of a pixel in world units. |
IProject |
getProject()
The map's containing Project. |
IRenderManager |
getRenderManager()
The map's render manager |
ILayer |
getSelectedLayer()
Returns the currently Selected Layer |
IViewportModel |
getViewportModel()
The map's viewport model. |
Coordinate |
pixelToWorld(int x,
int y)
Converts a coordinate expressed on the device space back to real world coordinates A convenience method. |
java.awt.Shape |
toShape(Geometry geometry,
CoordinateReferenceSystem crs)
Transform the provided geometry to a java 2d shape (in screen coordiantes). |
java.awt.Shape |
toShape(ReferencedEnvelope envelope)
Transform the provided envelope to a java 2d shape (in screen coordiantes). |
java.awt.Point |
tranformCoordinate(Envelope bbox,
java.awt.Dimension displaySize,
Coordinate coordinate)
Transforms the coordinate from the bounding box (bbox) to the area defined by the rectangle it starts at 0,0. |
ReferencedEnvelope |
worldBounds(java.awt.Rectangle rectangle)
Creates an Envelope that is close, error to slightly larger, to the Rectangle when it is transformed into world coordinates. |
java.awt.Point |
worldToPixel(Coordinate coord)
Returns the pixel on the screen for a given coordinate in world space. |
MathTransform2D |
worldToScreenMathTransform()
Creates a MathTransform that will transform from the screen CRS to the world CRS. |
java.awt.geom.AffineTransform |
worldToScreenTransform()
Gets up the affine transform that will transform from the world to screen. |
Method Detail |
---|
IViewportModel getViewportModel()
Convenience for getMap().getViewportModel().
Called to obtain current viewport bounds and crs.
IViewportModel
IEditManager getEditManager()
Convenience for getMap().getEditManager().
Called to obtain the currently editable feature.
IEditManager
IRenderManager getRenderManager()
Convenience for getMap().getRenderManager().
Called to refresh the current display.
IRenderManager
IMapDisplay getMapDisplay()
Convenience for getMap().getRenderManager().getMapDisplay().
Called to obtain the height and width of the display.
IMapDisplay
IMap getMap()
The Map data object.
IMap
IProject getProject()
Convenience for getMap().getProject().
Contains all the IProjectElements in the project.
IProject
java.awt.geom.AffineTransform worldToScreenTransform()
java.awt.Point worldToPixel(Coordinate coord)
coord
- A coordinate in world space.
Coordinate pixelToWorld(int x, int y)
x
- horizontal coordinate on device spacey
- vertical coordinate on device space
ReferencedEnvelope worldBounds(java.awt.Rectangle rectangle)
rectangle
-
MathTransform2D worldToScreenMathTransform()
Coordinate getPixelSize()
Envelope getPixelBoundingBox(java.awt.Point screenLocation)
ReferencedEnvelope getBoundingBox(java.awt.Point screenLocation, int scalefactor)
XXX: Can we make this a ReferencedEnvelope?
CoordinateReferenceSystem getCRS()
java.awt.Shape toShape(ReferencedEnvelope envelope)
box
-
ILayer getSelectedLayer()
java.awt.Shape toShape(Geometry geometry, CoordinateReferenceSystem crs)
box
-
FeatureCollection getFeaturesInBbox(ILayer layer, Envelope bbox) throws java.io.IOException
source
- The featuresource to get features from.bbox
- The bounding box that acts as a filter. Must be in map coordinates.
java.io.IOException
java.util.List<ILayer> getMapLayers()
IAbstractContext copy()
java.awt.Point tranformCoordinate(Envelope bbox, java.awt.Dimension displaySize, Coordinate coordinate)
bbox
- The from areadisplaySize
- the to areacoordinate
- the coordinate to transform.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |