| | |
| | | import com.ximple.io.dgn7.ShapeElement; |
| | | import com.ximple.io.dgn7.TextElement; |
| | | import com.ximple.io.dgn7.UserAttributeData; |
| | | import com.ximple.io.dgn7.ArcElement; |
| | | import com.ximple.io.dgn7.EllipseElement; |
| | | |
| | | public class GeneralDgnConvertJobContext extends AbstractDgnFileJobContext |
| | | { |
| | |
| | | logger.info("cannot craete feature." + element.toString() + "'" + |
| | | ((LineStringElement) element).getVerticeSize() + "'" + |
| | | ((LineStringElement) element).getStartPoint()); |
| | | else if (element instanceof ArcElement) |
| | | logger.info("cannot craete feature." + element.toString() + "'" + |
| | | ((ArcElement) element).getOrigin().toString() + "'" + |
| | | ((ArcElement) element).getRotationAngle()); |
| | | |
| | | return; |
| | | } |
| | | |
| | |
| | | return typeBuilder.getFeatureType(); |
| | | } |
| | | |
| | | public FeatureType createEllipseFeatureElement(String featureName) throws SchemaException |
| | | { |
| | | if (typeBuilder == null) |
| | | { |
| | | typeBuilder = FeatureTypeBuilder.newInstance(featureName); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("GEOM", Geometry.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMCOLOR", String.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMWEIGHT", Integer.class)); |
| | | typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMSTYLE", Integer.class)); |
| | | } |
| | | return typeBuilder.getFeatureType(); |
| | | } |
| | | |
| | | public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | |
| | | line.getLineStyle() |
| | | }); |
| | | return null; |
| | | /* |
| | | } else if (element instanceof ArcElement) |
| | | { |
| | | ArcElement arcElement = (ArcElement) element; |
| | | convertDecorator.setConverter(arcElement); |
| | | Geometry geom = convertDecorator.toGeometry(geometryFactory); |
| | | if (geom != null) |
| | | return featureType.create(new Object[]{ |
| | | geom, |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | arcElement.getWeight(), |
| | | arcElement.getLineStyle() |
| | | }); |
| | | return null; |
| | | */ |
| | | } else if (element instanceof ArcElement) |
| | | { |
| | | ArcElement arcElement = (ArcElement) element; |
| | | convertDecorator.setConverter(arcElement); |
| | | Geometry geom = convertDecorator.toGeometry(geometryFactory); |
| | | if (geom != null) |
| | | return featureType.create(new Object[]{ |
| | | geom, |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | arcElement.getWeight(), |
| | | arcElement.getLineStyle() |
| | | }); |
| | | return null; |
| | | } else if (element instanceof EllipseElement) |
| | | { |
| | | EllipseElement arcElement = (EllipseElement) element; |
| | | convertDecorator.setConverter(arcElement); |
| | | Geometry geom = convertDecorator.toGeometry(geometryFactory); |
| | | if (geom != null) |
| | | return featureType.create(new Object[]{ |
| | | geom, |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | arcElement.getWeight(), |
| | | arcElement.getLineStyle() |
| | | }); |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | |
| | | featureTypes.put(typeName, createLineFeatureElement(typeName)); |
| | | } |
| | | return featureTypes.get(typeName); |
| | | /* |
| | | } else if (element instanceof ArcElement) |
| | | } else if (element instanceof ArcElement) |
| | | { |
| | | typeName = getFeatureBaseName() + "A"; |
| | | if (!featureTypes.containsKey(typeName)) |
| | | { |
| | | typeName = getFeatureBaseName() + "A"; |
| | | if (!featureTypes.containsKey(typeName)) |
| | | { |
| | | featureTypes.put(typeName, createArcFeatureElement(typeName)); |
| | | } |
| | | return featureTypes.get(typeName); |
| | | */ |
| | | featureTypes.put(typeName, createArcFeatureElement(typeName)); |
| | | } |
| | | return featureTypes.get(typeName); |
| | | } else if (element instanceof EllipseElement) |
| | | { |
| | | typeName = getFeatureBaseName() + "R"; |
| | | if (!featureTypes.containsKey(typeName)) |
| | | { |
| | | featureTypes.put(typeName, createEllipseFeatureElement(typeName)); |
| | | } |
| | | return featureTypes.get(typeName); |
| | | } |
| | | |
| | | return null; |