public void NotifySelection(PaletteElement item) {
    if (selectedElement != null) {
      if (item != selectedElement) {
        selectedElement.setSelected(false);
      }
    }

    if (parent.getFrame().getDiagramManager().getCurrentDiagramEditor() != null)
      parent
          .getFrame()
          .getDiagramManager()
          .getCurrentDiagramEditor()
          .setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

    selectedElement = item;
    parent.NotifySelection(item);

    for (AppCommandListener listener : listeners) {
      listener.handleCommand(item.getCommand());
    }
  }
 public void unselectAllBut(PaletteElement item) {
   if (selectedElement != null && selectedElement != item) selectedElement.setSelected(false);
 }