Package org.geotools.styling

Examples of org.geotools.styling.ShadedRelief


        // check the symbolizer
        RasterSymbolizer rs = (RasterSymbolizer) collector.symbolizers.get(0);
        assertNull(rs.getChannelSelection());
        assertNull(rs.getColorMap());
        ShadedRelief sr = rs.getShadedRelief();
        assertEquals(10.0, sr.getReliefFactor().evaluate(null, Double.class), 0.0);
        assertTrue(sr.isBrightnessOnly());
    }
View Full Code Here


    public ShadedRelief build() {
        if (unset) {
            return null;
        }
        ShadedRelief relief = sf.shadedRelief(factor, brightnessOnly);
        return relief;
    }
View Full Code Here

     * @return copy of shaded or null if not provided
     */
    protected ShadedRelief copy(ShadedRelief shaded) {
        if( shaded == null ) return null;
        Expression reliefFactor = copy( shaded.getReliefFactor() );
        ShadedRelief copy = sf.createShadedRelief( reliefFactor );
        copy.setBrightnessOnly( shaded.isBrightnessOnly() );
       
        return copy;
    }
View Full Code Here

        }
        pages.push(copy);
    }

    public void visit(ShadedRelief sr) {
        final ShadedRelief copy = sf.createShadedRelief(copy(sr.getReliefFactor()));
        copy.setBrightnessOnly(sr.isBrightnessOnly());
        if (STRICT && !copy.equals(sr)) {
            throw new IllegalStateException("Was unable to duplicate provided ShadedRelief:" + sr);
        }
        pages.push(copy);

    }
View Full Code Here

        if (node.hasChild("ReliefFactor")) {
            Double d = (Double) node.getChildValue("ReliefFactor");
            reliefFactor = (Expression) filterFactory.literal(d.doubleValue());
        }

        ShadedRelief shadedRelief = styleFactory.createShadedRelief(reliefFactor);

        if (node.hasChild("BrightnessOnly")) {
            Boolean b = (Boolean) node.getChildValue("BrightnessOnly");
            shadedRelief.setBrightnessOnly(b.booleanValue());
        }

        return shadedRelief;
    }
View Full Code Here

    return symbol;
  }

  /** Internal parse method - made protected for unit testing */
  protected ShadedRelief parseShadedRelief(Node root) {
    ShadedRelief symbol = new ShadedReliefImpl();

    NodeList children = root.getChildNodes();
    final int length = children.getLength();
    for (int i = 0; i < length; i++) {
      Node child = children.item(i);

      if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) {
        continue;
      }
      String childName = child.getLocalName();
      if (childName == null) {
        childName = child.getNodeName();
      }
      if ("BrightnessOnly".equalsIgnoreCase(childName)) {
        symbol.setBrightnessOnly(Boolean
            .getBoolean(getFirstChildValue(child)));
      } else if ("ReliefFactor".equalsIgnoreCase(childName)) {
        try {
          final String reliefString = getFirstChildValue(child);
          Expression relief = ExpressionDOMParser
              .parseExpression(child);
          symbol.setReliefFactor(relief);
        } catch (Exception e) {
          if (LOGGER.isLoggable(Level.WARNING))
            LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
        }
      }
View Full Code Here

TOP

Related Classes of org.geotools.styling.ShadedRelief

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.