org.geotools.legend
Class Drawer

java.lang.Object
  extended by org.geotools.legend.Drawer

public class Drawer
extends java.lang.Object

This class is used to isolate GeoTools from the specific graphic library being used for rendering.

Author:
Administrateur

Method Summary
static Drawer create()
          Retrieve the default Drawing implementation.
 void drawDirect(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, Rule rule)
           
 void drawDirect(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, Style style)
          Used to draw a freature directly onto the provided image.
 void drawFeature(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform)
           
 void drawFeature(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, boolean drawVertices, org.opengis.referencing.operation.MathTransform mt)
           
 void drawFeature(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer[] symbs, org.opengis.referencing.operation.MathTransform mt)
           
 void drawFeature(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer symbolizer, org.opengis.referencing.operation.MathTransform mathTransform, LiteShape shape)
           
 void drawFeature(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, Style style)
           
 void drawFeature(java.awt.image.BufferedImage bi, org.opengis.feature.simple.SimpleFeature feature, Style style, java.awt.geom.AffineTransform worldToScreenTransform)
           
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.Geometry geom)
          Just a convinient method to create feature from geometry.
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.LineString line)
          Simple Feature with a default geometry and no attribtues.
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.MultiLineString multilinestring)
          Simple Feature with a default geometry and no attribtues.
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.MultiPoint multipoint)
          Simple Feature with a default geometry and no attribtues.
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.MultiPolygon multipolygon)
          Simple Feature with a default geometry and no attribtues.
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.Point point)
          Simple feature with one attribute called "point".
 org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.Polygon polygon)
          Simple Feature with a default geometry and no attribtues.
static Symbolizer[] getSymbolizers(java.lang.Class<? extends com.vividsolutions.jts.geom.Geometry> type, java.awt.Color baseColor)
           
static Symbolizer[] getSymbolizers(java.lang.Class<? extends com.vividsolutions.jts.geom.Geometry> type, java.awt.Color baseColor, boolean useTransparency)
           
static Symbolizer[] getSymbolizers(org.opengis.feature.simple.SimpleFeature feature)
           
 com.vividsolutions.jts.geom.LineString line(int[] xy)
          Generate LineStrings from two dimensional ordinates
 com.vividsolutions.jts.geom.MultiLineString lines(int[][] xy)
          Generate a MultiLineString from two dimensional ordinates
 com.vividsolutions.jts.geom.Point point(int x, int y)
          Generate Point from two dimensional ordinates
 com.vividsolutions.jts.geom.Polygon polygon(int[] xy)
          Convience constructor for GeometryFactory.createPolygon.
 com.vividsolutions.jts.geom.Polygon polygon(int[] xy, int[][] holes)
          Convience constructor for GeometryFactory.createPolygon.
 com.vividsolutions.jts.geom.LinearRing ring(int[] xy)
          Convience constructor for GeometryFactory.createLinearRing.
 org.opengis.feature.simple.SimpleFeatureType schema(java.lang.String name, java.lang.String spec)
          Create a SimpleFeatureType schema using a type short hand.
 java.awt.Point worldToPixel(com.vividsolutions.jts.geom.Coordinate coord, java.awt.geom.AffineTransform worldToScreenTransform)
           
static java.awt.geom.AffineTransform worldToScreenTransform(com.vividsolutions.jts.geom.Envelope mapExtent, java.awt.Rectangle screenSize)
          TODO summary sentence for worldToScreenTransform ...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Drawer create()
Retrieve the default Drawing implementation.

Returns:
Drawing ready for use

drawDirect

public void drawDirect(java.awt.image.BufferedImage bi,
                       org.opengis.feature.simple.SimpleFeature feature,
                       Style style)
Used to draw a freature directly onto the provided image.

Feature coordintes are in the same coordinates as the image.

You may call this method multiple times to draw several features onto the same Image (say for glyph creation).

Parameters:
image - Image to render on to
display - Needed to create Colors for image
feature - Feature to be rendered
style - Style to render feature with

drawDirect

public void drawDirect(java.awt.image.BufferedImage bi,
                       org.opengis.feature.simple.SimpleFeature feature,
                       Rule rule)

drawFeature

public void drawFeature(java.awt.image.BufferedImage bi,
                        org.opengis.feature.simple.SimpleFeature feature,
                        java.awt.geom.AffineTransform worldToScreenTransform,
                        boolean drawVertices,
                        org.opengis.referencing.operation.MathTransform mt)

drawFeature

public void drawFeature(java.awt.image.BufferedImage bi,
                        org.opengis.feature.simple.SimpleFeature feature,
                        java.awt.geom.AffineTransform worldToScreenTransform)

drawFeature

public void drawFeature(java.awt.image.BufferedImage bi,
                        org.opengis.feature.simple.SimpleFeature feature,
                        java.awt.geom.AffineTransform worldToScreenTransform,
                        Style style)

drawFeature

public void drawFeature(java.awt.image.BufferedImage bi,
                        org.opengis.feature.simple.SimpleFeature feature,
                        Style style,
                        java.awt.geom.AffineTransform worldToScreenTransform)

getSymbolizers

public static Symbolizer[] getSymbolizers(org.opengis.feature.simple.SimpleFeature feature)

getSymbolizers

public static Symbolizer[] getSymbolizers(java.lang.Class<? extends com.vividsolutions.jts.geom.Geometry> type,
                                          java.awt.Color baseColor)

getSymbolizers

public static Symbolizer[] getSymbolizers(java.lang.Class<? extends com.vividsolutions.jts.geom.Geometry> type,
                                          java.awt.Color baseColor,
                                          boolean useTransparency)

drawFeature

public void drawFeature(java.awt.image.BufferedImage bi,
                        org.opengis.feature.simple.SimpleFeature feature,
                        java.awt.geom.AffineTransform worldToScreenTransform,
                        boolean drawVertices,
                        Symbolizer[] symbs,
                        org.opengis.referencing.operation.MathTransform mt)

drawFeature

public void drawFeature(java.awt.image.BufferedImage bi,
                        org.opengis.feature.simple.SimpleFeature feature,
                        java.awt.geom.AffineTransform worldToScreenTransform,
                        boolean drawVertices,
                        Symbolizer symbolizer,
                        org.opengis.referencing.operation.MathTransform mathTransform,
                        LiteShape shape)

worldToPixel

public java.awt.Point worldToPixel(com.vividsolutions.jts.geom.Coordinate coord,
                                   java.awt.geom.AffineTransform worldToScreenTransform)

worldToScreenTransform

public static java.awt.geom.AffineTransform worldToScreenTransform(com.vividsolutions.jts.geom.Envelope mapExtent,
                                                                   java.awt.Rectangle screenSize)
TODO summary sentence for worldToScreenTransform ...

Parameters:
bounds -
rectangle -
Returns:

schema

public org.opengis.feature.simple.SimpleFeatureType schema(java.lang.String name,
                                                           java.lang.String spec)
Create a SimpleFeatureType schema using a type short hand.

Code Example:


 new Drawing().schema("namespace.typename", "id:0,*geom:LineString,name:String,*centroid:Point");
 

Parameters:
name - namespace.name
spec -
Returns:
Generated SimpleFeatureType

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.Geometry geom)
Just a convinient method to create feature from geometry.

Parameters:
geom - the geometry to create feature from
Returns:
feature instance

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.Point point)
Simple feature with one attribute called "point".

Parameters:
point -
Returns:
SimpleFeature with a default geometry and no attribtues

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.LineString line)
Simple Feature with a default geometry and no attribtues.

Parameters:
line -
Returns:
Feature with a default geometry and no attribtues

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.Polygon polygon)
Simple Feature with a default geometry and no attribtues.

Parameters:
polygon -
Returns:
Feature with a default geometry and no attribtues

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.MultiPoint multipoint)
Simple Feature with a default geometry and no attribtues.

Parameters:
multipoint -
Returns:
Feature with a default geometry and no attribtues

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.MultiLineString multilinestring)
Simple Feature with a default geometry and no attribtues.

Parameters:
multilinestring -
Returns:
Feature with a default geometry and no attribtues

feature

public org.opengis.feature.simple.SimpleFeature feature(com.vividsolutions.jts.geom.MultiPolygon multipolygon)
Simple Feature with a default geometry and no attribtues.

Parameters:
multipolygon -
Returns:
Feature with a default geometry and no attribtues

point

public com.vividsolutions.jts.geom.Point point(int x,
                                               int y)
Generate Point from two dimensional ordinates

Parameters:
x -
y -
Returns:
Point

line

public com.vividsolutions.jts.geom.LineString line(int[] xy)
Generate LineStrings from two dimensional ordinates

Parameters:
xy -
Returns:
LineStirng

lines

public com.vividsolutions.jts.geom.MultiLineString lines(int[][] xy)
Generate a MultiLineString from two dimensional ordinates

Parameters:
xy -
Returns:
MultiLineStirng

polygon

public com.vividsolutions.jts.geom.Polygon polygon(int[] xy)
Convience constructor for GeometryFactory.createPolygon.

The provided xy ordinates are turned into a linear rings.

Parameters:
xy - Two dimensional ordiantes.
Returns:
Polygon

polygon

public com.vividsolutions.jts.geom.Polygon polygon(int[] xy,
                                                   int[][] holes)
Convience constructor for GeometryFactory.createPolygon.

The provided xy and holes are turned into linear rings.

Parameters:
xy - Two dimensional ordiantes.
holes - Holes in polygon or null.
Returns:
Polygon

ring

public com.vividsolutions.jts.geom.LinearRing ring(int[] xy)
Convience constructor for GeometryFactory.createLinearRing.

Parameters:
xy - Two dimensional ordiantes.
Returns:
LinearRing for use with polygon


Copyright © 1996-2010 Geotools. All Rights Reserved.