コード例 #1
0
ファイル: AreaSymbolizer.java プロジェクト: orbisgis/orbisgis
  /**
   * Build a new <code>AreaSymbolizer</code>, using a JAXB element to fill its properties.
   *
   * @param st
   * @throws org.orbisgis.coremap.renderer.se.SeExceptions.InvalidStyle
   */
  public AreaSymbolizer(JAXBElement<AreaSymbolizerType> st) throws InvalidStyle {
    super(st);

    AreaSymbolizerType ast = st.getValue();

    if (ast.getGeometry() != null) {
      this.setGeometryAttribute(new GeometryAttribute(ast.getGeometry()));
    }

    if (ast.getUom() != null) {
      setUom(Uom.fromOgcURN(ast.getUom()));
    }

    if (ast.getPerpendicularOffset() != null) {
      this.setPerpendicularOffset(
          SeParameterFactory.createRealParameter(ast.getPerpendicularOffset()));
    }

    if (ast.getDisplacement() != null) {
      this.setTranslate(new Translate(ast.getDisplacement()));
    }

    if (ast.getFill() != null) {
      this.setFill(Fill.createFromJAXBElement(ast.getFill()));
    }

    if (ast.getStroke() != null) {
      this.setStroke(Stroke.createFromJAXBElement(ast.getStroke()));
    }
  }
コード例 #2
0
ファイル: Category.java プロジェクト: JimmyFarcy/orbisgis
  /**
   * 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());
    }
  }