Search in sources :

Example 1 with FeatureTypeStyleTreeItem

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

the class FeatureTypeStyleTreeItemTest method testGetTreeString.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.item.FeatureTypeStyleTreeItem#getTreeString(java.lang.Object)}.
 */
@Test
public void testGetTreeString() {
    FeatureTypeStyleTreeItem item = new FeatureTypeStyleTreeItem();
    String actualValue = item.getTreeString(null, null);
    String expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.featureTypeStyle"), "");
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    FeatureTypeStyle fts = DefaultSymbols.createNewFeatureTypeStyle();
    actualValue = item.getTreeString(null, fts);
    // Default feature type style sets name = name!
    expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.featureTypeStyle"), "name");
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    fts.setName(null);
    actualValue = item.getTreeString(null, fts);
    // Default feature type style sets name = name!
    expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.featureTypeStyle"), "");
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    String expectedName = "test name";
    fts.setName(expectedName);
    actualValue = item.getTreeString(null, fts);
    expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.featureTypeStyle"), expectedName);
    assertTrue(actualValue.compareTo(expectedValue) == 0);
}
Also used : FeatureTypeStyle(org.geotools.styling.FeatureTypeStyle) FeatureTypeStyleTreeItem(com.sldeditor.ui.tree.item.FeatureTypeStyleTreeItem) SLDTreeTools(com.sldeditor.ui.tree.SLDTreeTools) Test(org.junit.Test)

Example 2 with FeatureTypeStyleTreeItem

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

the class FeatureTypeStyleTreeItemTest method testItemSelected.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.item.FeatureTypeStyleTreeItem#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)}.
 */
@Test
public void testItemSelected() {
    FeatureTypeStyleTreeItem item = new FeatureTypeStyleTreeItem();
    item.itemSelected(null, null);
}
Also used : FeatureTypeStyleTreeItem(com.sldeditor.ui.tree.item.FeatureTypeStyleTreeItem) Test(org.junit.Test)

Aggregations

FeatureTypeStyleTreeItem (com.sldeditor.ui.tree.item.FeatureTypeStyleTreeItem)2 Test (org.junit.Test)2 SLDTreeTools (com.sldeditor.ui.tree.SLDTreeTools)1 FeatureTypeStyle (org.geotools.styling.FeatureTypeStyle)1