use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class EdgeController method getStyleWidth.
private Integer getStyleWidth(final MapModel map, final Collection<IStyle> collection) {
final MapStyleModel model = MapStyleModel.getExtension(map);
for (IStyle styleKey : collection) {
final NodeModel styleNode = model.getStyleNode(styleKey);
if (styleNode == null) {
continue;
}
final EdgeModel styleModel = EdgeModel.getModel(styleNode);
if (styleModel == null) {
continue;
}
final int width = styleModel.getWidth();
if (width == EdgeModel.DEFAULT_WIDTH) {
continue;
}
return width;
}
return null;
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class EdgeColorAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent e) {
final ModeController modeController = Controller.getCurrentModeController();
final NodeModel model = modeController.getMapController().getSelectedNode();
final Controller controller = modeController.getController();
final Color edgeColor = EdgeController.getController().getColor(model);
actionColor = ColorTracker.showCommonJColorChooserDialog(controller.getSelection().getSelected(), TextUtils.getText("choose_edge_color"), edgeColor, EdgeController.STANDARD_EDGE_COLOR);
super.actionPerformed(e);
}
use of org.freeplane.features.map.NodeModel 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.map.NodeModel in project freeplane by freeplane.
the class MoveAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final MClipboardController clipboardController = (MClipboardController) ClipboardController.getController();
final NodeModel parent = Controller.getCurrentController().getSelection().getSelected();
clipboardController.move(clipboardController.getClipboardContents(), parent);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class SelectedPasteAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final MClipboardController clipboardController = (MClipboardController) ClipboardController.getController();
final Collection<IDataFlavorHandler> flavorHandlers = clipboardController.getFlavorHandlers();
if (flavorHandlers.isEmpty()) {
return;
}
final JPanel options = createPane(flavorHandlers);
if (JOptionPane.CANCEL_OPTION == JOptionPane.showConfirmDialog((Component) e.getSource(), options, e.getActionCommand(), JOptionPane.OK_CANCEL_OPTION)) {
return;
}
final NodeModel parent = Controller.getCurrentController().getSelection().getSelected();
final Transferable clipboardContents = clipboardController.getClipboardContents();
clipboardController.paste(clipboardContents, selectedHandler, parent, false, parent.isNewChildLeft());
selectedHandler = null;
}
Aggregations