Search in sources :

Example 56 with NodeModel

use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.

the class SetBooleanMapPropertyAction method actionPerformed.

public void actionPerformed(ActionEvent e) {
    final Controller controller = Controller.getCurrentController();
    final NodeModel node = controller.getSelection().getSelected();
    final ModeController modeController = controller.getModeController();
    final MapStyle mapStyleController = MapStyle.getController(modeController);
    final MapModel map = node.getMap();
    final String value = mapStyleController.getPropertySetDefault(map, propertyName);
    boolean set = !Boolean.parseBoolean(value);
    mapStyleController.setProperty(map, propertyName, Boolean.toString(set));
    setSelected(set);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ModeController(org.freeplane.features.mode.ModeController) MapModel(org.freeplane.features.map.MapModel) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 57 with NodeModel

use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.

the class FormatContentTransformer method addMajorNumbers.

private void addMajorNumbers(final NodeModel node, StringBuilder builder) {
    if (SummaryNode.isSummaryNode(node)) {
        final NodeModel summaryParentNode = node.getParentNode();
        if (summaryParentNode == null)
            return;
        addMajorNumbers(summaryParentNode, builder);
    } else if (textController.getNodeNumbering(node)) {
        addNumbers(builder, node);
        if (builder.length() > 0)
            builder.append('.');
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel)

Example 58 with NodeModel

use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.

the class AutomaticLayoutController method isAutomaticLevelStyle.

public boolean isAutomaticLevelStyle(NodeModel styleNode) {
    NodeModel parentNode = styleNode.getParentNode();
    if (parentNode == null)
        return false;
    Object userObject = parentNode.getUserObject();
    if (!(userObject instanceof StyleTranslatedObject))
        return false;
    return ((StyleTranslatedObject) userObject).getObject().equals(MapStyleModel.STYLES_AUTOMATIC_LAYOUT);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) TranslatedObject(org.freeplane.core.resources.TranslatedObject)

Example 59 with NodeModel

use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.

the class LastOpenedList method updateLastVisitedNodeId.

private void updateLastVisitedNodeId(final Component mapView) {
    if (!(mapView instanceof MapView))
        return;
    final NodeView selected = ((MapView) mapView).getSelected();
    final RecentFile recentFile = findRecentFileByMapModel(getMapModel(mapView));
    if (selected != null && recentFile != null) {
        NodeModel selectedNode = selected.getModel();
        // if a map has never been visited restoration of the selection has not yet taken place
        if (!selectedNode.isRoot())
            recentFile.lastVisitedNodeId = selectedNode.getID();
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapView(org.freeplane.view.swing.map.MapView) NodeView(org.freeplane.view.swing.map.NodeView)

Example 60 with NodeModel

use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.

the class LastOpenedList method selectLastVisitedNode.

private boolean selectLastVisitedNode(RecentFile recentFile) {
    if (recentFile != null && recentFile.lastVisitedNodeId != null) {
        final MapModel map = Controller.getCurrentController().getMap();
        final NodeModel node = map.getNodeForID(recentFile.lastVisitedNodeId);
        if (node != null && node.hasVisibleContent()) {
            IMapSelection selection = Controller.getCurrentController().getSelection();
            // don't override node selection done by UriManager.loadURI()
            if (selection.isSelected(map.getRootNode()))
                selection.selectAsTheOnlyOneSelected(node);
            return true;
        }
    }
    return false;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection) MapModel(org.freeplane.features.map.MapModel)

Aggregations

NodeModel (org.freeplane.features.map.NodeModel)450 ModeController (org.freeplane.features.mode.ModeController)100 MapModel (org.freeplane.features.map.MapModel)53 Controller (org.freeplane.features.mode.Controller)46 MapStyleModel (org.freeplane.features.styles.MapStyleModel)46 MMapController (org.freeplane.features.map.mindmapmode.MMapController)39 MapController (org.freeplane.features.map.MapController)38 Point (java.awt.Point)37 IStyle (org.freeplane.features.styles.IStyle)36 IActor (org.freeplane.core.undo.IActor)34 IMapSelection (org.freeplane.features.map.IMapSelection)33 ArrayList (java.util.ArrayList)22 NodeView (org.freeplane.view.swing.map.NodeView)20 URI (java.net.URI)19 Color (java.awt.Color)18 Component (java.awt.Component)17 ResourceController (org.freeplane.core.resources.ResourceController)17 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)16 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)15