| | |
| | | |
| | | //~--- non-JDK imports -------------------------------------------------------- |
| | | |
| | | import org.apache.log4j.Logger; |
| | | |
| | | import com.vividsolutions.jts.geom.Coordinate; |
| | | import com.vividsolutions.jts.geom.Envelope; |
| | | import com.vividsolutions.jts.geom.Geometry; |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | |
| | | import com.ximple.util.DgnUtility; |
| | | |
| | | /** |
| | | * TextElement |
| | |
| | | */ |
| | | public class TextElement extends Element implements GeometryConverter |
| | | { |
| | | private static final Logger logger = Logger.getLogger(TextElement.class); |
| | | |
| | | public static final int ED_CENTERJUSTIFICATION = 0; |
| | | |
| | | // Enter data field center justification |
| | |
| | | |
| | | x += raw[26] & 0x0000ffff; |
| | | |
| | | double dx = Utility.converUnitToCoord(x); |
| | | double dx = DgnUtility.converUnitToCoord(x); |
| | | int y = (raw[27] << 16 & 0xffff0000); |
| | | |
| | | y += raw[28] & 0x0000ffff; |
| | | |
| | | double dy = Utility.converUnitToCoord(y); |
| | | double dy = DgnUtility.converUnitToCoord(y); |
| | | |
| | | return new Coordinate(dx, dy); |
| | | } |
| | |
| | | double x = origin.x; |
| | | double weight = getUserSetWeight(); |
| | | double height = getUserSetHeight(); |
| | | double angle = Utility.converRotationToRadian(getRotationAngle()); |
| | | double angle = DgnUtility.converRotationToRadian(getRotationAngle()); |
| | | |
| | | x += weight * Math.cos(angle) - height * Math.sin(angle); |
| | | |
| | |
| | | |
| | | height += raw[22] & 0x0000ffff; |
| | | |
| | | return Utility.converIntToDouble(height); |
| | | return DgnUtility.converIntToDouble(height); |
| | | } |
| | | |
| | | public double getTextWidth() |
| | |
| | | |
| | | length += raw[20] & 0x0000ffff; |
| | | |
| | | return Utility.converIntToDouble(length); |
| | | return DgnUtility.converIntToDouble(length); |
| | | } |
| | | |
| | | public int getJustification() |
| | |
| | | |
| | | totation += raw[24] & 0x0000ffff; |
| | | |
| | | return Utility.converIntToRotation(totation); |
| | | return DgnUtility.converIntToRotation(totation); |
| | | } |
| | | |
| | | public boolean isChinese() |