use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testGetValue.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#getValue(com.sldeditor.ui.detail.GraphicPanelFieldManager, org.opengis.filter.expression.Expression, boolean, boolean)}.
*/
@Test
public void testGetValue() {
GraphicPanelFieldManager fieldConfigManager = null;
Class<?> panelId = PointFillDetails.class;
fieldConfigManager = new GraphicPanelFieldManager(panelId);
FieldIdEnum colourFieldId = FieldIdEnum.FILL_COLOUR;
FieldConfigColour colourField = new FieldConfigColour(new FieldConfigCommonData(panelId, colourFieldId, "", false));
colourField.createUI();
String expectedColourValue = "#012345";
colourField.setTestValue(null, expectedColourValue);
fieldConfigManager.add(colourFieldId, colourField);
ColourFieldConfig fillConfig = new ColourFieldConfig(GroupIdEnum.FILL, FieldIdEnum.FILL_COLOUR, FieldIdEnum.OVERALL_OPACITY, FieldIdEnum.STROKE_WIDTH);
ColourFieldConfig strokeConfig = new ColourFieldConfig(GroupIdEnum.STROKE, FieldIdEnum.STROKE_STROKE_COLOUR, FieldIdEnum.OVERALL_OPACITY, FieldIdEnum.STROKE_FILL_WIDTH);
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), fillConfig, strokeConfig, null);
List<GraphicalSymbol> actualValue = field.getValue(null, null, false, false);
assertTrue(actualValue.isEmpty());
field.createUI();
actualValue = field.getValue(null, null, false, false);
assertTrue(actualValue.isEmpty());
actualValue = field.getValue(fieldConfigManager, null, false, false);
assertTrue(actualValue.size() == 1);
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testGetFill.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#getFill(org.opengis.style.GraphicFill, com.sldeditor.ui.detail.GraphicPanelFieldManager)}.
*/
@Test
public void testGetFill() {
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertNull(field.getFill(null, null));
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testGetVendorOption.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#getVendorOption()}.
*/
@Test
public void testGetVendorOption() {
boolean valueOnly = true;
FieldConfigTTF field = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(VendorOptionManager.getInstance().getDefaultVendorOptionVersion(), field.getVendorOption());
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigTransformationTest method testSetVisible.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.transform.FieldConfigTransformation#setVisible(boolean)}.
*/
@Test
public void testSetVisible() {
boolean valueOnly = true;
FieldConfigTransformation field = new FieldConfigTransformation(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), "edit", "clear");
boolean expectedValue = true;
field.setVisible(expectedValue);
expectedValue = false;
field.setVisible(expectedValue);
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigTransformationTest method testSetTestValueFieldIdString.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.transform.FieldConfigTransformation#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.lang.String)}.
*/
@Test
public void testSetTestValueFieldIdString() {
boolean valueOnly = true;
FieldConfigTransformation field = new FieldConfigTransformation(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), "edit", "clear");
String expectedTestValue = "test value";
field.setTestValue(FieldIdEnum.ANCHOR_POINT_V, expectedTestValue);
assertNull(field.getStringValue());
field.createUI();
field.setTestValue(FieldIdEnum.ANCHOR_POINT_V, expectedTestValue);
assertTrue(expectedTestValue.compareTo(field.getStringValue()) == 0);
}
Aggregations