Search in sources :

Example 1 with AnchorPointImpl

use of org.geotools.styling.AnchorPointImpl in project sldeditor by robward-scisys.

the class DetailsUtilitiesTest method testIsSameAnchorPointAnchorPoint.

/**
 * Test method for {@link
 * com.sldeditor.ui.detail.DetailsUtilities#isSame(org.geotools.styling.AnchorPoint,
 * org.geotools.styling.AnchorPoint)}.
 */
@Test
public void testIsSameAnchorPointAnchorPoint() {
    assertFalse(DetailsUtilities.isSame((AnchorPoint) null, (AnchorPoint) null));
    FilterFactory ff = CommonFactoryFinder.getFilterFactory();
    // Try values that are the same
    AnchorPoint anchorPoint1 = new AnchorPointImpl();
    anchorPoint1.setAnchorPointX(ff.literal(0.58));
    anchorPoint1.setAnchorPointY(ff.literal(0.1));
    AnchorPoint anchorPoint2 = new AnchorPointImpl();
    anchorPoint2.setAnchorPointX(ff.literal(0.58));
    anchorPoint2.setAnchorPointY(ff.literal("0.1"));
    assertTrue(DetailsUtilities.isSame(anchorPoint1, anchorPoint2));
    // Try values that are not the same
    AnchorPoint anchorPoint3 = new AnchorPointImpl();
    anchorPoint3.setAnchorPointX(ff.literal(1.0));
    anchorPoint3.setAnchorPointY(ff.literal(0.1));
    assertFalse(DetailsUtilities.isSame(anchorPoint1, anchorPoint3));
    assertFalse(DetailsUtilities.isSame(anchorPoint2, anchorPoint3));
}
Also used : AnchorPoint(org.geotools.styling.AnchorPoint) FilterFactory(org.opengis.filter.FilterFactory) AnchorPointImpl(org.geotools.styling.AnchorPointImpl) Test(org.junit.jupiter.api.Test)

Aggregations

AnchorPoint (org.geotools.styling.AnchorPoint)1 AnchorPointImpl (org.geotools.styling.AnchorPointImpl)1 Test (org.junit.jupiter.api.Test)1 FilterFactory (org.opengis.filter.FilterFactory)1