Search in sources :

Example 1 with NodeChangeEvent

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

the class MIconController method install.

@Override
public void install(final ModeController modeController) {
    super.install(modeController);
    modeController.getMapController().addNodeChangeListener(new INodeChangeListener() {

        @Override
        public void nodeChanged(NodeChangeEvent event) {
            final NodeModel node = event.getNode();
            if (event.getProperty().equals(NodeModel.NODE_ICON) && LogicalStyleController.getController().conditionalStylesOf(node).dependOnCondition(DEPENDS_ON_ICON)) {
                modeController.getMapController().delayedNodeRefresh(node, NodeModel.UNKNOWN_PROPERTY, null, null);
            }
        }
    });
}
Also used : NodeChangeEvent(org.freeplane.features.map.NodeChangeEvent) NodeModel(org.freeplane.features.map.NodeModel) INodeChangeListener(org.freeplane.features.map.INodeChangeListener)

Example 2 with NodeChangeEvent

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

the class MTextController method install.

@Override
public void install(final ModeController modeController) {
    super.install(modeController);
    modeController.getMapController().addNodeChangeListener(new INodeChangeListener() {

        @Override
        public void nodeChanged(NodeChangeEvent event) {
            if (event.getProperty().equals(NodeModel.NODE_TEXT)) {
                NodeModel node = event.getNode();
                if (LogicalStyleController.getController().conditionalStylesOf(node).dependOnCondition(DEPENDS_ON_PARENT)) {
                    for (NodeModel child : node.getChildren()) modeController.getMapController().delayedNodeRefresh(child, NodeModel.UNKNOWN_PROPERTY, null, null);
                }
            }
        }
    });
}
Also used : NodeChangeEvent(org.freeplane.features.map.NodeChangeEvent) NodeModel(org.freeplane.features.map.NodeModel) INodeChangeListener(org.freeplane.features.map.INodeChangeListener)

Example 3 with NodeChangeEvent

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

the class MTextController method setDetailsHidden.

@Override
public void setDetailsHidden(final NodeModel node, final boolean isHidden) {
    stopEditing();
    DetailTextModel details = node.getExtension(DetailTextModel.class);
    if (details == null || details.isHidden() == isHidden) {
        return;
    }
    final IActor actor = new IActor() {

        @Override
        public void act() {
            setHidden(isHidden);
        }

        @Override
        public String getDescription() {
            return "setDetailsHidden";
        }

        private void setHidden(final boolean isHidden) {
            final DetailTextModel details = DetailTextModel.createDetailText(node);
            details.setHidden(isHidden);
            node.addExtension(details);
            final NodeChangeEvent nodeChangeEvent = new NodeChangeEvent(node, DETAILS_HIDDEN, !isHidden, isHidden, true, false);
            Controller.getCurrentModeController().getMapController().nodeRefresh(nodeChangeEvent);
        }

        @Override
        public void undo() {
            setHidden(!isHidden);
        }
    };
    Controller.getCurrentModeController().execute(actor, node.getMap());
}
Also used : NodeChangeEvent(org.freeplane.features.map.NodeChangeEvent) DetailTextModel(org.freeplane.features.text.DetailTextModel) IActor(org.freeplane.core.undo.IActor)

Example 4 with NodeChangeEvent

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

the class TextController method setDetailsHidden.

public void setDetailsHidden(NodeModel node, boolean isHidden) {
    final DetailTextModel details = DetailTextModel.createDetailText(node);
    if (isHidden == details.isHidden()) {
        return;
    }
    details.setHidden(isHidden);
    node.addExtension(details);
    final NodeChangeEvent nodeChangeEvent = new NodeChangeEvent(node, DETAILS_HIDDEN, !isHidden, (Object) isHidden, true, false);
    Controller.getCurrentModeController().getMapController().nodeRefresh(nodeChangeEvent);
}
Also used : NodeChangeEvent(org.freeplane.features.map.NodeChangeEvent)

Example 5 with NodeChangeEvent

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

the class ReminderHook method createTimePanel.

private void createTimePanel() {
    final TimeManagement timeManagement = new TimeManagement(this);
    final int axis = BoxLayout.Y_AXIS;
    final JTimePanel timePanel = timeManagement.createTimePanel(null, false, 1);
    modeController.getMapController().addNodeSelectionListener(new INodeSelectionListener() {

        public void onSelect(NodeModel node) {
            timePanel.update(node);
        }

        public void onDeselect(NodeModel node) {
        }
    });
    modeController.getMapController().addNodeChangeListener(new INodeChangeListener() {

        public void nodeChanged(NodeChangeEvent event) {
            final NodeModel node = event.getNode();
            if (event.getProperty().equals(getExtensionClass()) && node.equals(modeController.getMapController().getSelectedNode()))
                timePanel.update(node);
        }
    });
    timePanel.setBorder(BorderFactory.createTitledBorder(TextUtils.getText("calendar_panel")));
    final JPanel tablePanel = new AttributePanelManager(modeController).getTablePanel();
    tablePanel.setBorder(BorderFactory.createTitledBorder(TextUtils.getText("attributes_attribute")));
    final Box panel = new Box(axis);
    panel.add(timePanel);
    panel.add(tablePanel);
    final JTabbedPane tabs = (JTabbedPane) modeController.getUserInputListenerFactory().getToolBar("/format").getComponent(1);
    final JScrollPane timeScrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    UITools.setScrollbarIncrement(timeScrollPane);
    tabs.add(TextUtils.getText("calendar_attributes_panel"), timeScrollPane);
}
Also used : NodeChangeEvent(org.freeplane.features.map.NodeChangeEvent) JScrollPane(javax.swing.JScrollPane) INodeSelectionListener(org.freeplane.features.map.INodeSelectionListener) JPanel(javax.swing.JPanel) NodeModel(org.freeplane.features.map.NodeModel) INodeChangeListener(org.freeplane.features.map.INodeChangeListener) JTabbedPane(javax.swing.JTabbedPane) AttributePanelManager(org.freeplane.view.swing.map.attribute.AttributePanelManager) Box(javax.swing.Box) JTimePanel(org.freeplane.view.swing.features.time.mindmapmode.TimeManagement.JTimePanel)

Aggregations

NodeChangeEvent (org.freeplane.features.map.NodeChangeEvent)9 INodeChangeListener (org.freeplane.features.map.INodeChangeListener)7 NodeModel (org.freeplane.features.map.NodeModel)7 INodeSelectionListener (org.freeplane.features.map.INodeSelectionListener)4 MapChangeEvent (org.freeplane.features.map.MapChangeEvent)3 MapController (org.freeplane.features.map.MapController)3 ModeController (org.freeplane.features.mode.ModeController)3 JScrollPane (javax.swing.JScrollPane)2 IMapSelection (org.freeplane.features.map.IMapSelection)2 Controller (org.freeplane.features.mode.Controller)2 Container (java.awt.Container)1 ActionEvent (java.awt.event.ActionEvent)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 AbstractAction (javax.swing.AbstractAction)1 Action (javax.swing.Action)1 Box (javax.swing.Box)1 JDialog (javax.swing.JDialog)1 JPanel (javax.swing.JPanel)1 JPopupMenu (javax.swing.JPopupMenu)1