public XMLEntity getXMLEntity() {
    XMLEntity xml = new XMLEntity();
    xml.putProperty("className", getClassName());
    xml.putProperty("labelingStrategy", "labelingStrategy");

    try {
      if (getHeightField() != null) {
        xml.putProperty("HeightField", getHeightField());
      }
    } catch (DataException e) {
      Logger.getAnonymousLogger()
          .log(Level.SEVERE, "Acessing TextHeight field.\n" + e.getMessage());
    }

    try {
      if (getColorField() != null) {
        xml.putProperty("ColorField", getColorField());
      }
    } catch (DataException e) {
      Logger.getAnonymousLogger()
          .log(Level.SEVERE, "Acessing ColorField field.\n" + e.getMessage());
    }

    try {
      if (getTextField() != null) {
        xml.putProperty("TextField", getTextField());
      }
    } catch (DataException e) {
      Logger.getAnonymousLogger().log(Level.SEVERE, "Acessing TextField field.\n" + e.getMessage());
    }

    try {
      if (getRotationField() != null) {
        xml.putProperty("RotationField", getRotationField());
      }
    } catch (DataException e) {
      Logger.getAnonymousLogger()
          .log(Level.SEVERE, "Acessing RotationField field.\n" + e.getMessage());
    }

    if (getFont() != null) {
      xml.putProperty("fontSize", getFont().getSize());
      xml.putProperty("fontName", getFont().getName());
      xml.putProperty("fontStyle", getFont().getStyle());
    }
    if (getColorFont() != null) {
      xml.putProperty("Color", StringUtilities.color2String(getColorFont()));
    }
    xml.putProperty("useFixedSize", useFixedSize);
    xml.putProperty("useFixedColor", useFixedColor);
    xml.putProperty("fixedColor", StringUtilities.color2String(fixedColor));
    xml.putProperty("fixedSize", fixedSize);
    xml.putProperty("Unit", unit);
    xml.putProperty("referenceSystem", referenceSystem);
    return xml;
  }
Exemplo n.º 2
0
  public XMLEntity getXMLEntity() {
    XMLEntity xml = new XMLEntity();
    xml.putProperty("className", getClassName());
    xml.putProperty("isShapeVisible", isShapeVisible());
    // color (necessite)
    if (getFillColor() != null)
      xml.putProperty("color", StringUtilities.color2String(getFillColor()));
    xml.putProperty("desc", getDescription());
    xml.putProperty("referenceSystem", getReferenceSystem());
    xml.putProperty("unit", getUnit());
    xml.addChild(markerSymbol.getXMLEntity());
    xml.addChild(markerFillProperties.getXMLEntity());

    if (getOutline() != null) {
      XMLEntity outlineXML = getOutline().getXMLEntity();
      outlineXML.putProperty("id", "outline symbol");
      xml.addChild(outlineXML);
    }
    xml.putProperty("hasOutline", hasOutline());
    return xml;
  }