Search in sources :

Example 1 with FillTreeItem

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

the class FillTreeItemTest method testGetTreeString.

/**
 * Test method for {@link com.sldeditor.ui.tree.item.FillTreeItem#getTreeString(java.lang.Object)}.
 */
@Test
public void testGetTreeString() {
    FillTreeItem item = new FillTreeItem();
    String actualValue = item.getTreeString(null, null);
    String expectedValue = Localisation.getString(SLDTreeTools.class, "TreeItem.fill");
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    Fill fill = DefaultSymbols.createDefaultGraphicFill();
    actualValue = item.getTreeString(null, fill);
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    actualValue = item.getTreeString(null, fill);
    assertTrue(actualValue.compareTo(expectedValue) == 0);
}
Also used : Fill(org.geotools.styling.Fill) FillTreeItem(com.sldeditor.ui.tree.item.FillTreeItem) Test(org.junit.Test)

Example 2 with FillTreeItem

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

the class FillTreeItemTest method testItemSelected.

/**
 * Test method for {@link com.sldeditor.ui.tree.item.FillTreeItem#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)}.
 */
@Test
public void testItemSelected() {
    FillTreeItem item = new FillTreeItem();
    item.itemSelected(null, null);
    Symbolizer symbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    DefaultMutableTreeNode parentNode = new DefaultMutableTreeNode();
    parentNode.setUserObject(symbolizer);
    DefaultMutableTreeNode node = new DefaultMutableTreeNode();
    parentNode.add(node);
    item.itemSelected(node, symbolizer);
    // Get the code coverage stats up
    item.itemSelected(parentNode, symbolizer);
    parentNode.setUserObject(item);
    item.itemSelected(node, null);
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) FillTreeItem(com.sldeditor.ui.tree.item.FillTreeItem) Symbolizer(org.geotools.styling.Symbolizer) Test(org.junit.Test)

Aggregations

FillTreeItem (com.sldeditor.ui.tree.item.FillTreeItem)2 Test (org.junit.Test)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 Fill (org.geotools.styling.Fill)1 Symbolizer (org.geotools.styling.Symbolizer)1