root / branches / dal_time_support / libraries / libFMap_mapcontext / src / org / gvsig / fmap / geom / operation / Draw.java @ 37204
History | View | Annotate | Download (975 Bytes)
1 |
package org.gvsig.fmap.geom.operation; |
---|---|
2 |
|
3 |
import java.awt.geom.AffineTransform; |
4 |
|
5 |
|
6 |
import org.gvsig.fmap.geom.Geometry; |
7 |
import org.gvsig.fmap.geom.GeometryManager; |
8 |
import org.gvsig.fmap.geom.GeometryLocator; |
9 |
|
10 |
public class Draw extends GeometryOperation{ |
11 |
public static final String NAME = "draw"; |
12 |
public static int CODE = Integer.MIN_VALUE; |
13 |
|
14 |
public Object invoke(Geometry geom, GeometryOperationContext ctx) throws GeometryOperationException { |
15 |
DrawOperationContext doc = (DrawOperationContext)ctx; |
16 |
AffineTransform at = doc.getViewPort().getAffineTransform();
|
17 |
doc.getSymbol().draw(doc.getGraphics(), at, geom, doc.getFeature(), |
18 |
doc.getCancellable()); |
19 |
return null; |
20 |
} |
21 |
|
22 |
public int getOperationIndex() { |
23 |
return CODE;
|
24 |
} |
25 |
|
26 |
public static void register() { |
27 |
|
28 |
GeometryManager geoMan = GeometryLocator.getGeometryManager(); |
29 |
CODE = geoMan.getGeometryOperationCode(NAME); |
30 |
geoMan.registerGeometryOperation(NAME, new Draw());
|
31 |
} |
32 |
|
33 |
} |