/** Move the currently selected element (if any) up in the model. */ public void moveSelectedElementUp() { TreePath tp = tree.getSelectionPath(); Object select = tp.getLastPathComponent(); if (select instanceof RuleWrapper) { LegendTreeModel tm = (LegendTreeModel) tree.getModel(); tm.moveElementUp(tm.getRoot(), select); refreshIcons(); } else if (select instanceof ILegendPanel) { RuleWrapper rw = (RuleWrapper) tp.getPath()[tp.getPath().length - 2]; LegendTreeModel tm = (LegendTreeModel) tree.getModel(); tm.moveElementUp(rw, select); refreshIcons(); } }