| | |
| | | * |
| | | * @author Ulysses |
| | | * @version 0.1 |
| | | * @since 2006/5/18 ¤U¤È 05:03:46 |
| | | * @since 2006/5/18 �U�� 05:03:46 |
| | | */ |
| | | public class TcbElement extends Element |
| | | { |
| | | public class TcbElement extends Element { |
| | | private static final Logger logger = Logger.getLogger(TcbElement.class); |
| | | |
| | | public TcbElement(byte[] raw) |
| | | { |
| | | TcbElement(byte[] raw) { |
| | | super(raw); |
| | | } |
| | | |
| | | public boolean is2D() |
| | | { |
| | | public boolean is2D() { |
| | | int dimension = (int) (raw[607] & 0x00000004); |
| | | |
| | | if (dimension == 0) |
| | | { |
| | | if (dimension == 0) { |
| | | return true; |
| | | } else |
| | | { |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public String getMasterUnitName() |
| | | { |
| | | public String getMasterUnitName() { |
| | | byte[] master = new byte[1]; |
| | | |
| | | master[0] = (byte) (raw[560] & 0x00ff); |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public String getSubUnitName() |
| | | { |
| | | public String getSubUnitName() { |
| | | byte[] sub = new byte[2]; |
| | | |
| | | sub[0] = (byte) (raw[561] & 0x00ff); |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public int getGraphicGroup() |
| | | { |
| | | public int getGraphicGroup() { |
| | | return (int) (raw[594] & 0x0000ffff); |
| | | } |
| | | |
| | | public static class ElementHandler extends Element.ElementHandler |
| | | { |
| | | public static class ElementHandler extends Element.ElementHandler { |
| | | private static ElementHandler instance = null; |
| | | |
| | | public ElementHandler() |
| | | { |
| | | public ElementHandler() { |
| | | super(ElementType.TCB); |
| | | } |
| | | |
| | | public static IElementHandler getInstance() |
| | | { |
| | | if (instance == null) |
| | | { |
| | | public static IElementHandler getInstance() { |
| | | if (instance == null) { |
| | | instance = new ElementHandler(); |
| | | } |
| | | |
| | | return instance; |
| | | } |
| | | |
| | | protected Element createElement(byte[] raw) |
| | | { |
| | | protected Element createElement(byte[] raw) { |
| | | return new TcbElement(raw); |
| | | } |
| | | } |