Search in sources :

Example 1 with DockingWindow

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

the class MapViewDockingWindows method addDockedView.

private void addDockedView(View oldSelected, View newView) {
    DockingWindow lastFocusedChildWindow = oldSelected != null ? oldSelected : getLastFocusedChildWindow(rootWindow);
    if (lastFocusedChildWindow == null) {
        DockingUtil.addWindow(newView, rootWindow);
    } else {
        Container parent = SwingUtilities.getAncestorOfClass(DockingWindow.class, lastFocusedChildWindow);
        if (parent instanceof TabWindow) {
            final TabWindow tabWindow = (TabWindow) parent;
            tabWindow.addTab(newView, tabWindow.getChildWindowIndex(lastFocusedChildWindow) + 1);
        } else
            DockingUtil.addWindow(newView, lastFocusedChildWindow.getRootWindow());
    }
}
Also used : DockingWindow(net.infonode.docking.DockingWindow) Container(java.awt.Container) TabWindow(net.infonode.docking.TabWindow) AbstractTabWindow(net.infonode.docking.AbstractTabWindow)

Example 2 with DockingWindow

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

the class MapViewDockingWindows method setTabAreaInvisiblePolicy.

public void setTabAreaInvisiblePolicy(JFrame frame) {
    DockingWindow window = (DockingWindow) (JOptionPane.getFrameForComponent(rootWindow) == frame ? rootWindow : frame.getContentPane().getComponent(0));
    setTabAreaInvisiblePolicies(window);
}
Also used : DockingWindow(net.infonode.docking.DockingWindow)

Example 3 with DockingWindow

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

the class MapViewDockingWindows method setTabAreaVisiblePolicy.

public void setTabAreaVisiblePolicy(JFrame frame) {
    DockingWindow window = (DockingWindow) (JOptionPane.getFrameForComponent(rootWindow) == frame ? rootWindow : frame.getContentPane().getComponent(0));
    setTabAreaVisiblePolicies(window);
}
Also used : DockingWindow(net.infonode.docking.DockingWindow)

Example 4 with DockingWindow

use of net.infonode.docking.DockingWindow 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

DockingWindow (net.infonode.docking.DockingWindow)4 AbstractTabWindow (net.infonode.docking.AbstractTabWindow)2 Component (java.awt.Component)1 Container (java.awt.Container)1 JComponent (javax.swing.JComponent)1 TabWindow (net.infonode.docking.TabWindow)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