use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT in project sldeditor by robward-scisys.
the class FieldConfigWKTTest method testRevertToDefaultValue.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#revertToDefaultValue()}.
*/
@Test
public void testRevertToDefaultValue() {
boolean valueOnly = true;
FieldConfigWKT field = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
field.revertToDefaultValue();
field.createUI();
field.revertToDefaultValue();
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT in project sldeditor by robward-scisys.
the class FieldConfigWKTTest method testAccept.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#accept(org.opengis.style.GraphicalSymbol)}.
*/
@Test
public void testAccept() {
boolean valueOnly = true;
FieldConfigWKT field = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertFalse(field.accept(null));
StyleBuilder styleBuilder = new StyleBuilder();
ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder.createExternalGraphic("test.tmp", "png");
assertFalse(field.accept(externalGraphic));
Mark marker1 = styleBuilder.createMark("star");
assertFalse(field.accept(marker1));
// CHECKSTYLE:OFF
Mark marker2 = styleBuilder.createMark("wkt://MULTILINESTRING((-0.25 -0.25, -0.125 -0.25), (0.125 -0.25, 0.25 -0.25), (-0.25 0.25, -0.125 0.25), (0.125 0.25, 0.25 0.25))");
// CHECKSTYLE:ON
assertTrue(field.accept(marker2));
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT in project sldeditor by robward-scisys.
the class FieldConfigWKTTest method testGetBasePanel.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#getBasePanel()}.
*/
@Test
public void testGetBasePanel() {
boolean valueOnly = true;
FieldConfigWKT field = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertNull(field.getBasePanel());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT in project sldeditor by robward-scisys.
the class FieldConfigWKTTest method testSetEnabled.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#internal_setEnabled(boolean)}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#isEnabled()}.
*/
@Test
public void testSetEnabled() {
// Value only, no attribute/expression dropdown
boolean valueOnly = true;
FieldConfigWKT field = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
// Text field will not have been created
boolean expectedValue = true;
field.internal_setEnabled(expectedValue);
assertFalse(field.isEnabled());
// Create text field
field.createUI();
assertTrue(field.isEnabled());
expectedValue = false;
field.internal_setEnabled(expectedValue);
assertFalse(field.isEnabled());
// Has attribute/expression dropdown
valueOnly = false;
FieldConfigWKT field2 = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
// Text field will not have been created
expectedValue = true;
field2.internal_setEnabled(expectedValue);
assertFalse(field2.isEnabled());
// Create text field
field2.createUI();
assertTrue(field2.isEnabled());
expectedValue = false;
field2.internal_setEnabled(expectedValue);
assertFalse(field2.isEnabled());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT in project sldeditor by robward-scisys.
the class FieldConfigWKTTest method testGetVendorOption.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#getVendorOption()}.
*/
@Test
public void testGetVendorOption() {
boolean valueOnly = true;
FieldConfigWKT field = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(VendorOptionManager.getInstance().getDefaultVendorOptionVersion(), field.getVendorOption());
}
Aggregations