Package org.geotools.styling

Examples of org.geotools.styling.ColorMapEntry


     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        ColorMapEntry entry = styleFactory.createColorMapEntry();

        Expression color = filterFactory.literal((String) node.getAttributeValue(
                    "color"));
        entry.setColor(color);

        if (node.getAttributeValue("opacity") != null) {
            Double opacity = (Double) node.getAttributeValue("opacity");
            entry.setOpacity(filterFactory.literal(opacity.doubleValue()));
        }

        if (node.getAttributeValue("quantity") != null) {
            Double quantity = (Double) node.getAttributeValue("quantity");
            entry.setQuantity(filterFactory.literal(quantity.doubleValue()));
        }

        if (node.getAttributeValue("label") != null) {
            String label = (String) node.getAttributeValue("label");
            entry.setLabel(label);
        }

        return entry;
    }
View Full Code Here


            final HAlign hAlign, final VAlign vAling, final Color bkgColor,
            final double bkgOpacity, final String text, final Dimension requestedDimension,
            final Font labelFont, final Color labelFontColor, final boolean fontAntiAliasing,
            final Color borderColor) {

        final ColorMapEntry currentCME = cMapEntries.get(0);
        Color color = LegendUtils.color(currentCME);
        final double opacity = LegendUtils.getOpacity(currentCME);
        color = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * opacity));
        super.add(new SimpleColorManager(color, opacity, requestedDimension, borderColor));

        final String label = currentCME.getLabel();
        final double quantity = LegendUtils.getQuantity(currentCME);
        final String symbol = " = ";
        String rule = Double.toString(quantity) + " " + symbol + " x";

        super.add(new TextManager(rule, vAling, hAlign, bkgColor, requestedDimension, labelFont,
View Full Code Here

            final HAlign hAlign, final VAlign vAling, final Color bkgColor,
            final double bkgOpacity, final String text, final Dimension requestedDimension,
            final Font labelFont, final Color labelFontColor, final boolean fontAntiAliasing,
            final Color borderColor) {

        final ColorMapEntry previousCME = mapEntries.get(0);
        final ColorMapEntry currentCME = mapEntries.get(1);
        boolean leftEdge;
        if (previousCME == null)
            leftEdge = true;
        else
            leftEdge = false;

        Color previousColor;
        if (!leftEdge) {
            previousColor = LegendUtils.color(previousCME);
            final double opacity = LegendUtils.getOpacity(previousCME);
            previousColor = new Color(previousColor.getRed(), previousColor.getGreen(),
                    previousColor.getBlue(), (int) (255 * opacity + 0.5));
        } else
            previousColor = null;

        Color color = LegendUtils.color(currentCME);
        double opacity = LegendUtils.getOpacity(currentCME);
        color = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * opacity));
        super.add(new GradientColorManager(color, opacity, previousColor, requestedDimension,
                borderColor));

        String label = currentCME.getLabel();
        double quantity = LegendUtils.getQuantity(currentCME);

        String symbol = leftEdge ? " > " : " = ";
        String rule = leftEdge ? Double.toString(quantity) + " " + symbol + " x" : Double
                .toString(quantity)
View Full Code Here

    final List<ColorMapEntry> mapEntries, final HAlign hAlign, final VAlign vAling,
            final Color bkgColor, final double bkgOpacity, final String text,
            final Dimension requestedDimension, final Font labelFont, final Color labelFontColor,
            final boolean fontAntiAliasing, final Color borderColor) {

        final ColorMapEntry previousCME = mapEntries.get(0);
        final ColorMapEntry currentCME = mapEntries.get(1);
        boolean leftEdge;
        if (previousCME == null)
            leftEdge = true;
        else
            leftEdge = false;

        Color color = LegendUtils.color(currentCME);
        final double opacity = LegendUtils.getOpacity(currentCME);
        color = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * opacity));
        super.add(new SimpleColorManager(color, opacity, requestedDimension, borderColor));

        String label = currentCME.getLabel();
        double quantity1 = leftEdge ? LegendUtils.getQuantity(currentCME) : LegendUtils
                .getQuantity(previousCME);
        double quantity2 = LegendUtils.getQuantity(currentCME);
        String symbol1 = null, symbol2 = null;
        if (leftEdge)
View Full Code Here

    }
  }

  /** Internal parse method - made protected for unit testing */
  protected ColorMapEntry parseColorMapEntry(Node root) {
    ColorMapEntry symbol = factory.createColorMapEntry();
    NamedNodeMap atts = root.getAttributes();
    if (atts.getNamedItem(colorMapLabelString) != null) {
      symbol.setLabel(atts.getNamedItem(colorMapLabelString)
          .getNodeValue());
    }
    if (atts.getNamedItem(colorMapColorString) != null) {
      symbol.setColor(ff.literal(atts.getNamedItem(colorMapColorString)
          .getNodeValue()));
    }
    if (atts.getNamedItem(colorMapOpacityString) != null) {
      symbol.setOpacity(ff.literal(atts.getNamedItem(
          colorMapOpacityString).getNodeValue()));
    }
    if (atts.getNamedItem(colorMapQuantityString) != null) {
      symbol.setQuantity(ff.literal(atts.getNamedItem(
          colorMapQuantityString).getNodeValue()));
    }

    return symbol;
  }
View Full Code Here

                final HAlign hAlign, final VAlign vAling, final Color bkgColor,
                final double bkgOpacity, final String text, final Dimension requestedDimension,
                final Font labelFont, final Color labelFontColor, final boolean fontAntiAliasing,
                final Color borderColor, final String unit, final int digits, boolean formatQuantity) {

            final ColorMapEntry currentCME = cMapEntries.get(0);
            Color color = LegendUtils.color(currentCME);
            final double opacity = LegendUtils.getOpacity(currentCME);
            color = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * opacity));
            super.add(new ColorManager.SimpleColorManager(color, opacity, requestedDimension, borderColor));

            final String label = currentCME.getLabel();
            final double quantity = LegendUtils.getQuantity(currentCME);
            final String symbol = " = ";
           
            String rule;
            //Added variant for DynamicColorMap
View Full Code Here

                final HAlign hAlign, final VAlign vAling, final Color bkgColor,
                final double bkgOpacity, final String text, final Dimension requestedDimension,
                final Font labelFont, final Color labelFontColor, final boolean fontAntiAliasing,
                final Color borderColor, final String unit, final int digits, boolean formatQuantity) {

            final ColorMapEntry previousCME = mapEntries.get(0);
            final ColorMapEntry currentCME = mapEntries.get(1);
            boolean leftEdge;
            if (previousCME == null)
                leftEdge = true;
            else
                leftEdge = false;

            Color previousColor;
            if (!leftEdge) {
                previousColor = LegendUtils.color(previousCME);
                final double opacity = LegendUtils.getOpacity(previousCME);
                previousColor = new Color(previousColor.getRed(), previousColor.getGreen(),
                        previousColor.getBlue(), (int) (255 * opacity + 0.5));
            } else {
                previousColor = null;
            }

            Color color = LegendUtils.color(currentCME);
            double opacity = LegendUtils.getOpacity(currentCME);

            color = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * opacity));
            super.add(new ColorManager.SimpleColorManager.GradientColorManager(color, opacity, previousColor, requestedDimension,
                    borderColor));

            String label = currentCME.getLabel();
            double quantity = LegendUtils.getQuantity(currentCME);
           
            // Added variation for DynamicColorMap
            String rule;
           
View Full Code Here

                final Color bkgColor, final double bkgOpacity, final String text,
                final Dimension requestedDimension, final Font labelFont, final Color labelFontColor,
                final boolean fontAntiAliasing, final Color borderColor, final String unit, final int digits,
                boolean formatQuantity) {

            final ColorMapEntry previousCME = mapEntries.get(0);
            final ColorMapEntry currentCME = mapEntries.get(1);
            boolean leftEdge;
            if (previousCME == null)
                leftEdge = true;
            else
                leftEdge = false;

            Color color = LegendUtils.color(currentCME);
            final double opacity = LegendUtils.getOpacity(currentCME);
            color = new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255 * opacity));
            super.add(new ColorManager.SimpleColorManager(color, opacity, requestedDimension, borderColor));

            String label = currentCME.getLabel();
            double quantity1 = leftEdge ? LegendUtils.getQuantity(currentCME) : LegendUtils
                    .getQuantity(previousCME);
            double quantity2 = LegendUtils.getQuantity(currentCME);
           
         // Added variation for DynamicColorMap
View Full Code Here

TOP

Related Classes of org.geotools.styling.ColorMapEntry

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.