Search in sources :

Example 91 with FieldConfigCommonData

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);
}
Also used : ColourFieldConfig(com.sldeditor.ui.detail.ColourFieldConfig) GraphicalSymbol(org.opengis.style.GraphicalSymbol) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigTTF(com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF) FieldConfigColour(com.sldeditor.ui.detail.config.FieldConfigColour) PointFillDetails(com.sldeditor.ui.detail.PointFillDetails) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) GraphicPanelFieldManager(com.sldeditor.ui.detail.GraphicPanelFieldManager) Test(org.junit.Test)

Example 92 with FieldConfigCommonData

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));
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigTTF(com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF) Test(org.junit.Test)

Example 93 with FieldConfigCommonData

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());
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigTTF(com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF) Test(org.junit.Test)

Example 94 with FieldConfigCommonData

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);
}
Also used : FieldConfigTransformation(com.sldeditor.ui.detail.config.transform.FieldConfigTransformation) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 95 with FieldConfigCommonData

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);
}
Also used : FieldConfigTransformation(com.sldeditor.ui.detail.config.transform.FieldConfigTransformation) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Aggregations

FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)322 Test (org.junit.Test)316 Geometry (com.vividsolutions.jts.geom.Geometry)69 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)54 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)44 FieldConfigString (com.sldeditor.ui.detail.config.FieldConfigString)38 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)34 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)24 StyleBuilder (org.geotools.styling.StyleBuilder)24 FieldConfigMarker (com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker)22 UndoEvent (com.sldeditor.common.undo.UndoEvent)20 FieldConfigSlider (com.sldeditor.ui.detail.config.FieldConfigSlider)20 FieldConfigSymbolType (com.sldeditor.ui.detail.config.FieldConfigSymbolType)20 Expression (org.opengis.filter.expression.Expression)20 FieldConfigWindBarbs (com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs)18 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)17 FieldConfigTTF (com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF)17 FieldConfigFilename (com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename)16 FieldConfigArrow (com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow)16 FieldConfigWKT (com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT)16