styleBlackboard.setSelected(new String[]{SLDContent.ID});
}
style.setName(layer.getName());
ArrayList<CoverageRule> listOfRules = new ArrayList<CoverageRule>();
// Rule ruleToUpdate = SLDs.getRasterSymbolizerRule(style);
RasterSymbolizer rasterSymbolizer = SLDs.rasterSymbolizer(style);
ColorMap colorMap = rasterSymbolizer.getColorMap();
ColorMapEntry[] colorMapEntries = colorMap.getColorMapEntries();
for( int i = 0; i < colorMapEntries.length - 1; i = i + 2 ) {
double fromQuantity = getQuantity(colorMapEntries[i]);
java.awt.Color f = getColor(colorMapEntries[i]);
double fromOpacity = getOpacity(colorMapEntries[i]);
double toQuantity = getQuantity(colorMapEntries[i + 1]);
java.awt.Color t = getColor(colorMapEntries[i + 1]);
// double toOpacity = getOpacity(colorMapEntries[i + 1]);
Color fromColor = new Color(Display.getDefault(), f.getRed(), f.getGreen(), f.getBlue());
Color toColor = new Color(Display.getDefault(), t.getRed(), t.getGreen(), t.getBlue());
CoverageRule rule = new CoverageRule(new double[]{fromQuantity, toQuantity}, fromColor, toColor, fromOpacity,
true);
listOfRules.add(rule);
}
colorRulesEditor.setLayer(layer);
Double globalOpacity = rasterSymbolizer.getOpacity().evaluate(null, Double.class);
if (globalOpacity != null) {
colorRulesEditor.setAlphaValue((int) (globalOpacity * 100.0));
} else {
colorRulesEditor.setAlphaValue(100);
}