use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class MNodeStyleController method setBorderColorMatchesEdgeColor.
public void setBorderColorMatchesEdgeColor(final NodeModel node, final Boolean borderColorMatchesEdgeColor) {
final Boolean oldBorderColorMatchesEdgeColor = NodeBorderModel.getBorderColorMatchesEdgeColor(node);
final IActor actor = new IActor() {
public void act() {
NodeBorderModel.setBorderColorMatchesEdgeColor(node, borderColorMatchesEdgeColor);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setBorderColorMatchesEdgeColor";
}
public void undo() {
NodeBorderModel.setBorderColorMatchesEdgeColor(node, oldBorderColorMatchesEdgeColor);
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 setMaxNodeWidth.
public void setMaxNodeWidth(final NodeModel node, final Quantity<LengthUnits> maxNodeWidth) {
Quantity.assertNonNegativeOrNull(maxNodeWidth);
final NodeSizeModel sizeModel = createOwnSizeModel(node);
final Quantity<LengthUnits> oldValue = NodeSizeModel.getMaxNodeWidth(node);
final IActor actor = new IActor() {
public void act() {
sizeModel.setMaxNodeWidth(maxNodeWidth);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setMaxNodeWidth";
}
public void undo() {
sizeModel.setMaxNodeWidth(oldValue);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
};
getModeController().execute(actor, node.getMap());
final Quantity<LengthUnits> minNodeWidth = getMinWidth(node);
if (maxNodeWidth != null && minNodeWidth != null && maxNodeWidth.toBaseUnitsRounded() < minNodeWidth.toBaseUnitsRounded()) {
setMinNodeWidth(node, maxNodeWidth);
}
}
use of org.freeplane.features.map.MapController in project freeplane by freeplane.
the class MNodeStyleController method setBorderDashMatchesEdgeDash.
public void setBorderDashMatchesEdgeDash(final NodeModel node, final Boolean borderDashMatchesEdgeDash) {
final Boolean oldBorderDashMatchesEdgeDash = NodeBorderModel.getBorderDashMatchesEdgeDash(node);
final IActor actor = new IActor() {
public void act() {
NodeBorderModel.setBorderDashMatchesEdgeDash(node, borderDashMatchesEdgeDash);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setBorderDashMatchesEdgeDash";
}
public void undo() {
NodeBorderModel.setBorderDashMatchesEdgeDash(node, oldBorderDashMatchesEdgeDash);
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 setBorderDash.
public void setBorderDash(final NodeModel node, final DashVariant borderDash) {
final DashVariant oldBorderDash = NodeBorderModel.getBorderDash(node);
final IActor actor = new IActor() {
public void act() {
NodeBorderModel.setBorderDash(node, borderDash);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setBorderDash";
}
public void undo() {
NodeBorderModel.setBorderDash(node, oldBorderDash);
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 setMinNodeWidth.
public void setMinNodeWidth(final NodeModel node, final Quantity<LengthUnits> minNodeWidth) {
Quantity.assertNonNegativeOrNull(minNodeWidth);
final NodeSizeModel sizeModel = createOwnSizeModel(node);
final Quantity<LengthUnits> oldValue = NodeSizeModel.getMinNodeWidth(node);
final IActor actor = new IActor() {
public void act() {
sizeModel.setMinNodeWidth(minNodeWidth);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
public String getDescription() {
return "setMinNodeWidth";
}
public void undo() {
sizeModel.setMinNodeWidth(oldValue);
final MapController mapController = getModeController().getMapController();
mapController.nodeChanged(node);
}
};
getModeController().execute(actor, node.getMap());
final Quantity<LengthUnits> maxNodeWidth = getMaxWidth(node);
if (maxNodeWidth != null && minNodeWidth != null && maxNodeWidth.toBaseUnits() < minNodeWidth.toBaseUnits()) {
setMaxNodeWidth(node, minNodeWidth);
}
}
Aggregations