Example #1
0
  /**
   * Build a new {@code Category} from the given {@code CategoryType}.
   *
   * @param c
   * @throws org.orbisgis.coremap.renderer.se.SeExceptions.InvalidStyle
   */
  public Category(CategoryType c) throws InvalidStyle {
    if (c.getFill() != null) {
      setFill(Fill.createFromJAXBElement(c.getFill()));
    }

    if (c.getGraphic() != null) {
      setGraphicCollection(new GraphicCollection(c.getGraphic(), this));
    }

    if (c.getStroke() != null) {
      setStroke(Stroke.createFromJAXBElement(c.getStroke()));
    }

    if (c.getValue() != null) {
      setMeasure(SeParameterFactory.createRealParameter(c.getValue()));
    }

    if (c.getName() != null) {
      setName(c.getName());
    }
  }
Example #2
0
  /**
   * Get a JAXB representation of this {@code Category}.
   *
   * @return A {@code CategoryType}, that has been built using the values embedded in this {@code
   *     Category} instance.
   */
  CategoryType getJAXBType() {
    CategoryType ct = new CategoryType();

    if (this.getFill() != null) {
      ct.setFill(this.getFill().getJAXBElement());
    }

    if (this.getStroke() != null) {
      ct.setStroke(getStroke().getJAXBElement());
    }

    if (this.getGraphicCollection() != null) {
      ct.setGraphic(getGraphicCollection().getJAXBElement());
    }

    if (this.getMeasure() != null) {
      ct.setValue(getMeasure().getJAXBParameterValueType());
    }

    if (this.getName() != null) {
      ct.setName(getName());
    }

    return ct;
  }