Search in sources :

Example 46 with IMapSelection

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

the class MapViewController method afterViewChange.

public void afterViewChange(final Component oldMap, final Component pNewMap) {
    Controller controller = Controller.getCurrentController();
    final ModeController oldModeController = controller.getModeController();
    ModeController newModeController = oldModeController;
    if (pNewMap != null) {
        final IMapSelection mapSelection = getMapSelection();
        final NodeModel selected = mapSelection.getSelected();
        mapSelection.scrollNodeToVisible(selected);
        setZoomComboBox(getZoom());
        obtainFocusForSelected();
        newModeController = getModeController(pNewMap);
        if (newModeController != oldModeController) {
            controller.selectMode(newModeController);
        }
    }
    setTitle();
    controller.getViewController().viewNumberChanged(getViewNumber());
    newModeController.getUserInputListenerFactory().updateMapList();
    if (pNewMap != null) {
        newModeController.setVisible(true);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection) ModeController(org.freeplane.features.mode.ModeController) ResourceController(org.freeplane.core.resources.ResourceController) ViewController(org.freeplane.features.ui.ViewController) MapController(org.freeplane.features.map.MapController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 47 with IMapSelection

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

the class ShowNotesInMapAction method actionPerformed.

public void actionPerformed(ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final MNoteController noteController = (MNoteController) NoteController.getController();
    noteController.setShowNotesInMap(map, !NoteController.getController().showNotesInMap(map));
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    selection.keepNodePosition(selection.getSelected(), 0.0f, 0.0f);
    setSelected();
}
Also used : MNoteController(org.freeplane.features.note.mindmapmode.MNoteController) IMapSelection(org.freeplane.features.map.IMapSelection) MapModel(org.freeplane.features.map.MapModel)

Aggregations

IMapSelection (org.freeplane.features.map.IMapSelection)47 NodeModel (org.freeplane.features.map.NodeModel)33 Controller (org.freeplane.features.mode.Controller)12 ModeController (org.freeplane.features.mode.ModeController)12 ResourceController (org.freeplane.core.resources.ResourceController)7 MapController (org.freeplane.features.map.MapController)7 Component (java.awt.Component)6 MapModel (org.freeplane.features.map.MapModel)4 Container (java.awt.Container)3 ASelectableCondition (org.freeplane.features.filter.condition.ASelectableCondition)3 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)3 MTextController (org.freeplane.features.text.mindmapmode.MTextController)3 NodeView (org.freeplane.view.swing.map.NodeView)3 Point (java.awt.Point)2 Window (java.awt.Window)2 WindowEvent (java.awt.event.WindowEvent)2 ArrayList (java.util.ArrayList)2 JComponent (javax.swing.JComponent)2 JPopupMenu (javax.swing.JPopupMenu)2 JRootPane (javax.swing.JRootPane)2