use of com.revolsys.swing.tree.node.layer.LayerRendererTreeNode in project com.revolsys.open by revolsys.
the class LayerStylePanel method propertyChange.
@SuppressWarnings("unchecked")
@Override
public void propertyChange(final PropertyChangeEvent event) {
final String propertyName = event.getPropertyName();
if ("replaceRenderer".equals(propertyName)) {
saveStylePanel();
final LayerRenderer<? extends Layer> oldRenderer = (LayerRenderer<? extends Layer>) event.getOldValue();
final LayerRenderer<? extends Layer> newRenderer = (LayerRenderer<? extends Layer>) event.getNewValue();
if (oldRenderer == this.rootRenderer && newRenderer != null && newRenderer != oldRenderer) {
Property.removeListener(oldRenderer, this);
this.rootNode.removeNode(0);
Property.addListener(newRenderer, this);
final LayerRendererTreeNode newNode = new LayerRendererTreeNode(newRenderer);
this.rootNode.addNode(newNode);
this.tree.expandAllNodes();
this.rootRenderer = newRenderer;
// setVisible(newRenderer,true);
setSelectedRenderer(newRenderer);
}
} else if ("renderers".equals(propertyName)) {
this.tree.expandAllNodes();
}
}
Aggregations