use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class SetLinkAnchorAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
/**
* @TODO
*
* -# implement GUID as reliable nodeID
* -# correct tickmark handling in menu (BUG)
* -# set tooltip for mouse-over SetLinkAnchorAction in menu
*/
// get reference to selected node
final Controller controller = Controller.getCurrentController();
final NodeModel node = controller.getSelection().getSelected();
// get file path of selected node
File mindmapFile = node.getMap().getFile();
if (mindmapFile == null) {
UITools.errorMessage(TextUtils.getRawText("map_not_saved"));
return;
}
// set idString variable according to file and node info
final String idString = mindmapFile.toURI().toString() + '#' + node.createID();
// save idString in LinkController
((MLinkController) (LinkController.getController())).setAnchorID(idString);
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class FoldingController method handleMouseWheelEvent.
public boolean handleMouseWheelEvent(final MouseWheelEvent e) {
if ((e.getModifiers() & InputEvent.ALT_MASK) != 0) {
Controller controller = Controller.getCurrentController();
final IMapSelection selection = controller.getSelection();
final NodeModel node = selection.getSelected();
if (e.getWheelRotation() > 0) {
unfoldOneStage(node);
} else {
foldOneStage(node);
}
return true;
}
return false;
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class ShowNextChildAction method setEnabled.
@Override
public void setEnabled() {
final Controller controller = Controller.getCurrentController();
if (controller.getSelection() != null) {
final NodeModel selected = controller.getSelection().getSelected();
final MapController mapController = controller.getModeController().getMapController();
final IMapViewManager mapViewManager = controller.getMapViewManager();
super.setEnabled(mapViewManager.isFoldedOnCurrentView(selected) || mapViewManager.hasHiddenChildren(selected));
} else {
super.setEnabled(false);
}
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class ShowNextChildAction method actionPerformed.
public void actionPerformed(ActionEvent e) {
final Controller controller = Controller.getCurrentController();
final NodeModel selected = controller.getSelection().getSelected();
final MapController mapController = controller.getModeController().getMapController();
mapController.showNextChild(selected);
}
use of org.freeplane.features.mode.Controller in project freeplane by freeplane.
the class SetBooleanMapPropertyAction method setEnabled.
public void setEnabled() {
final Controller controller = Controller.getCurrentController();
setEnabled(controller.getSelection() != null);
}
Aggregations