|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.refractions.udig.ui.Drawing
public final class Drawing
Drawing utility package - make your own previews and glyphs!
Method Summary | |
---|---|
static Drawing |
create()
Retrieve the default Drawing implementation. |
static ViewportGraphics |
createGraphics(GC gc,
Display display,
java.awt.Dimension displaySize)
Creates a ViewportGraphics object based backed by SWT. |
static ViewportGraphics |
createGraphics(java.awt.Graphics2D graphics)
Creates a ViewportGraphics object based backed by SWT. |
void |
drawDirect(Image image,
Display display,
SimpleFeature feature,
Style style)
Used to draw a freature directly onto the provided image. |
void |
drawFeature(ViewportGraphics graphics,
SimpleFeature feature,
java.awt.geom.AffineTransform worldToScreenTransform)
|
void |
drawFeature(ViewportGraphics graphics,
SimpleFeature feature,
java.awt.geom.AffineTransform worldToScreenTransform,
boolean drawVertices,
MathTransform mt)
|
void |
drawFeature(ViewportGraphics graphics,
SimpleFeature feature,
java.awt.geom.AffineTransform worldToScreenTransform,
boolean drawVertices,
Symbolizer[] symbs,
MathTransform mt)
|
void |
drawFeature(ViewportGraphics graphics,
SimpleFeature feature,
java.awt.geom.AffineTransform worldToScreenTransform,
boolean drawVertices,
Symbolizer symbolizer,
MathTransform mathTransform,
LiteShape shape)
|
void |
drawFeature(ViewportGraphics graphics,
SimpleFeature feature,
java.awt.geom.AffineTransform worldToScreenTransform,
Style style)
|
SimpleFeature |
feature(Geometry geom)
Just a convinient method to create feature from geometry. |
static Symbolizer[] |
getSymbolizers(java.lang.Class<? extends Geometry> type,
java.awt.Color baseColor)
|
static Symbolizer[] |
getSymbolizers(java.lang.Class<? extends Geometry> type,
java.awt.Color baseColor,
boolean useTransparency)
|
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(java.lang.String name,
java.lang.String spec)
Create a SimpleFeatureType schema using a type short hand. |
java.awt.Point |
worldToPixel(Coordinate coord,
java.awt.geom.AffineTransform worldToScreenTransform)
|
static java.awt.geom.AffineTransform |
worldToScreenTransform(BoundingBox 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 |
---|
public static Drawing create()
public static ViewportGraphics createGraphics(GC gc, Display display, java.awt.Dimension displaySize)
REMEMBER to dispose of graphics.
gc
- A SWT GC object that the ViewportGraphics object will draw on.display
- The display object that will be used to create newdisplaySize
-
public static ViewportGraphics createGraphics(java.awt.Graphics2D graphics)
graphics
-
public void drawDirect(Image image, Display display, SimpleFeature feature, Style style)
SimpleFeature 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).
image
- Image to render on todisplay
- Needed to create Colors for imagefeature
- SimpleFeature to be renderedstyle
- Style to render feature withpublic void drawFeature(ViewportGraphics graphics, SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, boolean drawVertices, MathTransform mt)
public void drawFeature(ViewportGraphics graphics, SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform)
public void drawFeature(ViewportGraphics graphics, SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, Style style)
public void drawFeature(ViewportGraphics graphics, SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer[] symbs, MathTransform mt)
public void drawFeature(ViewportGraphics graphics, SimpleFeature feature, java.awt.geom.AffineTransform worldToScreenTransform, boolean drawVertices, Symbolizer symbolizer, MathTransform mathTransform, LiteShape shape)
public java.awt.Point worldToPixel(Coordinate coord, java.awt.geom.AffineTransform worldToScreenTransform)
public static Symbolizer[] getSymbolizers(java.lang.Class<? extends Geometry> type, java.awt.Color baseColor)
public static Symbolizer[] getSymbolizers(java.lang.Class<? extends Geometry> type, java.awt.Color baseColor, boolean useTransparency)
public static java.awt.geom.AffineTransform worldToScreenTransform(BoundingBox mapExtent, java.awt.Rectangle screenSize)
bounds
- rectangle
-
public SimpleFeatureType schema(java.lang.String name, java.lang.String spec)
Code Example:
new Drawing().schema("namespace.typename", "id:0,*geom:LineString,name:String,*centroid:Point");
name
- namespace.namespec
-
public SimpleFeature feature(Geometry geom)
geom
- the geometry to create feature from
public Point point(int x, int y)
x
- y
-
public LineString line(int[] xy)
xy
-
public MultiLineString lines(int[][] xy)
xy
-
public Polygon polygon(int[] xy)
The provided xy ordinates are turned into a linear rings.
xy
- Two dimensional ordiantes.
public Polygon polygon(int[] xy, int[][] holes)
The provided xy and holes are turned into linear rings.
xy
- Two dimensional ordiantes.holes
- Holes in polygon or null.
public LinearRing ring(int[] xy)
xy
- Two dimensional ordiantes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |