예제 #1
0
  public void fromXmlDom(Element e) throws DuplicateIdException {
    String id = e.getAttribute("id");
    setLabel(e.getAttribute("label"));

    NodeList nl = e.getElementsByTagName("transform");
    transform.fromXmlDom((Element) nl.item(0));

    String r = e.getAttribute("rotation");
    if (r.length() > 0) setRotate(Integer.parseInt(r));

    nl = e.getElementsByTagName("custom-properties");
    if (nl.getLength() > 0) {
      nl = ((Element) nl.item(0)).getElementsByTagName("property");

      for (int i = 0; i < nl.getLength(); i++) {
        String k, v;
        k = ((Element) nl.item(i)).getAttribute("key");
        v = ((Element) nl.item(i)).getAttribute("value");
        if (k.length() > 0) customProperties.put(k, v);
      }
    }

    setId(id);
    // selected = Boolean.parseBoolean(e.getAttribute("selected"));
  }