use of org.freeplane.features.map.IMapSelection in project freeplane by freeplane.
the class ToggleDetailsAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent e) {
checkDetailsEnabled();
if (!foundDetails)
return;
isHidden = !isHidden;
final IMapSelection selection = Controller.getCurrentController().getSelection();
selection.keepNodePosition(selection.getSelected(), 0.0f, 0.0f);
super.actionPerformed(e);
}
use of org.freeplane.features.map.IMapSelection in project freeplane by freeplane.
the class MUIFactory method nodeChanged.
public void nodeChanged(final NodeChangeEvent event) {
IMapSelection selection = Controller.getCurrentController().getSelection();
if (selection != null) {
if (event.getNode() != selection.getSelected()) {
return;
}
}
changeToolbar(event.getNode());
}
use of org.freeplane.features.map.IMapSelection in project freeplane by freeplane.
the class NodeSelector method extendSelection.
public void extendSelection(final MouseEvent e) {
final Controller controller = Controller.getCurrentController();
final NodeView nodeView = getRelatedNodeView(e);
final NodeModel newlySelectedNode = nodeView.getModel();
final boolean extend = Compat.isMacOsX() ? e.isMetaDown() : e.isControlDown();
final boolean range = e.isShiftDown();
final IMapSelection selection = controller.getSelection();
if (range && !extend) {
selection.selectContinuous(newlySelectedNode);
} else if (extend && !range) {
selection.toggleSelected(newlySelectedNode);
}
if (extend == range) {
if (selection.isSelected(newlySelectedNode) && selection.size() == 1 && FocusManager.getCurrentManager().getFocusOwner() instanceof MainView)
return;
else {
selection.selectAsTheOnlyOneSelected(newlySelectedNode);
}
e.consume();
}
}
use of org.freeplane.features.map.IMapSelection in project freeplane by freeplane.
the class MMapController method addNewSummaryNodeStartEditing.
public void addNewSummaryNodeStartEditing(final int summaryLevel, final int start, final int end) {
stopEditing();
ModeController modeController = getMModeController();
final IMapSelection selection = modeController.getController().getSelection();
NodeModel selected = selection.getSelected();
final NodeModel parentNode = selected.getParentNode();
final boolean isLeft = selected.isLeft();
final NodeModel newNode = addNewNode(parentNode, end + 1, isLeft);
final SummaryNode summary = modeController.getExtension(SummaryNode.class);
summary.undoableActivateHook(newNode, summary);
final FirstGroupNode firstGroup = modeController.getExtension(FirstGroupNode.class);
final NodeModel firstNode = parentNode.getChildAt(start);
firstGroup.undoableActivateHook(firstNode, firstGroup);
int level = summaryLevel;
for (int i = start + 1; i < end; i++) {
NodeModel node = parentNode.getChildAt(i);
if (isLeft != node.isLeft())
continue;
if (SummaryNode.isSummaryNode(node))
level++;
else
level = 0;
if (level == summaryLevel && SummaryNode.isFirstGroupNode(node))
firstGroup.undoableActivateHook(node, firstGroup);
}
startEditingAfterSelect(newNode);
select(newNode);
}
use of org.freeplane.features.map.IMapSelection in project freeplane by freeplane.
the class SelectBranchAction method actionPerformed.
@Override
protected void actionPerformed(ActionEvent e, NodeModel node) {
final IMapSelection selection = Controller.getCurrentController().getSelection();
selection.selectBranch(node, true);
}
Aggregations