Search in sources :

Example 16 with FieldConfigMarker

use of com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker in project sldeditor by robward-scisys.

the class FieldConfigMarkerTest method testSetEnabled.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#internal_setEnabled(boolean)}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#isEnabled()}.
 */
@Test
public void testSetEnabled() {
    // Value only, no attribute/expression dropdown
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(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();
    assertFalse(field.isEnabled());
    expectedValue = false;
    field.internal_setEnabled(expectedValue);
    assertFalse(field.isEnabled());
    // Has attribute/expression dropdown
    valueOnly = false;
    FieldConfigMarker field2 = new FieldConfigMarker(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();
    assertFalse(field2.isEnabled());
    expectedValue = false;
    field2.internal_setEnabled(expectedValue);
    assertFalse(field2.isEnabled());
}
Also used : FieldConfigMarker(com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 17 with FieldConfigMarker

use of com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker in project sldeditor by robward-scisys.

the class FieldConfigMarkerTest method testSetVisible.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#setVisible(boolean)}.
 */
@Test
public void testSetVisible() {
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    boolean expectedValue = true;
    field.setVisible(expectedValue);
    field.createUI();
    expectedValue = false;
    field.setVisible(expectedValue);
}
Also used : FieldConfigMarker(com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 18 with FieldConfigMarker

use of com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker in project sldeditor by robward-scisys.

the class FieldConfigMarkerTest method testSetUpdateSymbolListener.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#setUpdateSymbolListener(com.sldeditor.ui.iface.UpdateSymbolInterface)}.
 */
@Test
public void testSetUpdateSymbolListener() {
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    field.setUpdateSymbolListener(null);
}
Also used : FieldConfigMarker(com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 19 with FieldConfigMarker

use of com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker in project sldeditor by robward-scisys.

the class FieldConfigMarkerTest method testRevertToDefaultValue.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#revertToDefaultValue()}.
 */
@Test
public void testRevertToDefaultValue() {
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    field.revertToDefaultValue();
// Does nothing
}
Also used : FieldConfigMarker(com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 20 with FieldConfigMarker

use of com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker in project sldeditor by robward-scisys.

the class FieldConfigMarkerTest method testGetSymbolClass.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker#getSymbolClass()}.
 */
@Test
public void testGetSymbolClass() {
    boolean valueOnly = true;
    FieldConfigMarker field = new FieldConfigMarker(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    assertEquals(MarkImpl.class, field.getSymbolClass());
}
Also used : FieldConfigMarker(com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Aggregations

FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)22 FieldConfigMarker (com.sldeditor.ui.detail.config.symboltype.FieldConfigMarker)22 Test (org.junit.Test)22 FieldConfigSymbolType (com.sldeditor.ui.detail.config.FieldConfigSymbolType)8 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)7 ColourFieldConfig (com.sldeditor.ui.detail.ColourFieldConfig)7 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)7 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)6 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)6 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)6 FieldConfigSlider (com.sldeditor.ui.detail.config.FieldConfigSlider)6 StyleBuilder (org.geotools.styling.StyleBuilder)4 ValueComboBoxData (com.sldeditor.ui.widgets.ValueComboBoxData)3 ValueComboBoxDataGroup (com.sldeditor.ui.widgets.ValueComboBoxDataGroup)3 ArrayList (java.util.ArrayList)3 Mark (org.geotools.styling.Mark)3 UndoEvent (com.sldeditor.common.undo.UndoEvent)1 LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)1 ExternalGraphicImpl (org.geotools.styling.ExternalGraphicImpl)1 Fill (org.geotools.styling.Fill)1