Search in sources :

Example 1 with SymbolData

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

the class SymbolDataTest method testResetData.

@Test
public void testResetData() {
    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.resetData();
    assertNull(symbolData.getSymbolizer());
    assertNull(symbolData.getFeatureTypeStyle());
    assertNull(symbolData.getStyle());
    assertNull(symbolData.getStyledLayer());
    assertNull(symbolData.getRule());
    assertEquals(-1, symbolData.getSelectedFTSIndex());
    assertEquals(-1, symbolData.getSelectedRuleIndex());
    assertEquals(-1, symbolData.getSelectedStyledLayerIndex());
    assertEquals(-1, symbolData.getSelectedStyleIndex());
    assertEquals(-1, symbolData.getSelectedSymbolizerIndex());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Test(org.junit.Test)

Example 2 with SymbolData

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

the class SymbolDataTest method testSelectedFTSIndex.

@Test
public void testSelectedFTSIndex() {
    SymbolData symbolData = new SymbolData();
    assertEquals(-1, symbolData.getSelectedFTSIndex());
    symbolData.initialiseSelectedFTSIndex();
    assertEquals(0, symbolData.getSelectedFTSIndex());
    symbolData.incrementSelectedFTSIndex();
    symbolData.incrementSelectedFTSIndex();
    assertEquals(2, symbolData.getSelectedFTSIndex());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Test(org.junit.Test)

Example 3 with SymbolData

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

the class SymbolDataTest method testSetRule.

@Test
public void testSetRule() {
    SymbolData symbolData = new SymbolData();
    Rule rule = DefaultSymbols.createNewRule();
    symbolData.setRule(rule);
    assertEquals(rule, symbolData.getRule());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Rule(org.geotools.styling.Rule) Test(org.junit.Test)

Example 4 with SymbolData

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

the class SymbolDataTest method testSelectedSymbolizerIndex.

@Test
public void testSelectedSymbolizerIndex() {
    SymbolData symbolData = new SymbolData();
    assertEquals(-1, symbolData.getSelectedSymbolizerIndex());
    symbolData.initialiseSelectedSymbolizerIndex();
    assertEquals(0, symbolData.getSelectedSymbolizerIndex());
    symbolData.incrementSelectedSymbolizerIndex();
    symbolData.incrementSelectedSymbolizerIndex();
    assertEquals(2, symbolData.getSelectedSymbolizerIndex());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) Test(org.junit.Test)

Example 5 with SymbolData

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

the class SymbolDataTest method testSetFeatureTypeStyle.

@Test
public void testSetFeatureTypeStyle() {
    SymbolData symbolData = new SymbolData();
    FeatureTypeStyle fts = DefaultSymbols.createNewFeatureTypeStyle();
    symbolData.setFeatureTypeStyle(fts);
    assertEquals(fts, symbolData.getFeatureTypeStyle());
}
Also used : SymbolData(com.sldeditor.common.data.SymbolData) FeatureTypeStyle(org.geotools.styling.FeatureTypeStyle) 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