Search in sources :

Example 66 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class FieldConfigBaseTest method testGetPanel.

/**
 * Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#getPanel()}.
 */
@Test
public void testGetPanel() {
    boolean valueOnly = true;
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    String expectedLabel = "test label";
    TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
    assertNull(field.getPanel());
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) Test(org.junit.Test)

Example 67 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class FieldConfigBaseTest method testValueUpdated.

/**
 * Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#valueUpdated()}.
 */
@Test
public void testValueUpdated() {
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    String expectedLabel = "test label";
    TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));
    TestUpdateSymbolInterface listener = new TestUpdateSymbolInterface();
    field.addDataChangedListener(listener);
    assertFalse(listener.hasBeenCalled());
    field.valueUpdated();
    assertTrue(listener.hasBeenCalled());
    assertEquals(ExpressionTypeEnum.E_VALUE, field.getExpressionType());
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) Test(org.junit.Test)

Example 68 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class FieldConfigBaseTest method testGetLabel.

/**
 * Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#getLabel()}.
 */
@Test
public void testGetLabel() {
    boolean valueOnly = true;
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    String expectedLabel = "test label";
    TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
    assertTrue(expectedLabel.compareTo(field.getLabel()) == 0);
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) Test(org.junit.Test)

Example 69 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class FieldConfigBaseTest method testShowOptionField.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.FieldConfigBase#showOptionField(boolean)}.
 */
@Test
public void testShowOptionField() {
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    String expectedLabel = "test label";
    TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));
    field.showOptionField(true);
    field.setOptionFieldValue(true);
    field.createUI();
    field.showOptionField(false);
    field.setOptionFieldValue(false);
    assertNotNull(field.toString());
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) Test(org.junit.Test)

Example 70 with FieldIdEnum

use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.

the class FieldConfigBaseTest method testIsValueOnly.

/**
 * Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#isValueOnly()}.
 */
@Test
public void testIsValueOnly() {
    boolean valueOnly = true;
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    String expectedLabel = "test label";
    TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
    assertEquals(valueOnly, field.isValueOnly());
    valueOnly = false;
    field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
    assertEquals(valueOnly, field.isValueOnly());
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) Test(org.junit.Test)

Aggregations

FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)83 Test (org.junit.Test)55 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)54 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)33 FieldConfigString (com.sldeditor.ui.detail.config.FieldConfigString)28 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)27 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)17 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)16 StyleBuilder (org.geotools.styling.StyleBuilder)14 ColourFieldConfig (com.sldeditor.ui.detail.ColourFieldConfig)13 FieldConfigPopulation (com.sldeditor.ui.detail.config.FieldConfigPopulation)13 Geometry (com.vividsolutions.jts.geom.Geometry)13 Expression (org.opengis.filter.expression.Expression)13 FieldConfigSlider (com.sldeditor.ui.detail.config.FieldConfigSlider)12 FieldConfigSymbolType (com.sldeditor.ui.detail.config.FieldConfigSymbolType)12 GroupIdEnum (com.sldeditor.common.xml.ui.GroupIdEnum)10 GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)8 ArrayList (java.util.ArrayList)8 Mark (org.geotools.styling.Mark)7 StrokeDetails (com.sldeditor.ui.detail.StrokeDetails)6