use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testGetSymbolClass.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#getSymbolClass()}.
*/
@Test
public void testGetSymbolClass() {
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(ExternalGraphicImpl.class, field.getSymbolClass());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testJustSelected.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#justSelected()}.
*/
@Test
public void testJustSelected() {
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
field.justSelected();
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testSetValue.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#setValue(com.sldeditor.ui.detail.GraphicPanelFieldManager, com.sldeditor.ui.detail.config.FieldConfigSymbolType, org.opengis.style.GraphicalSymbol)}.
*/
@Test
public void testSetValue() {
boolean valueOnly = true;
GraphicPanelFieldManager fieldConfigManager = null;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
field.setValue(null, null, null, null, null);
field.setValue(null, fieldConfigManager, null, null, null);
field.createUI();
StyleBuilder styleBuilder = new StyleBuilder();
Mark marker = styleBuilder.createMark("star");
field.setValue(null, null, null, null, marker);
field.setValue(null, fieldConfigManager, null, null, marker);
File f = null;
String filename = null;
try {
f = File.createTempFile(getClass().getSimpleName(), ".png");
} catch (IOException e) {
e.printStackTrace();
}
try {
if ((f != null) && (f.toURI() != null)) {
if (f.toURI().toURL() != null) {
filename = f.toURI().toURL().toString();
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder.createExternalGraphic(filename, "png");
field.setValue(null, fieldConfigManager, null, null, externalGraphic);
if (f != null) {
f.delete();
}
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testGetFieldList.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#getFieldList(com.sldeditor.ui.detail.GraphicPanelFieldManager)}.
*/
@Test
public void testGetFieldList() {
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(4, field.getFieldList(null).size());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testGenerateExpression.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#generateExpression()}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#populateExpression(java.lang.Object, org.opengis.filter.expression.Expression)}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.lang.String)}.
*/
@Test
public void testGenerateExpression() {
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
field.setTestValue(null, (String) null);
field.populateExpression((Double) null);
assertNull(field.getStringValue());
// Create ui
field.createUI();
field.populateExpression((Double) null);
String expectedValue = "string value";
field.populateExpression(expectedValue);
expectedValue = "windbarbs://default(9)[m/s]?hemisphere=s";
field.setTestValue(null, expectedValue);
field.populateExpression(expectedValue);
}
Aggregations