Ejemplo n.º 1
0
 /**
  * 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();
 }
Ejemplo n.º 2
0
 // TODO: Find usages / Document.
 public void legendSelected() {
   showDialogForCurrentlySelectedLegend();
 }
Ejemplo n.º 3
0
 // TODO: Find usages / Document.
 public void legendRenamed(int idx, String newName) {
   showDialogForCurrentlySelectedLegend();
 }
Ejemplo n.º 4
0
 /**
  * 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();
 }
Ejemplo n.º 5
0
 // TODO: Should this method be moved to LegendTree?
 public void legendAdded(ISELegendPanel panel) {
   panel.setId(createNewID());
   dialogContainer.add(panel.getId(), getJScrollPane(panel));
   showDialogForCurrentlySelectedLegend();
 }