Search in sources :

Example 11 with FieldConfigColourMap

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

the class FieldConfigColourMapTest method testCreateCopy.

/**
 * Test method for
 * {@link com.sldeditor.ui.detail.config.colourmap.FieldConfigColourMap#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
 */
@Test
public void testCreateCopy() {
    class TestFieldConfigColourMap extends FieldConfigColourMap {

        public TestFieldConfigColourMap(FieldConfigCommonData commonData) {
            super(commonData);
        }

        public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
            return createCopy(fieldConfigBase);
        }
    }
    TestFieldConfigColourMap field = new TestFieldConfigColourMap(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
    FieldConfigColourMap copy = (FieldConfigColourMap) field.callCreateCopy(null);
    assertNull(copy);
    copy = (FieldConfigColourMap) field.callCreateCopy(field);
    assertEquals(field.getFieldId(), copy.getFieldId());
    assertTrue(field.getLabel().compareTo(copy.getLabel()) == 0);
    assertEquals(field.isValueOnly(), copy.isValueOnly());
}
Also used : Geometry(com.vividsolutions.jts.geom.Geometry) FieldConfigColourMap(com.sldeditor.ui.detail.config.colourmap.FieldConfigColourMap) FieldConfigBase(com.sldeditor.ui.detail.config.FieldConfigBase) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) Test(org.junit.Test)

Aggregations

FieldConfigColourMap (com.sldeditor.ui.detail.config.colourmap.FieldConfigColourMap)11 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)10 Geometry (com.vividsolutions.jts.geom.Geometry)10 Test (org.junit.Test)10 ColorMap (org.geotools.styling.ColorMap)4 ColorMapEntryImpl (org.geotools.styling.ColorMapEntryImpl)4 ColorMapImpl (org.geotools.styling.ColorMapImpl)4 FilterFactory (org.opengis.filter.FilterFactory)3 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)2 UndoEvent (com.sldeditor.common.undo.UndoEvent)1 XMLFieldConfigBoolean (com.sldeditor.common.xml.ui.XMLFieldConfigBoolean)1 XMLFieldConfigColour (com.sldeditor.common.xml.ui.XMLFieldConfigColour)1 XMLFieldConfigColourMap (com.sldeditor.common.xml.ui.XMLFieldConfigColourMap)1 XMLFieldConfigDSProperties (com.sldeditor.common.xml.ui.XMLFieldConfigDSProperties)1 XMLFieldConfigDouble (com.sldeditor.common.xml.ui.XMLFieldConfigDouble)1 XMLFieldConfigEnum (com.sldeditor.common.xml.ui.XMLFieldConfigEnum)1 FieldList (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValue.FieldList)1 XMLFieldConfigEnumValueList (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueList)1 XMLFieldConfigFeatureTypeConstraint (com.sldeditor.common.xml.ui.XMLFieldConfigFeatureTypeConstraint)1 XMLFieldConfigFont (com.sldeditor.common.xml.ui.XMLFieldConfigFont)1