Search in sources :

Example 6 with SymbolData

use of com.sldeditor.common.data.SymbolData in project sldeditor by robward-scisys.

the class SymbolDataTest method testSelectedStyledLayerIndex.

@Test
public void testSelectedStyledLayerIndex() {
    SymbolData symbolData = new SymbolData();
    assertEquals(-1, symbolData.getSelectedStyledLayerIndex());
    symbolData.initialiseSelectedStyledLayerIndex();
    assertEquals(0, symbolData.getSelectedStyledLayerIndex());
    symbolData.incrementSelectedStyledLayerIndex();
    symbolData.incrementSelectedStyledLayerIndex();
    assertEquals(2, symbolData.getSelectedStyledLayerIndex());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Test(org.junit.Test)

Example 7 with SymbolData

use of com.sldeditor.common.data.SymbolData in project sldeditor by robward-scisys.

the class SymbolDataTest method testSelectedRuleIndex.

@Test
public void testSelectedRuleIndex() {
    SymbolData symbolData = new SymbolData();
    assertEquals(-1, symbolData.getSelectedRuleIndex());
    symbolData.initialiseSelectedRuleIndex();
    assertEquals(0, symbolData.getSelectedRuleIndex());
    symbolData.incrementSelectedRuleIndex();
    symbolData.incrementSelectedRuleIndex();
    assertEquals(2, symbolData.getSelectedRuleIndex());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Test(org.junit.Test)

Example 8 with SymbolData

use of com.sldeditor.common.data.SymbolData in project sldeditor by robward-scisys.

the class SymbolDataTest method testSetStyledLayer.

@Test
public void testSetStyledLayer() {
    SymbolData symbolData = new SymbolData();
    NamedLayer namedLayer = DefaultSymbols.createNewNamedLayer();
    symbolData.setStyledLayer(namedLayer);
    assertEquals(namedLayer, symbolData.getStyledLayer());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) NamedLayer(org.geotools.styling.NamedLayer) Test(org.junit.Test)

Example 9 with SymbolData

use of com.sldeditor.common.data.SymbolData in project sldeditor by robward-scisys.

the class SymbolDataTest method testSetStyle.

@Test
public void testSetStyle() {
    SymbolData symbolData = new SymbolData();
    Style style = DefaultSymbols.createNewStyle();
    symbolData.setStyle(style);
    assertEquals(style, symbolData.getStyle());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Style(org.geotools.styling.Style) FeatureTypeStyle(org.geotools.styling.FeatureTypeStyle) Test(org.junit.Test)

Example 10 with SymbolData

use of com.sldeditor.common.data.SymbolData in project sldeditor by robward-scisys.

the class SymbolDataTest method testUpdate.

@Test
public void testUpdate() {
    SymbolData symbolData = new SymbolData();
    symbolData.setSymbolizer(DefaultSymbols.createDefaultLineSymbolizer());
    symbolData.setRule(DefaultSymbols.createNewRule());
    symbolData.setStyle(DefaultSymbols.createNewStyle());
    symbolData.setFeatureTypeStyle(DefaultSymbols.createNewFeatureTypeStyle());
    symbolData.setStyledLayer(DefaultSymbols.createNewNamedLayer());
    symbolData.initialiseSelectedSymbolizerIndex();
    symbolData.initialiseSelectedFTSIndex();
    symbolData.initialiseSelectedRuleIndex();
    symbolData.initialiseSelectedStyledLayerIndex();
    symbolData.initialiseSelectedStyleIndex();
    SymbolData newSymbolData = new SymbolData();
    newSymbolData.update(symbolData);
    assertEquals(newSymbolData.getSymbolizer(), symbolData.getSymbolizer());
    assertEquals(newSymbolData.getFeatureTypeStyle(), symbolData.getFeatureTypeStyle());
    assertEquals(newSymbolData.getStyle(), symbolData.getStyle());
    assertEquals(newSymbolData.getStyledLayer(), symbolData.getStyledLayer());
    assertEquals(newSymbolData.getRule(), symbolData.getRule());
    assertEquals(newSymbolData.getSelectedFTSIndex(), symbolData.getSelectedFTSIndex());
    assertEquals(newSymbolData.getSelectedRuleIndex(), symbolData.getSelectedRuleIndex());
    assertEquals(newSymbolData.getSelectedStyledLayerIndex(), symbolData.getSelectedStyledLayerIndex());
    assertEquals(newSymbolData.getSelectedStyleIndex(), symbolData.getSelectedStyleIndex());
    assertEquals(newSymbolData.getSelectedSymbolizerIndex(), symbolData.getSelectedSymbolizerIndex());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Test(org.junit.Test)

Aggregations

SymbolData (com.sldeditor.common.data.SymbolData)12 Test (org.junit.Test)12 FeatureTypeStyle (org.geotools.styling.FeatureTypeStyle)2 LineSymbolizer (org.geotools.styling.LineSymbolizer)1 NamedLayer (org.geotools.styling.NamedLayer)1 Rule (org.geotools.styling.Rule)1 Style (org.geotools.styling.Style)1