Esempio n. 1
0
 public void nodeChanged(final NodeChangeEvent event) {
   IMapSelection selection = Controller.getCurrentController().getSelection();
   if (selection != null) {
     if (event.getNode() != selection.getSelected()) {
       return;
     }
   }
   changeToolbar(event.getNode());
 }
Esempio n. 2
0
 public void propertyChange(final PropertyChangeEvent evt) {
   if (internalChange) {
     return;
   }
   final boolean enabled;
   if (evt.getSource().equals(mSet)) {
     enabled = mSet.getBooleanValue();
   } else {
     assert evt.getSource().equals(mProperty);
     enabled = true;
     mSet.setValue(true);
   }
   final IMapSelection selection = Controller.getCurrentController().getSelection();
   final Collection<NodeModel> nodes = selection.getSelection();
   if (enabled) internalChange = true;
   for (final NodeModel node : nodes) {
     applyValue(enabled, node, evt);
   }
   internalChange = false;
   setStyle(selection.getSelected());
 }
Esempio n. 3
0
 public void actionPerformed(final ActionEvent e) {
   final ASelectableCondition condition = filterEditor.getCondition();
   if (condition == null) {
     return;
   }
   final IMapSelection selection = Controller.getCurrentController().getSelection();
   final MapController mapController = Controller.getCurrentModeController().getMapController();
   final NodeModel selected = selection.getSelected();
   final NodeModel rootNode = selected.getMap().getRootNode();
   boolean nodeFound = condition.checkNode(rootNode);
   if (nodeFound) {
     selection.selectAsTheOnlyOneSelected(rootNode);
   }
   NodeModel next = rootNode;
   for (; ; ) {
     next = filterController.findNext(next, rootNode, Direction.FORWARD, condition);
     if (next == null) {
       break;
     }
     mapController.displayNode(next);
     if (nodeFound) {
       selection.toggleSelected(next);
     } else {
       selection.selectAsTheOnlyOneSelected(next);
       nodeFound = true;
     }
   }
   if (condition.checkNode(selected)) selection.makeTheSelected(selected);
 }