Revision 1859 org.gvsig.legend.proportionalsymbols.app.mainplugin/trunk/org.gvsig.legend.proportionalsymbols.app.mainplugin/src/main/java/org/gvsig/symbology/gui/layerproperties/ProportionalSymbolsPanel.java
ProportionalSymbolsPanel.java | ||
---|---|---|
71 | 71 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
72 | 72 |
import org.gvsig.fmap.dal.feature.FeatureType; |
73 | 73 |
import org.gvsig.fmap.geom.Geometry; |
74 |
import org.gvsig.fmap.geom.GeometryLocator; |
|
75 |
import org.gvsig.fmap.geom.GeometryManager; |
|
74 | 76 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
75 | 77 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
76 | 78 |
import org.gvsig.fmap.mapcontext.layers.operations.ClassifiableVectorial; |
... | ... | |
283 | 285 |
private ISymbol newSymbol(int shapeType, double size) { |
284 | 286 |
if (getTemplSymbol().getSymbol() == null) { |
285 | 287 |
ISymbol templateSymbol; |
286 |
switch (shapeType) { |
|
287 |
|
|
288 |
case Geometry.TYPES.POINT: |
|
289 |
case Geometry.TYPES.MULTIPOINT: |
|
290 |
case Geometry.TYPES.SURFACE: |
|
291 |
case Geometry.TYPES.MULTISURFACE: |
|
288 |
GeometryManager geomManager = GeometryLocator.getGeometryManager(); |
|
289 |
if( geomManager.isSubtype(Geometry.TYPES.POINT, shapeType) || |
|
290 |
geomManager.isSubtype(Geometry.TYPES.MULTIPOINT, shapeType) || |
|
291 |
geomManager.isSubtype(Geometry.TYPES.SURFACE, shapeType) || |
|
292 |
geomManager.isSubtype(Geometry.TYPES.MULTISURFACE, shapeType) ) { |
|
292 | 293 |
templateSymbol = new SimpleMarkerSymbol(); |
293 | 294 |
((SimpleMarkerSymbol) templateSymbol).setSize(size); |
294 | 295 |
((SimpleMarkerSymbol) templateSymbol).setColor(Color.DARK_GRAY); |
295 |
break; |
|
296 |
|
|
297 |
case Geometry.TYPES.ARC: |
|
298 |
case Geometry.TYPES.CIRCLE: |
|
299 |
case Geometry.TYPES.CURVE: |
|
300 |
case Geometry.TYPES.ELLIPSE: |
|
301 |
case Geometry.TYPES.ELLIPTICARC: |
|
302 |
case Geometry.TYPES.MULTICURVE: |
|
303 |
case Geometry.TYPES.SPLINE: |
|
296 |
|
|
297 |
} else if( geomManager.isSubtype(Geometry.TYPES.CURVE, shapeType) || |
|
298 |
geomManager.isSubtype(Geometry.TYPES.MULTICURVE, shapeType) ) { |
|
304 | 299 |
templateSymbol = new SimpleLineSymbol(); |
305 | 300 |
((SimpleLineSymbol) templateSymbol).setLineWidth(size); |
306 | 301 |
((SimpleLineSymbol) templateSymbol).setLineColor(Color.DARK_GRAY); |
307 |
break; |
|
308 |
default: |
|
309 |
throw new Error("Unknown symbol type"); |
|
310 |
} |
|
302 |
|
|
303 |
} else { |
|
304 |
throw new RuntimeException("Unknown symbol type"); |
|
305 |
|
|
306 |
} |
|
307 |
|
|
311 | 308 |
getTemplSymbol().setSymbol(templateSymbol); |
312 | 309 |
return newSymbol(shapeType, size); |
313 | 310 |
} else { |
Also available in: Unified diff