Search in sources :

Example 6 with SLDTree

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

the class SLDTreeTest method testUpdateNode.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.SLDTree#updateNode(java.lang.Object, java.lang.Object)}.
 */
@Test
public void testUpdateNode() {
    SLDTree tree1 = new SLDTree(null, null);
    tree1.updateNode(null, null);
}
Also used : SLDTree(com.sldeditor.ui.tree.SLDTree) Test(org.junit.Test)

Example 7 with SLDTree

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

the class SLDTreeTest method testSLDTreeNull.

/**
 * Test method for {@link com.sldeditor.ui.tree.SLDTree#SLDTree(java.util.List)} using null
 * values.
 */
@Test
public void testSLDTreeNull() {
    List<RenderSymbolInterface> renderList = null;
    SLDTree tree1 = new SLDTree(renderList, null);
    // Select top level node
    tree1.selectFirstSymbol();
    URL url = SLDTreeTest.class.getResource("/polygon/sld/polygon_attributebasedpolygon.sld");
    String sldContents = readFile(new File(url.getFile()).getAbsolutePath());
    SLDData sldData = new SLDData(null, sldContents);
    StyledLayerDescriptor sld = SLDUtils.createSLDFromString(sldData);
    SelectedSymbol.getInstance().setSld(sld);
    tree1.populateSLD();
    // Nothing selected at this stage
    tree1.leafSelected();
    PopulateDetailsInterface panel = tree1.getSelectedSymbolPanel();
    assertNull(panel);
    // Select top level node
    tree1.selectFirstSymbol();
    tree1.leafSelected();
    panel = tree1.getSelectedSymbolPanel();
    assertNull(panel);
}
Also used : SLDData(com.sldeditor.common.data.SLDData) SLDTree(com.sldeditor.ui.tree.SLDTree) StyledLayerDescriptor(org.geotools.styling.StyledLayerDescriptor) RenderSymbolInterface(com.sldeditor.datasource.RenderSymbolInterface) File(java.io.File) URL(java.net.URL) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface) Test(org.junit.Test)

Example 8 with SLDTree

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

the class SLDTreeTest method testUndoAction.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.SLDTree#undoAction(com.sldeditor.common.undo.UndoInterface)}.
 */
@Test
public void testUndoAction() {
    SLDTree tree1 = new SLDTree(null, null);
    assertEquals(tree1, tree1.getUndoObject());
    tree1.undoAction(null);
}
Also used : SLDTree(com.sldeditor.ui.tree.SLDTree) Test(org.junit.Test)

Example 9 with SLDTree

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

the class SLDEditor method getSymbolPanel.

/**
 * Gets the symbol panel.
 *
 * @return the symbol panel
 */
public PopulateDetailsInterface getSymbolPanel() {
    SLDTree sldTree = uiMgr.getSymbolTree();
    PopulateDetailsInterface panel = sldTree.getSelectedSymbolPanel();
    return panel;
}
Also used : SLDTree(com.sldeditor.ui.tree.SLDTree) PopulateDetailsInterface(com.sldeditor.ui.iface.PopulateDetailsInterface)

Example 10 with SLDTree

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

the class SLDTreeTest method testValueChanged.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.SLDTree#valueChanged(javax.swing.event.TreeSelectionEvent)}.
 */
@Test
public void testValueChanged() {
    // Do nothing, calls leafSelected()
    SLDTree tree1 = new SLDTree(null, null);
    tree1.valueChanged(null);
}
Also used : SLDTree(com.sldeditor.ui.tree.SLDTree) Test(org.junit.Test)

Aggregations

SLDTree (com.sldeditor.ui.tree.SLDTree)11 Test (org.junit.Test)10 RenderSymbolInterface (com.sldeditor.datasource.RenderSymbolInterface)3 PopulateDetailsInterface (com.sldeditor.ui.iface.PopulateDetailsInterface)3 SLDData (com.sldeditor.common.data.SLDData)2 File (java.io.File)2 URL (java.net.URL)2 StyledLayerDescriptor (org.geotools.styling.StyledLayerDescriptor)2 TreeSelectionData (com.sldeditor.TreeSelectionData)1 SymbolizerDetailsPanel (com.sldeditor.ui.detail.SymbolizerDetailsPanel)1 SLDTreeTools (com.sldeditor.ui.tree.SLDTreeTools)1 UpdateTreeStructureInterface (com.sldeditor.ui.tree.UpdateTreeStructureInterface)1