| | |
| | | // return factory.createMultiPoint(coords.toCoordinateArray()); |
| | | } |
| | | |
| | | public int getTotalWords() |
| | | { |
| | | return (raw[18] & 0x0000ffff); |
| | | } |
| | | |
| | | public void setTotalWords(int value) |
| | | { |
| | | raw[18] = (short) (value & 0x0000ffff); |
| | | } |
| | | |
| | | public int getNumString() |
| | | { |
| | | return (raw[19] & 0x0000ffff); |
| | | } |
| | | |
| | | public void setNumString(int value) |
| | | { |
| | | raw[19] = (short) (value & 0x0000ffff); |
| | | } |
| | | |
| | | public int getNodeNumber() |
| | |
| | | return (raw[20] & 0x0000ffff); |
| | | } |
| | | |
| | | public void setNodeNumber(int value) |
| | | { |
| | | raw[20] = (short) (value & 0x0000ffff); |
| | | } |
| | | |
| | | public int getMaxLength() |
| | | { |
| | | return (raw[21] & 0x00ff); |
| | | } |
| | | |
| | | public void setMaxLength(int value) |
| | | { |
| | | raw[21] = (short) ((value & 0x00ff) | (raw[21] & 0xff00)); |
| | | } |
| | | |
| | | public int getMaxUsed() |
| | |
| | | return ((raw[21] >> 8) & 0x00ff); |
| | | } |
| | | |
| | | public void setMaxUsed(int value) |
| | | { |
| | | raw[21] = (short) (((value << 8) & 0xff00) | (raw[21] & 0x00ff)); |
| | | } |
| | | |
| | | public int getJustification() |
| | | { |
| | | return ((raw[22] >> 8) & 0x00ff); |
| | | } |
| | | |
| | | public void setJustification(int value) |
| | | { |
| | | raw[22] = (short) (((value << 8) & 0xff00) | (raw[22] & 0x00ff)); |
| | | } |
| | | |
| | | public int getFontIndex() |
| | | { |
| | | return (raw[22] & 0x00ff); |
| | | } |
| | | |
| | | public void setFontIndex(int value) |
| | | { |
| | | raw[22] = (short) ((value & 0x00ff) | (raw[22] & 0xff00)); |
| | | } |
| | | |
| | | public double getLineSpacing() |
| | |
| | | lineSpace = ((raw[23] & 0x0000ffff) << 16) | (raw[24] & 0x0000ffff); |
| | | |
| | | return lineSpace; |
| | | } |
| | | |
| | | public void setLineSpacing(double value) |
| | | { |
| | | int temp = (int) (value*1000.0); |
| | | raw[23] = (short) ((temp >> 16) & 0x0000ffff); |
| | | raw[24] = (short) (temp & 0x0000ffff); |
| | | } |
| | | |
| | | public double getTextNodeLength() |
| | |
| | | return DgnUtility.converIntToDouble(lengthMult); |
| | | } |
| | | |
| | | public void setTextNodeLength(double value) |
| | | { |
| | | int temp = DgnUtility.converDoubleToInt(value); |
| | | raw[25] = (short) ((temp >> 16) & 0x0000ffff); |
| | | raw[26] = (short) (temp & 0x0000ffff); |
| | | } |
| | | |
| | | public double getTextNodeHeight() |
| | | { |
| | | int heightMult; |
| | |
| | | return DgnUtility.converIntToDouble(heightMult); |
| | | } |
| | | |
| | | public void setTextNodeHeight(double value) |
| | | { |
| | | int temp = DgnUtility.converDoubleToInt(value); |
| | | raw[27] = (short) ((temp >> 16) & 0x0000ffff); |
| | | raw[28] = (short) (temp & 0x0000ffff); |
| | | } |
| | | |
| | | public double getRotationAngle() |
| | | { |
| | | int rotation = (raw[29] << 16 & 0xffff0000); |
| | | rotation += raw[30]; |
| | | |
| | | return DgnUtility.converIntToRotation(rotation); |
| | | } |
| | | |
| | | public void setRotationAngle(double value) |
| | | { |
| | | int temp = DgnUtility.converRotatioToInt(value); |
| | | raw[29] = (short) (temp >> 16 & 0x0000ffff); |
| | | raw[30] = (short) (temp & 0x0000ffff); |
| | | } |
| | | |
| | | public Coordinate getOrigin() |
| | |
| | | return new Coordinate(dx, dy); |
| | | } |
| | | |
| | | public void setOrigin(Coordinate value) |
| | | { |
| | | int x = DgnUtility.converCoordToUnit(value.x); |
| | | raw[31] = (short) (x >> 16 & 0x0000ffff); |
| | | raw[32] = (short) (x & 0x0000ffff); |
| | | |
| | | int y = DgnUtility.converCoordToUnit(value.y); |
| | | raw[33] = (short) (y >> 16 & 0x0000ffff); |
| | | raw[34] = (short) (y & 0x0000ffff); |
| | | } |
| | | |
| | | public Object clone() throws CloneNotSupportedException |
| | | { |
| | | int pos = this.rawBuffer.position(); |
| | | this.rawBuffer.position(0); |
| | | byte[] rawBytes = this.rawBuffer.array(); |
| | | byte[] otherRaw = new byte[rawBytes.length]; |
| | | System.arraycopy(rawBytes, 0, otherRaw, 0, rawBytes.length); |
| | | this.rawBuffer.position(pos); |
| | | |
| | | TextNodeElement other = new TextNodeElement(otherRaw); |
| | | for (Object o : this) |
| | | { |
| | | TextElement textElm = (TextElement) o; |
| | | other.add(textElm.clone()); |
| | | } |
| | | |
| | | return other; |
| | | } |
| | | |
| | | public static class ElementHandler extends Element.ElementHandler |
| | | { |
| | | private static ElementHandler instance = null; |