/** * Removes the currently selected element from the tree. If it is an inner node, all its children * will be lost. */ public void removeSelectedElement() { TreePath tp = tree.getSelectionPath(); Object select = tp.getLastPathComponent(); LegendTreeModel tm = (LegendTreeModel) tree.getModel(); if (select instanceof ILegendPanel) { RuleWrapper rw = (RuleWrapper) tp.getPath()[tp.getPath().length - 2]; tree.setSelectionPath(null); tm.removeElement(rw, select); // We refresh the legend container simpleStyleEditor.showDialogForCurrentlySelectedLegend(); // We refresh the icons } else if (select instanceof RuleWrapper) { tree.setSelectionPath(null); tm.removeElement(tm.getRoot(), select); simpleStyleEditor.showDialogForCurrentlySelectedLegend(); } refreshIcons(); }
// TODO: Find usages / Document. public void legendSelected() { showDialogForCurrentlySelectedLegend(); }
// TODO: Find usages / Document. public void legendRenamed(int idx, String newName) { showDialogForCurrentlySelectedLegend(); }
/** * Remove the given panel from the card layout and refresh the display. * * @param panel Panel */ public void legendRemoved(ISELegendPanel panel) { cardLayout.removeLayoutComponent(panel.getComponent()); showDialogForCurrentlySelectedLegend(); }
// TODO: Should this method be moved to LegendTree? public void legendAdded(ISELegendPanel panel) { panel.setId(createNewID()); dialogContainer.add(panel.getId(), getJScrollPane(panel)); showDialogForCurrentlySelectedLegend(); }