Merge 1b5fb6350f into d518e9e5a4
This commit is contained in:
commit
1eda78f50f
@ -230,14 +230,14 @@ public class GSImageMosaicEncoder extends GSCoverageEncoder {
|
|||||||
addInputTransparentColor(val);
|
addInputTransparentColor(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getInputTransparentColor() {
|
public String getInputTransparentColor() {
|
||||||
Element el = getParameter(inputTransparentColorFilter);
|
Element el = getParameter(inputTransparentColorFilter);
|
||||||
if (el != null) {
|
if (el != null) {
|
||||||
List<Element> values = el.getChildren();
|
List<Element> values = el.getChildren();
|
||||||
for (Element elm : values) {
|
for (Element elm : values) {
|
||||||
String value = elm.getValue();
|
String value = elm.getValue();
|
||||||
if (!value.equalsIgnoreCase(inputTransparentColor)) {
|
if (!value.equalsIgnoreCase(inputTransparentColor)) {
|
||||||
return Boolean.valueOf(value);
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,16 +265,16 @@ public class GSImageMosaicEncoder extends GSCoverageEncoder {
|
|||||||
|
|
||||||
public void setOutputTransparentColor(final String val) {
|
public void setOutputTransparentColor(final String val) {
|
||||||
removeParameter(outputTransparentColorFilter);
|
removeParameter(outputTransparentColorFilter);
|
||||||
addInputTransparentColor(val);
|
addOutputTransparentColor(val);
|
||||||
}
|
}
|
||||||
public Boolean getOutputTransparentColor() {
|
public String getOutputTransparentColor() {
|
||||||
Element el = getParameter(outputTransparentColorFilter);
|
Element el = getParameter(outputTransparentColorFilter);
|
||||||
if (el != null) {
|
if (el != null) {
|
||||||
List<Element> values = el.getChildren();
|
List<Element> values = el.getChildren();
|
||||||
for (Element elm : values) {
|
for (Element elm : values) {
|
||||||
String value = elm.getValue();
|
String value = elm.getValue();
|
||||||
if (!value.equalsIgnoreCase(outputTransparentColor)) {
|
if (!value.equalsIgnoreCase(outputTransparentColor)) {
|
||||||
return Boolean.valueOf(value);
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -409,7 +409,7 @@ public class GSImageMosaicEncoder extends GSCoverageEncoder {
|
|||||||
|
|
||||||
public void setSORTING(final String val) {
|
public void setSORTING(final String val) {
|
||||||
removeParameter(SORTING_FILTER);
|
removeParameter(SORTING_FILTER);
|
||||||
addBackgroundValues(val);
|
addSORTING(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -432,6 +432,58 @@ public class GSImageMosaicEncoder extends GSCoverageEncoder {
|
|||||||
|
|
||||||
public void setMergeBehavior(final String val) {
|
public void setMergeBehavior(final String val) {
|
||||||
removeParameter(MERGEBEHAVIOR_FILTER);
|
removeParameter(MERGEBEHAVIOR_FILTER);
|
||||||
addBackgroundValues(val);
|
addMergeBehavior(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static String ACCURATERESOLUTIONCOMPUTATION = "Accurate resolution computation";
|
||||||
|
protected void addAccurateResolutionComputation(final boolean val) {
|
||||||
|
final List<Element> list = new ArrayList<Element>(2);
|
||||||
|
list.add(new Element(STRING).setText(ACCURATERESOLUTIONCOMPUTATION));
|
||||||
|
list.add(new Element(STRING).setText((val) ? "true" : "false"));
|
||||||
|
parameters.add(null, list);
|
||||||
|
}
|
||||||
|
private final static Filter ACCURATERESOLUTIONCOMPUTATION_FILTER = new parametersFilter(ACCURATERESOLUTIONCOMPUTATION);
|
||||||
|
public void setAccurateResolutionComputation(final boolean val) {
|
||||||
|
removeParameter(ACCURATERESOLUTIONCOMPUTATION_FILTER);
|
||||||
|
addAccurateResolutionComputation(val);
|
||||||
|
}
|
||||||
|
public Boolean getAccurateResolutionComputation() {
|
||||||
|
Element el = getParameter(ACCURATERESOLUTIONCOMPUTATION_FILTER);
|
||||||
|
if (el != null) {
|
||||||
|
List<Element> values = el.getChildren();
|
||||||
|
for (Element elm : values) {
|
||||||
|
String value = elm.getValue();
|
||||||
|
if (!value.equalsIgnoreCase(ACCURATERESOLUTIONCOMPUTATION)) {
|
||||||
|
return Boolean.valueOf(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static String FOOTPRONTBEHAVIOR = "FootprintBehavior";
|
||||||
|
protected void addFootprintBehavior(final String val) {
|
||||||
|
final List<Element> list = new ArrayList<Element>(2);
|
||||||
|
list.add(new Element(STRING).setText(FOOTPRONTBEHAVIOR));
|
||||||
|
list.add(new Element(STRING).setText(val));
|
||||||
|
parameters.add(null, list);
|
||||||
|
}
|
||||||
|
private final static Filter FOOTPRONTBEHAVIOR_FILTER = new parametersFilter(FOOTPRONTBEHAVIOR);
|
||||||
|
public void setFootprintBehavior(final String val) {
|
||||||
|
removeParameter(FOOTPRONTBEHAVIOR_FILTER);
|
||||||
|
addFootprintBehavior(val);
|
||||||
|
}
|
||||||
|
public String getFootprintBehavior() {
|
||||||
|
Element el = getParameter(FOOTPRONTBEHAVIOR_FILTER);
|
||||||
|
if (el != null) {
|
||||||
|
List<Element> values = el.getChildren();
|
||||||
|
for (Element elm : values) {
|
||||||
|
String value = elm.getValue();
|
||||||
|
if (!value.equalsIgnoreCase(FOOTPRONTBEHAVIOR)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,5 +65,16 @@ public class GSImageMosaicEncoderTest extends TestCase {
|
|||||||
|
|
||||||
encoder.addSUGGESTED_TILE_SIZE("512,512");
|
encoder.addSUGGESTED_TILE_SIZE("512,512");
|
||||||
|
|
||||||
|
encoder.setInputTransparentColor("#FFFFFF");
|
||||||
|
Assert.isTrue(encoder.getInputTransparentColor().equalsIgnoreCase("#FFFFFF"));
|
||||||
|
|
||||||
|
encoder.setOutputTransparentColor("#000000");
|
||||||
|
Assert.isTrue(encoder.getOutputTransparentColor().equalsIgnoreCase("#000000"));
|
||||||
|
|
||||||
|
encoder.setAccurateResolutionComputation(true);
|
||||||
|
Assert.isTrue(encoder.getAccurateResolutionComputation());
|
||||||
|
|
||||||
|
encoder.setFootprintBehavior("None");
|
||||||
|
Assert.isTrue(encoder.getFootprintBehavior().equalsIgnoreCase("None"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user