Search in sources :

Example 1 with SLDTreeSymbolizerButtonState

use of com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState in project sldeditor by robward-scisys.

the class SLDTreeSymbolizerButtonStateTest method testLine.

/**
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#setGeometryType(com.sldeditor.datasource.impl.GeometryTypeEnum)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isMarkerVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isPolygonVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isRasterVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isTextVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlineLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlinePolygonVisible(java.lang.Object, java.lang.Object)}.
 */
@Test
public void testLine() {
    SLDTreeSymbolizerButtonState obj = new SLDTreeSymbolizerButtonState();
    obj.setGeometryType(GeometryTypeEnum.LINE);
    obj.showSymbolizerButtons();
    assertFalse(obj.isLineVisible(null, null));
    assertFalse(obj.isMarkerVisible(null, null));
    assertFalse(obj.isPolygonVisible(null, null));
    assertFalse(obj.isRasterVisible(null, null));
    assertFalse(obj.isTextVisible(null, null));
    assertFalse(obj.isImageOutlineLineVisible(null, null));
    assertFalse(obj.isImageOutlinePolygonVisible(null, null));
    Rule rule = DefaultSymbols.createNewRule();
    assertTrue(obj.isLineVisible(null, rule));
    assertTrue(obj.isTextVisible(null, rule));
}
Also used : SLDTreeSymbolizerButtonState(com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState) Rule(org.geotools.styling.Rule) Test(org.junit.Test)

Example 2 with SLDTreeSymbolizerButtonState

use of com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState in project sldeditor by robward-scisys.

the class SLDTreeSymbolizerButtonStateTest method testMarker.

/**
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#setGeometryType(com.sldeditor.datasource.impl.GeometryTypeEnum)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isMarkerVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isPolygonVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isRasterVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isTextVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlineLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlinePolygonVisible(java.lang.Object, java.lang.Object)}.
 */
@Test
public void testMarker() {
    SLDTreeSymbolizerButtonState obj = new SLDTreeSymbolizerButtonState();
    obj.setGeometryType(GeometryTypeEnum.POINT);
    obj.showSymbolizerButtons();
    assertFalse(obj.isLineVisible(null, null));
    assertFalse(obj.isMarkerVisible(null, null));
    assertFalse(obj.isPolygonVisible(null, null));
    assertFalse(obj.isRasterVisible(null, null));
    assertFalse(obj.isTextVisible(null, null));
    assertFalse(obj.isImageOutlineLineVisible(null, null));
    assertFalse(obj.isImageOutlinePolygonVisible(null, null));
    Rule rule = DefaultSymbols.createNewRule();
    assertTrue(obj.isMarkerVisible(null, rule));
    assertTrue(obj.isTextVisible(null, rule));
}
Also used : SLDTreeSymbolizerButtonState(com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState) Rule(org.geotools.styling.Rule) Test(org.junit.Test)

Example 3 with SLDTreeSymbolizerButtonState

use of com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState in project sldeditor by robward-scisys.

the class SLDTreeSymbolizerButtonStateTest method testDefaultState.

/**
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#showSymbolizerButtons()}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isMarkerVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isPolygonVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isRasterVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isTextVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlineLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlinePolygonVisible(java.lang.Object, java.lang.Object)}.
 */
@Test
public void testDefaultState() {
    SLDTreeSymbolizerButtonState obj = new SLDTreeSymbolizerButtonState();
    // Symbolizers override flag is false so nothing is displayed
    assertFalse(obj.isLineVisible(null, null));
    assertFalse(obj.isMarkerVisible(null, null));
    assertFalse(obj.isPolygonVisible(null, null));
    assertFalse(obj.isRasterVisible(null, null));
    assertFalse(obj.isTextVisible(null, null));
    assertFalse(obj.isImageOutlineLineVisible(null, null));
    assertFalse(obj.isImageOutlinePolygonVisible(null, null));
    // Symbolizers override flag is true so nothing is displayed as no geometry set
    obj.showSymbolizerButtons();
    assertFalse(obj.isLineVisible(null, null));
    assertFalse(obj.isMarkerVisible(null, null));
    assertFalse(obj.isPolygonVisible(null, null));
    assertFalse(obj.isRasterVisible(null, null));
    assertFalse(obj.isTextVisible(null, null));
    assertFalse(obj.isImageOutlineLineVisible(null, null));
    assertFalse(obj.isImageOutlinePolygonVisible(null, null));
}
Also used : SLDTreeSymbolizerButtonState(com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState) Test(org.junit.Test)

Example 4 with SLDTreeSymbolizerButtonState

use of com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState in project sldeditor by robward-scisys.

the class SLDTreeSymbolizerButtonStateTest method testPolygon.

/**
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#setGeometryType(com.sldeditor.datasource.impl.GeometryTypeEnum)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isMarkerVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isPolygonVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isRasterVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isTextVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlineLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlinePolygonVisible(java.lang.Object, java.lang.Object)}.
 */
@Test
public void testPolygon() {
    SLDTreeSymbolizerButtonState obj = new SLDTreeSymbolizerButtonState();
    obj.setGeometryType(GeometryTypeEnum.POLYGON);
    obj.showSymbolizerButtons();
    assertFalse(obj.isLineVisible(null, null));
    assertFalse(obj.isMarkerVisible(null, null));
    assertFalse(obj.isPolygonVisible(null, null));
    assertFalse(obj.isRasterVisible(null, null));
    assertFalse(obj.isTextVisible(null, null));
    assertFalse(obj.isImageOutlineLineVisible(null, null));
    assertFalse(obj.isImageOutlinePolygonVisible(null, null));
    Rule rule = DefaultSymbols.createNewRule();
    assertTrue(obj.isPolygonVisible(null, rule));
    assertTrue(obj.isTextVisible(null, rule));
}
Also used : SLDTreeSymbolizerButtonState(com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState) Rule(org.geotools.styling.Rule) Test(org.junit.Test)

Example 5 with SLDTreeSymbolizerButtonState

use of com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState in project sldeditor by robward-scisys.

the class SLDTreeSymbolizerButtonStateTest method testRaster.

/**
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#setGeometryType(com.sldeditor.datasource.impl.GeometryTypeEnum)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isMarkerVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isPolygonVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isRasterVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isTextVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlineLineVisible(java.lang.Object, java.lang.Object)}.
 * Test method for {@link com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState#isImageOutlinePolygonVisible(java.lang.Object, java.lang.Object)}.
 */
@Test
public void testRaster() {
    SLDTreeSymbolizerButtonState obj = new SLDTreeSymbolizerButtonState();
    obj.setGeometryType(GeometryTypeEnum.RASTER);
    obj.showSymbolizerButtons();
    assertFalse(obj.isLineVisible(null, null));
    assertFalse(obj.isMarkerVisible(null, null));
    assertFalse(obj.isPolygonVisible(null, null));
    assertFalse(obj.isRasterVisible(null, null));
    assertFalse(obj.isTextVisible(null, null));
    assertFalse(obj.isImageOutlineLineVisible(null, null));
    assertFalse(obj.isImageOutlinePolygonVisible(null, null));
    Rule rule = DefaultSymbols.createNewRule();
    assertTrue(obj.isRasterVisible(null, rule));
    assertTrue(obj.isTextVisible(null, rule));
    RasterSymbolizer raster = DefaultSymbols.createDefaultRasterSymbolizer();
    assertTrue(obj.isImageOutlineLineVisible(null, raster));
    assertTrue(obj.isImageOutlinePolygonVisible(null, raster));
    raster.setImageOutline(DefaultSymbols.createDefaultLineSymbolizer());
    assertFalse(obj.isImageOutlineLineVisible(null, raster));
    assertFalse(obj.isImageOutlinePolygonVisible(null, raster));
    raster.setImageOutline(DefaultSymbols.createDefaultPolygonSymbolizer());
    assertFalse(obj.isImageOutlineLineVisible(null, raster));
    assertFalse(obj.isImageOutlinePolygonVisible(null, raster));
}
Also used : RasterSymbolizer(org.geotools.styling.RasterSymbolizer) SLDTreeSymbolizerButtonState(com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState) Rule(org.geotools.styling.Rule) Test(org.junit.Test)

Aggregations

SLDTreeSymbolizerButtonState (com.sldeditor.ui.tree.SLDTreeSymbolizerButtonState)5 Test (org.junit.Test)5 Rule (org.geotools.styling.Rule)4 RasterSymbolizer (org.geotools.styling.RasterSymbolizer)1