Search in sources :

Example 1 with AbstractTabWindow

use of net.infonode.docking.AbstractTabWindow in project freeplane by freeplane.

the class MapViewDockingWindows method selectMap.

private void selectMap(final int tabIndexChange) {
    final Controller controller = Controller.getCurrentController();
    MapView mapView = (MapView) controller.getMapViewManager().getMapViewComponent();
    if (mapView != null) {
        AbstractTabWindow tabWindow = (AbstractTabWindow) SwingUtilities.getAncestorOfClass(AbstractTabWindow.class, mapView);
        if (tabWindow != null) {
            final DockingWindow selectedWindow = tabWindow.getSelectedWindow();
            final int childWindowIndex = tabWindow.getChildWindowIndex(selectedWindow);
            final int childWindowCount = tabWindow.getChildWindowCount();
            final int nextWindowIndex = (childWindowIndex + childWindowCount + tabIndexChange) % childWindowCount;
            final View nextWindow = (View) tabWindow.getChildWindow(nextWindowIndex);
            final Component nextMapView = getContainedMapView(nextWindow);
            Controller.getCurrentController().getMapViewManager().changeToMapView(nextMapView);
        }
    }
}
Also used : AbstractTabWindow(net.infonode.docking.AbstractTabWindow) DockingWindow(net.infonode.docking.DockingWindow) MapView(org.freeplane.view.swing.map.MapView) Controller(org.freeplane.features.mode.Controller) ResourceController(org.freeplane.core.resources.ResourceController) Component(java.awt.Component) JComponent(javax.swing.JComponent) NodeView(org.freeplane.view.swing.map.NodeView) MapView(org.freeplane.view.swing.map.MapView) View(net.infonode.docking.View)

Aggregations

Component (java.awt.Component)1 JComponent (javax.swing.JComponent)1 AbstractTabWindow (net.infonode.docking.AbstractTabWindow)1 DockingWindow (net.infonode.docking.DockingWindow)1 View (net.infonode.docking.View)1 ResourceController (org.freeplane.core.resources.ResourceController)1 Controller (org.freeplane.features.mode.Controller)1 MapView (org.freeplane.view.swing.map.MapView)1 NodeView (org.freeplane.view.swing.map.NodeView)1