use of org.freeplane.core.undo.IActor in project freeplane by freeplane.
the class MMapController method deleteSingleNode.
private void deleteSingleNode(final NodeModel parentNode, final int index) {
final NodeModel node = parentNode.getChildAt(index);
final IActor actor = new IActor() {
public void act() {
deleteWithoutUndo(parentNode, index);
}
public String getDescription() {
return "delete";
}
public void undo() {
(Controller.getCurrentModeController().getMapController()).insertNodeIntoWithoutUndo(node, parentNode, index);
}
};
Controller.getCurrentModeController().execute(actor, parentNode.getMap());
}
use of org.freeplane.core.undo.IActor in project freeplane by freeplane.
the class MLinkController method changeArrowsOfArrowLink.
public void changeArrowsOfArrowLink(final ConnectorModel link, final ArrowType startArrow, final ArrowType endArrow) {
final IActor actor = new IActor() {
private final ArrowType oldEndArrow = link.getEndArrow();
private final ArrowType oldStartArrow = link.getStartArrow();
public void act() {
link.setStartArrow(startArrow);
link.setEndArrow(endArrow);
fireNodeConnectorChange(link.getSource(), link);
}
public String getDescription() {
return "changeArrowsOfArrowLink";
}
public void undo() {
link.setStartArrow(oldStartArrow);
link.setEndArrow(oldEndArrow);
fireNodeConnectorChange(link.getSource(), link);
}
};
Controller.getCurrentModeController().execute(actor, link.getSource().getMap());
}
use of org.freeplane.core.undo.IActor in project freeplane by freeplane.
the class MLinkController method setMiddleLabel.
public void setMiddleLabel(final ConnectorModel model, String label) {
if ("".equals(label)) {
label = null;
}
String oldLabel = model.getMiddleLabel();
if ("".equals(oldLabel)) {
oldLabel = null;
}
if (label == oldLabel || label != null && label.equals(oldLabel)) {
return;
}
final IActor actor = new MiddleLabelSetter(model, oldLabel, label);
Controller.getCurrentModeController().execute(actor, model.getSource().getMap());
}
use of org.freeplane.core.undo.IActor in project freeplane by freeplane.
the class MLinkController method setLabelFontFamily.
public void setLabelFontFamily(final ConnectorModel connector, final String family) {
final String oldFamily = connector.getLabelFontFamily();
if (oldFamily.equals(family)) {
return;
}
final IActor actor = new IActor() {
public void act() {
connector.setLabelFontFamily(family);
final NodeModel node = connector.getSource();
fireNodeConnectorChange(node, connector);
}
public String getDescription() {
return "setConnectorWidth";
}
public void undo() {
connector.setLabelFontFamily(oldFamily);
final NodeModel node = connector.getSource();
fireNodeConnectorChange(node, connector);
}
};
Controller.getCurrentModeController().execute(actor, connector.getSource().getMap());
}
use of org.freeplane.core.undo.IActor in project freeplane by freeplane.
the class MLinkController method setArrowLinkEndPoints.
public void setArrowLinkEndPoints(final ConnectorModel link, final Point startPoint, final Point endPoint) {
final IActor actor = new IActor() {
private final Point oldEndPoint = link.getEndInclination();
private final Point oldStartPoint = link.getStartInclination();
public void act() {
link.setStartInclination(startPoint);
link.setEndInclination(endPoint);
fireNodeConnectorChange(link.getSource(), link);
}
public String getDescription() {
return "setArrowLinkEndPoints";
}
public void undo() {
link.setStartInclination(oldStartPoint);
link.setEndInclination(oldEndPoint);
fireNodeConnectorChange(link.getSource(), link);
}
};
Controller.getCurrentModeController().execute(actor, link.getSource().getMap());
}
Aggregations