| | |
| | | |
| | | import com.vividsolutions.jts.geom.Geometry; |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | import com.vividsolutions.jts.geom.Envelope; |
| | | import com.vividsolutions.jts.geom.Coordinate; |
| | | |
| | | import com.ximple.eofms.util.DefaultColorTable; |
| | | import com.ximple.io.dgn7.Element; |
| | |
| | | import com.ximple.io.dgn7.ArcElement; |
| | | import com.ximple.io.dgn7.EllipseElement; |
| | | import com.ximple.io.dgn7.ComplexChainElement; |
| | | import com.ximple.io.dgn7.TextNodeElement; |
| | | |
| | | public class GeneralDgnConvertJobContext extends AbstractDgnFileJobContext |
| | | { |
| | |
| | | { |
| | | TextElement textElement = (TextElement) element; |
| | | convertDecorator.setConverter(textElement); |
| | | |
| | | Geometry geom = convertDecorator.toGeometry(geometryFactory); |
| | | double angle = textElement.getRotationAngle(); |
| | | if (geom != null) |
| | |
| | | logger.info("geometry is null." + element.toString()); |
| | | } |
| | | return null; |
| | | } else if (element instanceof TextNodeElement) |
| | | { |
| | | TextNodeElement textNodeElement = (TextNodeElement) element; |
| | | convertDecorator.setConverter(textNodeElement); |
| | | |
| | | Geometry geom = convertDecorator.toGeometry(geometryFactory); |
| | | double angle = textNodeElement.getRotationAngle(); |
| | | String[] texts = textNodeElement.getTextArray(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (String text : texts) |
| | | { |
| | | if (sb.length() != 0) |
| | | sb.append("\n"); |
| | | sb.append(text); |
| | | } |
| | | |
| | | if (geom != null) |
| | | { |
| | | return featureType.create(new Object[]{ |
| | | geom, |
| | | colorTable.getColorCode(textNodeElement.getColorIndex()), |
| | | textNodeElement.getFontIndex(), |
| | | textNodeElement.getJustification(), |
| | | textNodeElement.getTextNodeHeight(), |
| | | textNodeElement.getTextNodeLength(), |
| | | angle, |
| | | sb.toString() |
| | | }); |
| | | } else |
| | | { |
| | | logger.info("geometry is null." + element.toString()); |
| | | } |
| | | return null; |
| | | } else if (element instanceof ShapeElement) |
| | | { |
| | | ShapeElement shapeElement = (ShapeElement) element; |