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);
}
}
}
Aggregations