Revision 37499
branches/v2_0_0_prep/libraries/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/MultiShapeSymbol.java | ||
---|---|---|
27 | 27 |
import java.awt.geom.AffineTransform; |
28 | 28 |
import java.awt.geom.Point2D; |
29 | 29 |
|
30 |
import org.slf4j.Logger; |
|
31 |
import org.slf4j.LoggerFactory; |
|
32 |
|
|
30 | 33 |
import org.gvsig.compat.print.PrintAttributes; |
31 | 34 |
import org.gvsig.fmap.dal.feature.Feature; |
32 | 35 |
import org.gvsig.fmap.geom.Geometry; |
33 | 36 |
import org.gvsig.fmap.geom.aggregate.Aggregate; |
37 |
import org.gvsig.fmap.geom.type.GeometryType; |
|
34 | 38 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
35 | 39 |
import org.gvsig.fmap.mapcontext.ViewPort; |
36 | 40 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
... | ... | |
49 | 53 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
50 | 54 |
import org.gvsig.tools.task.Cancellable; |
51 | 55 |
import org.gvsig.tools.util.Callable; |
52 |
import org.slf4j.Logger; |
|
53 |
import org.slf4j.LoggerFactory; |
|
54 | 56 |
|
55 | 57 |
/** |
56 | 58 |
* MultiShapeSymbol class allows to create a composition of several symbols with |
... | ... | |
149 | 151 |
|
150 | 152 |
public void draw(Graphics2D g, AffineTransform affineTransform, |
151 | 153 |
Geometry geom, Feature feature, Cancellable cancel) { |
152 |
switch (geom.getType()) { |
|
153 |
case Geometry.TYPES.POINT: //Tipo punto |
|
154 |
if (marker != null) { |
|
155 |
marker.draw(g, affineTransform, geom, feature, cancel); |
|
156 |
} |
|
157 |
break; |
|
158 |
case Geometry.TYPES.CURVE: |
|
159 |
case Geometry.TYPES.ARC: |
|
160 |
case Geometry.TYPES.SPLINE: |
|
161 |
if (line != null) { |
|
162 |
line.draw(g, affineTransform, geom, feature, cancel); |
|
163 |
} |
|
164 |
break; |
|
165 |
|
|
166 |
case Geometry.TYPES.SURFACE: |
|
167 |
case Geometry.TYPES.ELLIPSE: |
|
168 |
case Geometry.TYPES.CIRCLE: |
|
169 |
if (fill != null) { |
|
170 |
fill.draw(g, affineTransform, geom, feature, cancel); |
|
171 |
} |
|
172 |
break; |
|
173 |
} |
|
174 |
|
|
175 |
|
|
154 |
GeometryType geometryType = geom.getGeometryType(); |
|
155 |
if (geometryType.isTypeOf(Geometry.TYPES.POINT)){ |
|
156 |
if (marker != null) { |
|
157 |
marker.draw(g, affineTransform, geom, feature, cancel); |
|
158 |
} |
|
159 |
}else if (geometryType.isTypeOf(Geometry.TYPES.CURVE)){ |
|
160 |
if (line != null) { |
|
161 |
line.draw(g, affineTransform, geom, feature, cancel); |
|
162 |
} |
|
163 |
}else if (geometryType.isTypeOf(Geometry.TYPES.SURFACE)){ |
|
164 |
if (fill != null) { |
|
165 |
fill.draw(g, affineTransform, geom, feature, cancel); |
|
166 |
} |
|
167 |
}else if (geometryType.isTypeOf(Geometry.TYPES.AGGREGATE)){ |
|
168 |
Aggregate aggregate = (Aggregate)geom; |
|
169 |
for (int i=0 ; i<aggregate.getPrimitivesNumber() ; i++){ |
|
170 |
draw(g, affineTransform, aggregate.getPrimitiveAt(i), feature, cancel); |
|
171 |
} |
|
172 |
} |
|
176 | 173 |
} |
177 | 174 |
|
178 | 175 |
public boolean isOneDotOrPixel(Geometry geom, |
Also available in: Unified diff