Search in sources :

Example 1 with FieldConfigTTF

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

the class FieldConfigTTFTest method testGetFieldList.

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

Example 2 with FieldConfigTTF

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

the class FieldConfigTTFTest method testGetConfigField.

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

Example 3 with FieldConfigTTF

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

the class FieldConfigTTFTest method testSetEnabled.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#internal_setEnabled(boolean)}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#isEnabled()}.
 */
@Test
public void testSetEnabled() {
    // Value only, no attribute/expression dropdown
    boolean valueOnly = true;
    FieldConfigTTF field = new FieldConfigTTF(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();
    assertEquals(expectedValue, field.isEnabled());
    expectedValue = false;
    field.internal_setEnabled(expectedValue);
    assertEquals(expectedValue, field.isEnabled());
    // Has attribute/expression dropdown
    valueOnly = false;
    FieldConfigTTF field2 = new FieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    // Text field will not have been created
    expectedValue = true;
    field.internal_setEnabled(expectedValue);
    assertFalse(field2.isEnabled());
    // Create text field
    field2.createUI();
    assertEquals(expectedValue, field2.isEnabled());
    expectedValue = false;
    field2.internal_setEnabled(expectedValue);
    assertEquals(expectedValue, field2.isEnabled());
    expectedValue = false;
    field2.internal_setEnabled(expectedValue);
    assertFalse(field2.isEnabled());
}
Also used : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigTTF(com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF) Test(org.junit.Test)

Example 4 with FieldConfigTTF

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

the class FieldConfigTTFTest method testSetUpdateSymbolListener.

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

Example 5 with FieldConfigTTF

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

the class FieldConfigTTFTest method testSetVisible.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#setVisible(boolean)}.
 */
@Test
public void testSetVisible() {
    boolean valueOnly = true;
    FieldConfigTTF field = new FieldConfigTTF(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 : FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigTTF(com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF) Test(org.junit.Test)

Aggregations

FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)17 FieldConfigTTF (com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF)17 Test (org.junit.Test)17 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)2 ColourFieldConfig (com.sldeditor.ui.detail.ColourFieldConfig)2 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)2 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)2 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)2 Mark (org.geotools.styling.Mark)2 StyleBuilder (org.geotools.styling.StyleBuilder)2 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)1 File (java.io.File)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 ExternalGraphicImpl (org.geotools.styling.ExternalGraphicImpl)1 GraphicalSymbol (org.opengis.style.GraphicalSymbol)1