use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class LinkController method init.
protected void init() {
createActions();
final MapController mapController = modeController.getMapController();
final ReadManager readManager = mapController.getReadManager();
LinkBuilder linkBuilder = new LinkBuilder(this);
linkBuilder.registerBy(readManager);
// this IContentTransformer is unconditional because the outcome
// (#ID_1698830792 -> Nodename) is usually wanted
final LinkTransformer textTransformer = new LinkTransformer(modeController, 10);
TextController.getController(modeController).addTextTransformer(textTransformer);
textTransformer.registerListeners(modeController);
final INodeSelectionListener listener = new INodeSelectionListener() {
public void onDeselect(final NodeModel node) {
}
public void onSelect(final NodeModel node) {
final URI link = NodeLinks.getValidLink(node);
final String linkString = (link != null ? link.toString() : null);
if (linkString != null) {
Controller.getCurrentController().getViewController().out(linkString);
}
}
};
Controller.getCurrentModeController().getMapController().addNodeSelectionListener(listener);
}
use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class MNodeStyleController method setHorizontalTextAlignment.
public void setHorizontalTextAlignment(final NodeModel node, final HorizontalTextAlignment textAlignment) {
final HorizontalTextAlignment oldTextAlignment = NodeStyleModel.getHorizontalTextAlignment(node);
final IActor actor = new IActor() {
public void act() {
NodeStyleModel.setHorizontalTextAlignment(node, textAlignment);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setHorizontalTextAlignment";
}
public void undo() {
NodeStyleModel.setHorizontalTextAlignment(node, oldTextAlignment);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
};
getModeController().execute(actor, node.getMap());
}
use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class MNodeStyleController method setBorderWidth.
public void setBorderWidth(final NodeModel node, final Quantity<LengthUnits> borderWidth) {
final Quantity<LengthUnits> oldBorderWidth = NodeBorderModel.getBorderWidth(node);
final IActor actor = new IActor() {
public void act() {
NodeBorderModel.setBorderWidth(node, borderWidth);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setBorderWidth";
}
public void undo() {
NodeBorderModel.setBorderWidth(node, oldBorderWidth);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
};
getModeController().execute(actor, node.getMap());
}
use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class NodeIdHighLighter method deHighlight.
public void deHighlight() {
if (originallySelectedNode == null)
return;
final Controller controller = Controller.getCurrentController();
if (controller == null)
return;
final MapController mapController = controller.getModeController().getMapController();
mapController.displayNode(originallySelectedNode);
mapController.select(originallySelectedNode);
foldOriginallyFolded(mapController);
originallySelectedNode = null;
pane.setToolTipText(null);
}
use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class AttributeManagerDialog method applyChanges.
private void applyChanges() {
final Object size = this.size.getSelectedItem();
final int iSize = Integer.parseInt(size.toString());
model.getAttributeController().performSetFontSize(model, iSize);
model.applyChanges();
final MModeController modeController = (MModeController) Controller.getCurrentModeController();
modeController.delayedCommit();
final MapController mapController = modeController.getMapController();
final MapModel map = Controller.getCurrentController().getMap();
assert (AttributeRegistry.getRegistry(map) == model);
mapController.setSaved(map, false);
}
Aggregations