Search in sources :

Example 1 with FieldConfigArrow

use of com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow in project sldeditor by robward-scisys.

the class FieldConfigArrowTest method testAttributeSelection.

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

Example 2 with FieldConfigArrow

use of com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow in project sldeditor by robward-scisys.

the class FieldConfigArrowTest method testGenerateExpression.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow#generateExpression()}.
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow#populateExpression(java.lang.Object, org.opengis.filter.expression.Expression)}.
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.lang.String)}.
 */
@Test
public void testGenerateExpression() {
    boolean valueOnly = true;
    FieldConfigArrow field = new FieldConfigArrow(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);
    assertFalse(expectedValue.compareTo(field.getStringValue()) == 0);
    expectedValue = "extshape://arrow?hr=1.2&t=0.34&ab=0.5";
    field.setTestValue(null, expectedValue);
    field.populateExpression(expectedValue);
    assertTrue(expectedValue.compareTo(field.getStringValue()) == 0);
}
Also used : FieldConfigArrow(com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 3 with FieldConfigArrow

use of com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow in project sldeditor by robward-scisys.

the class FieldConfigArrowTest method testGetBasePanel.

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

Example 4 with FieldConfigArrow

use of com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow in project sldeditor by robward-scisys.

the class FieldConfigArrowTest method testGetFill.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow#getFill(org.opengis.style.GraphicFill, com.sldeditor.ui.detail.GraphicPanelFieldManager)}.
 */
@Test
public void testGetFill() {
    boolean valueOnly = true;
    FieldConfigArrow field = new FieldConfigArrow(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
    assertNull(field.getFill(null, null));
}
Also used : FieldConfigArrow(com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Example 5 with FieldConfigArrow

use of com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow in project sldeditor by robward-scisys.

the class FieldConfigArrowTest method testGetFieldList.

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

Aggregations

FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)16 FieldConfigArrow (com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow)16 Test (org.junit.Test)16 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)3 Mark (org.geotools.styling.Mark)3 StyleBuilder (org.geotools.styling.StyleBuilder)3 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)2 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)2 PointFillDetails (com.sldeditor.ui.detail.PointFillDetails)2 FieldConfigColour (com.sldeditor.ui.detail.config.FieldConfigColour)2 FieldConfigSlider (com.sldeditor.ui.detail.config.FieldConfigSlider)2 FieldConfigSymbolType (com.sldeditor.ui.detail.config.FieldConfigSymbolType)2 ColourFieldConfig (com.sldeditor.ui.detail.ColourFieldConfig)1 File (java.io.File)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 ExternalGraphicImpl (org.geotools.styling.ExternalGraphicImpl)1 Expression (org.opengis.filter.expression.Expression)1 GraphicalSymbol (org.opengis.style.GraphicalSymbol)1