root / branches / v2_0_0_prep / libFMap_mapcontext / src / org / gvsig / fmap / geometry / operation / Draw.java @ 21200
History | View | Annotate | Download (922 Bytes)
1 |
package org.gvsig.fmap.geometry.operation; |
---|---|
2 |
|
3 |
import java.awt.geom.AffineTransform; |
4 |
|
5 |
import org.gvsig.fmap.geom.Geometry; |
6 |
import org.gvsig.fmap.geom.GeometryManager; |
7 |
import org.gvsig.fmap.geom.operation.GeometryOperation; |
8 |
import org.gvsig.fmap.geom.operation.GeometryOperationContext; |
9 |
import org.gvsig.fmap.geom.operation.GeometryOperationException; |
10 |
|
11 |
public class Draw extends GeometryOperation{ |
12 |
public static final int CODE = GeometryManager.getInstance() |
13 |
.registerGeometryOperation("draw", new Draw()); |
14 |
|
15 |
public Object invoke(Geometry geom, GeometryOperationContext ctx) throws GeometryOperationException { |
16 |
DrawOperationContext doc=(DrawOperationContext)ctx; |
17 |
AffineTransform at=doc.getViewPort().getAffineTransform();
|
18 |
geom.transform(at); |
19 |
doc.getSymbol().draw(doc.getGraphics(), at, geom, doc.getCancellable()); |
20 |
return null; |
21 |
} |
22 |
|
23 |
public int getOperationIndex() { |
24 |
return CODE;
|
25 |
} |
26 |
|
27 |
} |