use of org.freeplane.features.edge.EdgeModel in project freeplane by freeplane.
the class EdgeStyleAction method setSelected.
@Override
public void setSelected() {
final NodeModel node = Controller.getCurrentModeController().getMapController().getSelectedNode();
final EdgeModel model = EdgeModel.getModel(node);
if (model != null) {
if (mStyle.equals(model.getStyle())) {
setSelected(true);
return;
}
}
setSelected(false);
}
use of org.freeplane.features.edge.EdgeModel in project freeplane by freeplane.
the class EdgeWidthAction method setSelected.
@Override
public void setSelected() {
final NodeModel node = Controller.getCurrentModeController().getMapController().getSelectedNode();
final EdgeModel model = EdgeModel.getModel(node);
if (model == null) {
if (mWidth == EdgeModel.WIDTH_PARENT) {
setSelected(true);
return;
}
} else if (model.getWidth() == mWidth) {
setSelected(true);
return;
}
setSelected(false);
}
use of org.freeplane.features.edge.EdgeModel in project freeplane by freeplane.
the class MEdgeController method setWidth.
public void setWidth(final NodeModel node, final int width) {
final ModeController modeController = Controller.getCurrentModeController();
final int oldWidth = EdgeModel.createEdgeModel(node).getWidth();
if (width == oldWidth) {
return;
}
final IActor actor = new IActor() {
public void act() {
EdgeModel.createEdgeModel(node).setWidth(width);
modeController.getMapController().nodeChanged(node);
edgeWidthRefresh(node);
}
private void edgeWidthRefresh(final NodeModel node) {
for (final NodeModel child : modeController.getMapController().childrenFolded(node)) {
final EdgeModel edge = EdgeModel.getModel(child);
if (edge == null || edge.getWidth() == EdgeModel.WIDTH_PARENT) {
modeController.getMapController().nodeRefresh(child);
edgeWidthRefresh(child);
}
}
}
public String getDescription() {
return "setWidth";
}
public void undo() {
EdgeModel.createEdgeModel(node).setWidth(oldWidth);
modeController.getMapController().nodeChanged(node);
edgeWidthRefresh(node);
}
};
modeController.execute(actor, node.getMap());
}
use of org.freeplane.features.edge.EdgeModel in project freeplane by freeplane.
the class AttributeTable method updateGridColor.
private void updateGridColor() {
final NodeView nodeView = attributeView.getNodeView();
if (!SwingUtilities.isDescendingFrom(this, nodeView))
return;
final MapView mapView = nodeView.getMap();
final MapStyleModel model = MapStyleModel.getExtension(mapView.getModel());
final NodeModel attributeStyleNode = model.getStyleNodeSafe(MapStyleModel.ATTRIBUTE_STYLE);
final EdgeModel edge = EdgeModel.getModel(attributeStyleNode);
if (edge != null) {
final Color edgeColor = edge.getColor();
setGridAndBorderColor(edgeColor);
} else
this.gridColor = null;
}
use of org.freeplane.features.edge.EdgeModel in project freeplane by freeplane.
the class MEdgeController method setDash.
public void setDash(final NodeModel node, final DashVariant dash) {
final ModeController modeController = Controller.getCurrentModeController();
final DashVariant oldDash = EdgeModel.createEdgeModel(node).getDash();
if (dash == oldDash) {
return;
}
final IActor actor = new IActor() {
public void act() {
EdgeModel.createEdgeModel(node).setDash(dash);
modeController.getMapController().nodeChanged(node);
edgeWidthRefresh(node);
}
private void edgeWidthRefresh(final NodeModel node) {
for (final NodeModel child : modeController.getMapController().childrenUnfolded(node)) {
if (child.getViewers().isEmpty())
continue;
final EdgeModel edge = EdgeModel.getModel(child);
if (edge == null || edge.getWidth() == EdgeModel.WIDTH_PARENT) {
modeController.getMapController().nodeRefresh(child);
edgeWidthRefresh(child);
}
}
}
public String getDescription() {
return "setDash";
}
public void undo() {
EdgeModel.createEdgeModel(node).setDash(oldDash);
modeController.getMapController().nodeChanged(node);
edgeWidthRefresh(node);
}
};
modeController.execute(actor, node.getMap());
}
Aggregations