org.geotools.legend
Class Drawer

Object
  extended by Drawer

public class Drawer
extends Object

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

Author:
Administrateur
Module:
modules/library/render (gt-render.jar)

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

drawFeature

public void drawFeature(BufferedImage bi,
                        SimpleFeature feature,
                        AffineTransform worldToScreenTransform,
                        boolean drawVertices,
                        MathTransform mt)

drawFeature

public void drawFeature(BufferedImage bi,
                        SimpleFeature feature,
                        AffineTransform worldToScreenTransform)

drawFeature

public void drawFeature(BufferedImage bi,
                        SimpleFeature feature,
                        AffineTransform worldToScreenTransform,
                        Style style)

drawFeature

public void drawFeature(BufferedImage bi,
                        SimpleFeature feature,
                        Style style,
                        AffineTransform worldToScreenTransform)

getSymbolizers

public static Symbolizer[] getSymbolizers(SimpleFeature feature)

getSymbolizers

public static Symbolizer[] getSymbolizers(Class<? extends Geometry> type,
                                          Color baseColor)

getSymbolizers

public static Symbolizer[] getSymbolizers(Class<? extends Geometry> type,
                                          Color baseColor,
                                          boolean useTransparency)

drawFeature

public void drawFeature(BufferedImage bi,
                        SimpleFeature feature,
                        AffineTransform worldToScreenTransform,
                        boolean drawVertices,
                        Symbolizer[] symbs,
                        MathTransform mt)

drawFeature

public void drawFeature(BufferedImage bi,
                        SimpleFeature feature,
                        AffineTransform worldToScreenTransform,
                        boolean drawVertices,
                        Symbolizer symbolizer,
                        MathTransform mathTransform,
                        LiteShape shape)

worldToPixel

public Point worldToPixel(Coordinate coord,
                          AffineTransform worldToScreenTransform)

worldToScreenTransform

public static AffineTransform worldToScreenTransform(Envelope mapExtent,
                                                     Rectangle screenSize)
TODO summary sentence for worldToScreenTransform ...

Parameters:
bounds -
rectangle -
Returns:

schema

public SimpleFeatureType schema(String name,
                                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 SimpleFeature feature(Geometry geom)
Just a convinient method to create feature from geometry.

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

feature

public SimpleFeature feature(Point point)
Simple feature with one attribute called "point".

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

feature

public SimpleFeature feature(LineString line)
Simple Feature with a default geometry and no attribtues.

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

feature

public SimpleFeature feature(Polygon polygon)
Simple Feature with a default geometry and no attribtues.

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

feature

public SimpleFeature feature(MultiPoint multipoint)
Simple Feature with a default geometry and no attribtues.

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

feature

public SimpleFeature feature(MultiLineString multilinestring)
Simple Feature with a default geometry and no attribtues.

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

feature

public SimpleFeature feature(MultiPolygon multipolygon)
Simple Feature with a default geometry and no attribtues.

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

point

public Point point(int x,
                   int y)
Generate Point from two dimensional ordinates

Parameters:
x -
y -
Returns:
Point

line

public LineString line(int[] xy)
Generate LineStrings from two dimensional ordinates

Parameters:
xy -
Returns:
LineStirng

lines

public MultiLineString lines(int[][] xy)
Generate a MultiLineString from two dimensional ordinates

Parameters:
xy -
Returns:
MultiLineStirng

polygon

public 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 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 LinearRing ring(int[] xy)
Convience constructor for GeometryFactory.createLinearRing.

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


Copyright © 1996-2009 Geotools. All Rights Reserved.