Search in sources :

Example 1 with NodeModel

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) AttributeRegistry(org.freeplane.features.attribute.AttributeRegistry) IActor(org.freeplane.core.undo.IActor) ModeController(org.freeplane.features.mode.ModeController) MapModel(org.freeplane.features.map.MapModel)

Example 2 with NodeModel

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) AttributeRegistry(org.freeplane.features.attribute.AttributeRegistry) IActor(org.freeplane.core.undo.IActor) MapModel(org.freeplane.features.map.MapModel) ModeController(org.freeplane.features.mode.ModeController) AttributeController(org.freeplane.features.attribute.AttributeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 3 with NodeModel

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel)

Example 4 with NodeModel

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel)

Example 5 with NodeModel

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;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel)

Aggregations

NodeModel (org.freeplane.features.map.NodeModel)408 ModeController (org.freeplane.features.mode.ModeController)89 MapModel (org.freeplane.features.map.MapModel)47 Controller (org.freeplane.features.mode.Controller)44 MapStyleModel (org.freeplane.features.styles.MapStyleModel)39 IMapSelection (org.freeplane.features.map.IMapSelection)34 MapController (org.freeplane.features.map.MapController)33 Point (java.awt.Point)32 MMapController (org.freeplane.features.map.mindmapmode.MMapController)31 IStyle (org.freeplane.features.styles.IStyle)31 IActor (org.freeplane.core.undo.IActor)30 NodeView (org.freeplane.view.swing.map.NodeView)22 ArrayList (java.util.ArrayList)20 Color (java.awt.Color)16 URI (java.net.URI)16 ResourceController (org.freeplane.core.resources.ResourceController)16 Component (java.awt.Component)15 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)15 File (java.io.File)14