Search in sources :

Example 1 with AlwaysUnfoldedNode

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

the class MMapController method addNewSummaryNodeStartEditing.

public void addNewSummaryNodeStartEditing(final NodeModel parentNode, final int start, final int end, final int summaryLevel, final boolean isLeft) {
    ModeController modeController = getMModeController();
    stopEditing();
    final NodeModel newSummaryNode = addNewNode(parentNode, end + 1, isLeft);
    final SummaryNode summary = modeController.getExtension(SummaryNode.class);
    summary.undoableActivateHook(newSummaryNode, SUMMARY);
    AlwaysUnfoldedNode unfolded = modeController.getExtension(AlwaysUnfoldedNode.class);
    unfolded.undoableActivateHook(newSummaryNode, unfolded);
    final FirstGroupNode firstGroupNodeHook = modeController.getExtension(FirstGroupNode.class);
    final NodeModel firstNodeInGroup = parentNode.getChildAt(start);
    if (SummaryNode.isSummaryNode(firstNodeInGroup))
        firstGroupNodeHook.undoableActivateHook(firstNodeInGroup, FIRST_GROUP);
    else {
        final NodeModel previousNode = firstNodeInGroup.previousNode(start, isLeft);
        if (previousNode == null || SummaryNode.isSummaryNode(previousNode) || !SummaryNode.isFirstGroupNode(previousNode)) {
            NodeModel newFirstGroup = addNewNode(parentNode, start, isLeft);
            firstGroupNodeHook.undoableActivateHook(newFirstGroup, FIRST_GROUP);
        }
        firstGroupNodeHook.undoableDeactivateHook(firstNodeInGroup);
    }
    int level = summaryLevel;
    for (int i = start + 1; i <= end; i++) {
        NodeModel node = parentNode.getChildAt(i);
        if (isLeft != node.isLeft())
            continue;
        if (SummaryNode.isSummaryNode(node))
            level++;
        else
            level = 0;
        if (level == summaryLevel && SummaryNode.isFirstGroupNode(node)) {
            if (level > 0)
                firstGroupNodeHook.undoableDeactivateHook(node);
            else
                deleteSingleNodeWithClones(node);
        }
    }
    final NodeModel firstSummaryChildNode = addNewNode(newSummaryNode, 0, isLeft);
    startEditingAfterSelect(firstSummaryChildNode);
    select(firstSummaryChildNode);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) SummaryNode(org.freeplane.features.map.SummaryNode) AlwaysUnfoldedNode(org.freeplane.features.map.AlwaysUnfoldedNode) ModeController(org.freeplane.features.mode.ModeController) MModeController(org.freeplane.features.mode.mindmapmode.MModeController) FirstGroupNode(org.freeplane.features.map.FirstGroupNode) Point(java.awt.Point)

Example 2 with AlwaysUnfoldedNode

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

the class HeadlessMModeControllerFactory method createAddIns.

private void createAddIns() {
    new HierarchicalIcons();
    new AutomaticLayoutController();
    new BlinkingNodeHook();
    SummaryNode.install();
    new AlwaysUnfoldedNode();
    FreeNode.install();
    new AutomaticEdgeColorHook();
    new ViewerController();
    MEncryptionController.install(new MEncryptionController(modeController));
    new ChangeNodeLevelController(modeController);
    NodeHistory.install(modeController);
    modeController.addAction(new ImportMindmanagerFiles());
}
Also used : BlinkingNodeHook(org.freeplane.view.swing.features.BlinkingNodeHook) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) MEncryptionController(org.freeplane.features.encrypt.mindmapmode.MEncryptionController) AutomaticEdgeColorHook(org.freeplane.features.edge.AutomaticEdgeColorHook) ImportMindmanagerFiles(org.freeplane.features.export.mindmapmode.ImportMindmanagerFiles) ChangeNodeLevelController(org.freeplane.features.map.mindmapmode.ChangeNodeLevelController) HierarchicalIcons(org.freeplane.features.icon.HierarchicalIcons) AlwaysUnfoldedNode(org.freeplane.features.map.AlwaysUnfoldedNode) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController)

Example 3 with AlwaysUnfoldedNode

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

the class MModeControllerFactory method createAddIns.

private void createAddIns() {
    final StyleEditorPanel panel = new StyleEditorPanel(modeController, uiFactory, true);
    final JScrollPane styleScrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    UITools.setScrollbarIncrement(styleScrollPane);
    final JComponent tabs = (JComponent) modeController.getUserInputListenerFactory().getToolBar("/format").getComponent(1);
    tabs.add(TextUtils.getText("format_panel"), styleScrollPane);
    new AttributePanelManager(modeController);
    new HierarchicalIcons();
    new AutomaticLayoutController();
    new BlinkingNodeHook();
    SummaryNode.install();
    final MMapController mapController = (MMapController) modeController.getMapController();
    mapController.addMapLifeCycleListener(new SummaryNodeMapUpdater(modeController, mapController));
    final AlwaysUnfoldedNode alwaysUnfoldedNode = new AlwaysUnfoldedNode();
    modeController.addAction(new SetAlwaysUnfoldedNodeFlagsAction(alwaysUnfoldedNode));
    modeController.addAction(new RemoveAllAlwaysUnfoldedNodeFlagsAction(alwaysUnfoldedNode));
    FreeNode.install();
    new CreationModificationDatePresenter();
    modeController.addExtension(ReminderHook.class, new ReminderHook(modeController));
    new AutomaticEdgeColorHook();
    new ViewerController();
    PresentationController.install(modeController);
    modeController.addAction(new AddAttributeAction());
    modeController.addAction(new RemoveFirstAttributeAction());
    modeController.addAction(new RemoveLastAttributeAction());
    modeController.addAction(new RemoveAllAttributesAction());
    modeController.addAction(new AddExternalImageAction());
    modeController.addAction(new RemoveExternalImageAction());
    modeController.addAction(new ChangeExternalImageAction());
    modeController.addAction(new ShowFormatPanelAction());
    modeController.addAction(new FitToPage());
    modeController.addAction(new UpdateCheckAction());
    MEncryptionController.install(new MEncryptionController(modeController));
    modeController.addAction(new IconSelectionPlugin());
    modeController.addAction(new NewParentNode());
    modeController.addAction(new SaveAll());
    modeController.addAction(new SortNodes());
    modeController.addAction(new SplitNode());
    new ChangeNodeLevelController(modeController);
    NodeHistory.install(modeController);
    modeController.addAction(new ImportXmlFile());
    modeController.addAction(new ImportMindmanagerFiles());
}
Also used : StyleEditorPanel(org.freeplane.features.styles.mindmapmode.styleeditorpanel.StyleEditorPanel) RemoveFirstAttributeAction(org.freeplane.features.attribute.mindmapmode.RemoveFirstAttributeAction) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) AddAttributeAction(org.freeplane.features.attribute.mindmapmode.AddAttributeAction) MEncryptionController(org.freeplane.features.encrypt.mindmapmode.MEncryptionController) AutomaticEdgeColorHook(org.freeplane.features.edge.AutomaticEdgeColorHook) ImportMindmanagerFiles(org.freeplane.features.export.mindmapmode.ImportMindmanagerFiles) RemoveExternalImageAction(org.freeplane.view.swing.features.filepreview.RemoveExternalImageAction) FitToPage(org.freeplane.view.swing.features.FitToPage) ChangeNodeLevelController(org.freeplane.features.map.mindmapmode.ChangeNodeLevelController) MMapController(org.freeplane.features.map.mindmapmode.MMapController) ShowFormatPanelAction(org.freeplane.features.styles.mindmapmode.ShowFormatPanelAction) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) RemoveAllAttributesAction(org.freeplane.features.attribute.mindmapmode.RemoveAllAttributesAction) ImportXmlFile(org.freeplane.features.export.mindmapmode.ImportXmlFile) BlinkingNodeHook(org.freeplane.view.swing.features.BlinkingNodeHook) CreationModificationDatePresenter(org.freeplane.features.time.CreationModificationDatePresenter) SplitNode(org.freeplane.features.text.mindmapmode.SplitNode) AlwaysUnfoldedNode(org.freeplane.features.map.AlwaysUnfoldedNode) RemoveLastAttributeAction(org.freeplane.features.attribute.mindmapmode.RemoveLastAttributeAction) SortNodes(org.freeplane.features.text.mindmapmode.SortNodes) IconSelectionPlugin(org.freeplane.features.icon.mindmapmode.IconSelectionPlugin) SummaryNodeMapUpdater(org.freeplane.features.map.mindmapmode.SummaryNodeMapUpdater) SaveAll(org.freeplane.features.url.mindmapmode.SaveAll) JScrollPane(javax.swing.JScrollPane) AddExternalImageAction(org.freeplane.view.swing.features.filepreview.AddExternalImageAction) NewParentNode(org.freeplane.features.map.mindmapmode.NewParentNode) JComponent(javax.swing.JComponent) AttributePanelManager(org.freeplane.view.swing.map.attribute.AttributePanelManager) HierarchicalIcons(org.freeplane.features.icon.HierarchicalIcons) SetAlwaysUnfoldedNodeFlagsAction(org.freeplane.features.map.mindmapmode.SetAlwaysUnfoldedNodeFlagsAction) RemoveAllAlwaysUnfoldedNodeFlagsAction(org.freeplane.features.map.mindmapmode.RemoveAllAlwaysUnfoldedNodeFlagsAction) ChangeExternalImageAction(org.freeplane.view.swing.features.filepreview.ChangeExternalImageAction) ReminderHook(org.freeplane.view.swing.features.time.mindmapmode.ReminderHook)

Aggregations

AlwaysUnfoldedNode (org.freeplane.features.map.AlwaysUnfoldedNode)3 AutomaticEdgeColorHook (org.freeplane.features.edge.AutomaticEdgeColorHook)2 MEncryptionController (org.freeplane.features.encrypt.mindmapmode.MEncryptionController)2 ImportMindmanagerFiles (org.freeplane.features.export.mindmapmode.ImportMindmanagerFiles)2 HierarchicalIcons (org.freeplane.features.icon.HierarchicalIcons)2 ChangeNodeLevelController (org.freeplane.features.map.mindmapmode.ChangeNodeLevelController)2 AutomaticLayoutController (org.freeplane.features.styles.AutomaticLayoutController)2 BlinkingNodeHook (org.freeplane.view.swing.features.BlinkingNodeHook)2 ViewerController (org.freeplane.view.swing.features.filepreview.ViewerController)2 Point (java.awt.Point)1 JComponent (javax.swing.JComponent)1 JScrollPane (javax.swing.JScrollPane)1 AddAttributeAction (org.freeplane.features.attribute.mindmapmode.AddAttributeAction)1 RemoveAllAttributesAction (org.freeplane.features.attribute.mindmapmode.RemoveAllAttributesAction)1 RemoveFirstAttributeAction (org.freeplane.features.attribute.mindmapmode.RemoveFirstAttributeAction)1 RemoveLastAttributeAction (org.freeplane.features.attribute.mindmapmode.RemoveLastAttributeAction)1 ImportXmlFile (org.freeplane.features.export.mindmapmode.ImportXmlFile)1 IconSelectionPlugin (org.freeplane.features.icon.mindmapmode.IconSelectionPlugin)1 FirstGroupNode (org.freeplane.features.map.FirstGroupNode)1 NodeModel (org.freeplane.features.map.NodeModel)1