use of com.sldeditor.ui.tree.item.SLDTreeItemInterface in project sldeditor by robward-scisys.
the class SLDTree method leafSelected.
/*
* (non-Javadoc)
*
* @see com.sldeditor.ui.tree.SLDTreeUpdatedInterface#leafSelected()
*/
@Override
public void leafSelected() {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) symbolTree.getLastSelectedPathComponent();
DefaultMutableTreeNode parent = null;
if (node != null) {
Object nodeInfo = node.getUserObject();
if (nodeInfo != null) {
Class<?> classSelected = nodeInfo.getClass();
SLDTreeItemInterface treeItem = TreeItemMap.getInstance().getValue(classSelected);
if (treeItem != null) {
treeItem.itemSelected(node, nodeInfo);
}
if (displayPanel != null) {
Controller.getInstance().setPopulating(true);
Class<?> parentClass = null;
if (node.getParent() != null) {
parent = (DefaultMutableTreeNode) node.getParent();
parentClass = parent.getUserObject().getClass();
// Check to see if node represents a fill
if (classSelected == FillImpl.class) {
// Check to see if fill has been selected
Symbolizer symbolizer = (Symbolizer) parent.getUserObject();
if (!SLDTreeLeafFactory.getInstance().hasFill(symbolizer)) {
parentClass = null;
classSelected = null;
}
} else if (classSelected == StrokeImpl.class) {
// Check to see if stroke has been selected
Symbolizer symbolizer = (Symbolizer) parent.getUserObject();
if (!SLDTreeLeafFactory.getInstance().hasStroke(symbolizer)) {
parentClass = null;
classSelected = null;
}
}
}
displayPanel.show(parentClass, classSelected);
Controller.getInstance().setPopulating(false);
}
if (renderList != null) {
for (RenderSymbolInterface render : renderList) {
render.renderSymbol();
}
}
}
}
if (treeTools != null) {
treeTools.setButtonState(parent, node, this.currentGeometryType);
}
}
Aggregations