Search in sources :

Example 81 with FieldConfigCommonData

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

the class FieldConfigFilenameTest method testAttributeSelection.

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

Example 82 with FieldConfigCommonData

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

the class FieldConfigFilenameTest method testGetBasePanel.

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

Example 83 with FieldConfigCommonData

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

the class FieldConfigFilenameTest method testGetVendorOption.

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

Example 84 with FieldConfigCommonData

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

the class FieldConfigFilenameTest method testGenerateExpression.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#generateExpression()}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#populateExpression(java.lang.Object, org.opengis.filter.expression.Expression)}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#populateField(java.lang.String)}.
 * Test method for
 * {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.lang.String)}.
 */
@Test
public void testGenerateExpression() {
    boolean valueOnly = true;
    FieldConfigFilename field = new FieldConfigFilename(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    field.populateExpression((Double) null);
    field.populateField((String) null);
    assertNull(field.getStringValue());
    // Create ui
    field.createUI();
    field.populateExpression((Double) null);
    String expectedValue = "string value";
    field.populateExpression(expectedValue);
    assertEquals(expectedValue, field.getStringValue());
    File f = null;
    try {
        f = File.createTempFile(getClass().getSimpleName(), ".tmp");
    } catch (IOException e) {
        e.printStackTrace();
    }
    try {
        if ((f != null) && (f.toURI() != null)) {
            if (f.toURI().toURL() != null) {
                expectedValue = f.toURI().toURL().toString();
            }
        }
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    field.setTestValue(null, expectedValue);
    field.populateExpression(expectedValue);
    assertTrue(expectedValue.compareTo(field.getStringValue()) == 0);
    f.delete();
}
Also used : MalformedURLException(java.net.MalformedURLException) FieldConfigFilename(com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) IOException(java.io.IOException) File(java.io.File) Test(org.junit.Test)

Example 85 with FieldConfigCommonData

use of com.sldeditor.ui.detail.config.FieldConfigCommonData 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)

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