Search in sources :

Example 1 with AutomaticEdgeColorHook

use of org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook in project freeplane by freeplane.

the class HeadlessMModeControllerFactory method createAddIns.

private void createAddIns() {
    new HierarchicalIcons();
    new AutomaticLayoutController();
    new BlinkingNodeHook();
    SummaryNode.install();
    AlwaysUnfoldedNode.install();
    FreeNode.install();
    new CreationModificationPlugin();
    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) CreationModificationPlugin(org.freeplane.features.time.CreationModificationPlugin) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) MEncryptionController(org.freeplane.features.encrypt.mindmapmode.MEncryptionController) AutomaticEdgeColorHook(org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook) ImportMindmanagerFiles(org.freeplane.features.export.mindmapmode.ImportMindmanagerFiles) ChangeNodeLevelController(org.freeplane.features.map.mindmapmode.ChangeNodeLevelController) HierarchicalIcons(org.freeplane.features.icon.HierarchicalIcons) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController)

Example 2 with AutomaticEdgeColorHook

use of org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook in project freeplane by freeplane.

the class StyleEditorPanel method addAutomaticLayout.

private void addAutomaticLayout(final DefaultFormBuilder rightBuilder) {
    {
        if (mAutomaticLayoutComboBox == null) {
            NamedObject[] automaticLayoutTypes = NamedObject.fromEnum(AutomaticLayout.class);
            mAutomaticLayoutComboBox = new JComboBox(automaticLayoutTypes);
            DefaultComboBoxModel automaticLayoutComboBoxModel = (DefaultComboBoxModel) mAutomaticLayoutComboBox.getModel();
            automaticLayoutComboBoxModel.addElement(AUTOMATIC_LAYOUT_DISABLED);
            automaticLayoutComboBoxModel.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
            mAutomaticLayoutComboBox.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    if (internalChange)
                        return;
                    final ModeController modeController = Controller.getCurrentModeController();
                    AutomaticLayoutController al = modeController.getExtension(AutomaticLayoutController.class);
                    NamedObject selectedItem = (NamedObject) mAutomaticLayoutComboBox.getSelectedItem();
                    al.undoableDeactivateHook(Controller.getCurrentController().getMap().getRootNode());
                    if (!selectedItem.equals(AUTOMATIC_LAYOUT_DISABLED)) {
                        al.undoableActivateHook(Controller.getCurrentController().getMap().getRootNode(), (AutomaticLayout) selectedItem.getObject());
                    }
                }
            });
        }
        final String label = TextUtils.getText("AutomaticLayoutAction.text");
        rightBuilder.append(new JLabel(label), 5);
        rightBuilder.append(mAutomaticLayoutComboBox);
        rightBuilder.nextLine();
    }
    {
        if (mAutomaticEdgeColorCheckBox == null) {
            mAutomaticEdgeColorCheckBox = new JCheckBox();
            mAutomaticEdgeColorCheckBox.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    final ModeController modeController = Controller.getCurrentModeController();
                    AutomaticEdgeColorHook al = (AutomaticEdgeColorHook) modeController.getExtension(AutomaticEdgeColorHook.class);
                    al.undoableToggleHook(Controller.getCurrentController().getMap().getRootNode());
                }
            });
        }
        final String label = TextUtils.getText("AutomaticEdgeColorHookAction.text");
        rightBuilder.append(new JLabel(label), 5);
        rightBuilder.append(mAutomaticEdgeColorCheckBox);
        rightBuilder.nextLine();
    }
}
Also used : JCheckBox(javax.swing.JCheckBox) AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) JComboBox(javax.swing.JComboBox) ActionListener(java.awt.event.ActionListener) AutomaticEdgeColorHook(org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook) AutomaticLayout(org.freeplane.features.styles.AutomaticLayout) ActionEvent(java.awt.event.ActionEvent) NamedObject(org.freeplane.core.resources.NamedObject) JLabel(javax.swing.JLabel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) ModeController(org.freeplane.features.mode.ModeController)

Example 3 with AutomaticEdgeColorHook

use of org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook in project freeplane by freeplane.

the class StyleEditorPanel method setStyle.

public void setStyle(final NodeModel node) {
    if (internalChange) {
        return;
    }
    internalChange = true;
    try {
        final LogicalStyleController logicalStyleController = LogicalStyleController.getController();
        if (addStyleBox) {
            final boolean isStyleSet = LogicalStyleModel.getStyle(node) != null;
            mSetStyle.setValue(isStyleSet);
            setStyleList(mMapStyleButton, logicalStyleController.getMapStyleNames(node, "\n"));
        }
        setStyleList(mNodeStyleButton, logicalStyleController.getNodeStyleNames(node, "\n"));
        final NodeStyleController styleController = NodeStyleController.getController();
        {
            final Color nodeColor = NodeStyleModel.getColor(node);
            final Color viewNodeColor = styleController.getColor(node);
            mSetNodeColor.setValue(nodeColor != null);
            mNodeColor.setColorValue(viewNodeColor);
        }
        {
            final Color color = NodeStyleModel.getBackgroundColor(node);
            final Color viewColor = styleController.getBackgroundColor(node);
            mSetNodeBackgroundColor.setValue(color != null);
            mNodeBackgroundColor.setColorValue(viewColor != null ? viewColor : Controller.getCurrentController().getMapViewManager().getBackgroundColor(node));
        }
        {
            final String shape = NodeStyleModel.getShape(node);
            final String viewShape = styleController.getShape(node);
            mSetNodeShape.setValue(shape != null);
            mNodeShape.setValue(viewShape);
        }
        final NodeSizeModel nodeSizeModel = NodeSizeModel.getModel(node);
        {
            final int width = nodeSizeModel != null ? nodeSizeModel.getMaxNodeWidth() : NodeSizeModel.NOT_SET;
            final int viewWidth = styleController.getMaxWidth(node);
            mSetMaxNodeWidth.setValue(width != NodeSizeModel.NOT_SET);
            mMaxNodeWidth.setValue(Integer.toString(viewWidth));
        }
        {
            final int width = nodeSizeModel != null ? nodeSizeModel.getMinNodeWidth() : NodeSizeModel.NOT_SET;
            final int viewWidth = styleController.getMinWidth(node);
            mSetMinNodeWidth.setValue(width != NodeSizeModel.NOT_SET);
            mMinNodeWidth.setValue(Integer.toString(viewWidth));
        }
        final EdgeController edgeController = EdgeController.getController();
        final EdgeModel edgeModel = EdgeModel.getModel(node);
        {
            final Color edgeColor = edgeModel != null ? edgeModel.getColor() : null;
            final Color viewColor = edgeController.getColor(node);
            mSetEdgeColor.setValue(edgeColor != null);
            mEdgeColor.setColorValue(viewColor);
        }
        {
            final EdgeStyle style = edgeModel != null ? edgeModel.getStyle() : null;
            final EdgeStyle viewStyle = edgeController.getStyle(node);
            mSetEdgeStyle.setValue(style != null);
            mEdgeStyle.setValue(viewStyle.toString());
        }
        {
            final int width = edgeModel != null ? edgeModel.getWidth() : EdgeModel.DEFAULT_WIDTH;
            final int viewWidth = edgeController.getWidth(node);
            mSetEdgeWidth.setValue(width != EdgeModel.DEFAULT_WIDTH);
            mEdgeWidth.setValue(Integer.toString(viewWidth));
        }
        {
            final CloudController cloudController = CloudController.getController();
            final CloudModel cloudModel = CloudModel.getModel(node);
            final Color viewCloudColor = cloudController.getColor(node);
            mSetCloud.setValue(cloudModel != null);
            mCloudColor.setColorValue(viewCloudColor);
            final CloudModel.Shape viewCloudShape = cloudController.getShape(node);
            mCloudShape.setValue(viewCloudShape != null ? viewCloudShape.toString() : CloudModel.Shape.ARC.toString());
        }
        {
            final String fontFamilyName = NodeStyleModel.getFontFamilyName(node);
            final String viewFontFamilyName = styleController.getFontFamilyName(node);
            mSetNodeFontName.setValue(fontFamilyName != null);
            mNodeFontName.setValue(viewFontFamilyName);
        }
        {
            final Integer fontSize = NodeStyleModel.getFontSize(node);
            final Integer viewfontSize = styleController.getFontSize(node);
            mSetNodeFontSize.setValue(fontSize != null);
            mNodeFontSize.setValue(viewfontSize.toString());
        }
        {
            final Boolean bold = NodeStyleModel.isBold(node);
            final Boolean viewbold = styleController.isBold(node);
            mSetNodeFontBold.setValue(bold != null);
            mNodeFontBold.setValue(viewbold);
        }
        {
            final Boolean italic = NodeStyleModel.isItalic(node);
            final Boolean viewitalic = styleController.isItalic(node);
            mSetNodeFontItalic.setValue(italic != null);
            mNodeFontItalic.setValue(viewitalic);
        }
        {
            final Boolean hyperlink = NodeLinks.formatNodeAsHyperlink(node);
            final Boolean viewhyperlink = LinkController.getController().formatNodeAsHyperlink(node);
            mSetNodeFontHyperlink.setValue(hyperlink != null);
            mNodeFontHyperlink.setValue(viewhyperlink);
        }
        {
            final Boolean nodeNumbering = NodeStyleModel.getNodeNumbering(node);
            final Boolean viewNodeNumbering = styleController.getNodeNumbering(node);
            mSetNodeNumbering.setValue(nodeNumbering != null);
            mNodeNumbering.setValue(viewNodeNumbering);
        }
        {
            String nodeFormat = NodeStyleModel.getNodeFormat(node);
            String viewNodeFormat = TextController.getController().getNodeFormat(node);
            mSetNodeFormat.setValue(nodeFormat != null);
            if (viewNodeFormat == null && node.getUserObject() instanceof IFormattedObject)
                viewNodeFormat = ((IFormattedObject) node.getUserObject()).getPattern();
            mNodeFormat.setValue(viewNodeFormat);
        }
        if (mAutomaticLayoutComboBox != null) {
            final ModeController modeController = Controller.getCurrentModeController();
            AutomaticLayoutController al = modeController.getExtension(AutomaticLayoutController.class);
            IExtension extension = al.getExtension(node);
            if (extension == null)
                mAutomaticLayoutComboBox.setSelectedItem(AUTOMATIC_LAYOUT_DISABLED);
            else
                mAutomaticLayoutComboBox.setSelectedIndex(((AutomaticLayout) extension).ordinal());
        }
        if (mAutomaticEdgeColorCheckBox != null) {
            final ModeController modeController = Controller.getCurrentModeController();
            AutomaticEdgeColorHook al = (AutomaticEdgeColorHook) modeController.getExtension(AutomaticEdgeColorHook.class);
            mAutomaticEdgeColorCheckBox.setSelected(al.isActive(node));
        }
    } finally {
        internalChange = false;
    }
}
Also used : AutomaticLayoutController(org.freeplane.features.styles.AutomaticLayoutController) EdgeController(org.freeplane.features.edge.EdgeController) MEdgeController(org.freeplane.features.edge.mindmapmode.MEdgeController) AutomaticEdgeColorHook(org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook) AutomaticLayout(org.freeplane.features.styles.AutomaticLayout) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) Color(java.awt.Color) IFormattedObject(org.freeplane.features.format.IFormattedObject) ModeController(org.freeplane.features.mode.ModeController) NodeStyleController(org.freeplane.features.nodestyle.NodeStyleController) MNodeStyleController(org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController) CloudController(org.freeplane.features.cloud.CloudController) MCloudController(org.freeplane.features.cloud.mindmapmode.MCloudController) NodeSizeModel(org.freeplane.features.nodestyle.NodeSizeModel) IExtension(org.freeplane.core.extension.IExtension) CloudModel(org.freeplane.features.cloud.CloudModel) EdgeStyle(org.freeplane.features.edge.EdgeStyle) EdgeModel(org.freeplane.features.edge.EdgeModel)

Example 4 with AutomaticEdgeColorHook

use of org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook 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();
    AlwaysUnfoldedNode.install();
    FreeNode.install();
    new CreationModificationPlugin();
    modeController.addExtension(ReminderHook.class, new ReminderHook(modeController));
    new AutomaticEdgeColorHook();
    new ViewerController();
    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());
    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 ImportMindmanagerFiles());
}
Also used : StyleEditorPanel(org.freeplane.features.styles.mindmapmode.StyleEditorPanel) CreationModificationPlugin(org.freeplane.features.time.CreationModificationPlugin) 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.mindmapmode.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) ShowFormatPanelAction(org.freeplane.features.styles.mindmapmode.ShowFormatPanelAction) ViewerController(org.freeplane.view.swing.features.filepreview.ViewerController) RemoveAllAttributesAction(org.freeplane.features.attribute.mindmapmode.RemoveAllAttributesAction) BlinkingNodeHook(org.freeplane.view.swing.features.BlinkingNodeHook) SplitNode(org.freeplane.features.text.mindmapmode.SplitNode) RemoveLastAttributeAction(org.freeplane.features.attribute.mindmapmode.RemoveLastAttributeAction) SortNodes(org.freeplane.features.text.mindmapmode.SortNodes) IconSelectionPlugin(org.freeplane.features.icon.mindmapmode.IconSelectionPlugin) 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) ChangeExternalImageAction(org.freeplane.view.swing.features.filepreview.ChangeExternalImageAction) ReminderHook(org.freeplane.view.swing.features.time.mindmapmode.ReminderHook)

Aggregations

AutomaticEdgeColorHook (org.freeplane.features.edge.mindmapmode.AutomaticEdgeColorHook)4 AutomaticLayoutController (org.freeplane.features.styles.AutomaticLayoutController)4 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 ModeController (org.freeplane.features.mode.ModeController)2 AutomaticLayout (org.freeplane.features.styles.AutomaticLayout)2 Color (java.awt.Color)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 JCheckBox (javax.swing.JCheckBox)1 JComboBox (javax.swing.JComboBox)1 JComponent (javax.swing.JComponent)1 JLabel (javax.swing.JLabel)1 JScrollPane (javax.swing.JScrollPane)1 IExtension (org.freeplane.core.extension.IExtension)1 NamedObject (org.freeplane.core.resources.NamedObject)1 AddAttributeAction (org.freeplane.features.attribute.mindmapmode.AddAttributeAction)1