use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class MAttributeController method performRemoveAttribute.
@Override
public void performRemoveAttribute(final String name) {
final IVisitor remover = new AttributeRemover(name);
final Iterator iterator = new Iterator(remover);
ModeController modeController = Controller.getCurrentModeController();
final NodeModel root = modeController.getMapController().getRootNode();
iterator.iterate(root);
final MapModel map = Controller.getCurrentModeController().getController().getMap();
final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
final IActor actor = new UnregistryAttributeActor(name, attributeRegistry, map);
Controller.getCurrentModeController().execute(actor, map);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class MAttributeController method performReplaceAttributeValue.
@Override
public void performReplaceAttributeValue(final String name, final Object oldValue, final Object newValue) {
Controller controller = Controller.getCurrentController();
final MapModel map = controller.getMap();
ModeController modeController = controller.getModeController();
final AttributeRegistry registry = AttributeRegistry.getRegistry(map);
final IActor actor = new ReplaceAttributeValueActor(registry, name, oldValue, newValue);
Controller.getCurrentModeController().execute(actor, map);
final IVisitor replacer = new AttributeChanger(name, oldValue, newValue);
final Iterator iterator = new Iterator(replacer);
final NodeModel root = modeController.getMapController().getRootNode();
iterator.iterate(root);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class RemoveAllAttributesAction method setEnabled.
@Override
public void setEnabled() {
boolean enable = false;
final AttributeUtilities atrUtil = new AttributeUtilities();
final Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
for (final NodeModel node : nodes) {
if (node != null && atrUtil.hasAttributes(node)) {
enable = true;
break;
}
}
setEnabled(enable);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class RemoveFirstAttributeAction method setEnabled.
@Override
public void setEnabled() {
boolean enable = false;
final AttributeUtilities atrUtil = new AttributeUtilities();
final Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
for (final NodeModel node : nodes) {
if (node != null && atrUtil.hasAttributes(node)) {
enable = true;
break;
}
}
setEnabled(enable);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class ClipboardController method createForNodesFlavor.
public String createForNodesFlavor(final Collection<NodeModel> selectedNodes, final boolean copyInvisible) throws UnsupportedFlavorException, IOException {
String forNodesFlavor = "";
boolean firstLoop = true;
for (final NodeModel tmpNode : selectedNodes) {
if (firstLoop) {
firstLoop = false;
} else {
forNodesFlavor += "<nodeseparator>";
}
forNodesFlavor += copy(tmpNode, copyInvisible).getTransferData(MindMapNodesSelection.mindMapNodesFlavor);
}
return forNodesFlavor;
}
Aggregations