Search in sources :

Example 1 with View

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

the class MapViewSerializer method newViewToBeRemoved.

private View newViewToBeRemoved() {
    View view = new View("", null, new JPanel());
    viewsToBeRemoved.add(view);
    return view;
}
Also used : JPanel(javax.swing.JPanel) View(net.infonode.docking.View) MapView(org.freeplane.view.swing.map.MapView)

Example 2 with View

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

the class MapViewDockingWindows method afterViewChange.

public void afterViewChange(final Component pOldMap, final Component pNewMap) {
    if (pNewMap == null) {
        return;
    }
    if (!loadingLayoutFromObjectInpusStream) {
        for (int i = 0; i < mapViews.size(); ++i) {
            if (mapViews.get(i) == pNewMap) {
                View dockedView = getContainingDockedWindow(pNewMap);
                if (dockedView.isMinimized())
                    dockedView.restore();
                else
                    dockedView.restoreFocus();
                focusMapViewLater((MapView) pNewMap);
                return;
            }
        }
        addDockedWindow(pNewMap);
    } else if (mapViews.contains(pNewMap))
        return;
    mapViews.add(pNewMap);
}
Also used : NodeView(org.freeplane.view.swing.map.NodeView) MapView(org.freeplane.view.swing.map.MapView) View(net.infonode.docking.View)

Example 3 with View

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

Example 4 with View

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

the class MapViewSerializer method newDockedView.

protected View newDockedView(final Component pNewMap, final String title) {
    if (pNewMap.getParent() != null)
        return null;
    MapViewScrollPane mapViewScrollPane = new MapViewScrollPane();
    mapViewScrollPane.getViewport().setView(pNewMap);
    @SuppressWarnings("serial") final View viewFrame = new ConnectedToMenuView(title, null, mapViewScrollPane);
    return viewFrame;
}
Also used : MapViewScrollPane(org.freeplane.view.swing.map.MapViewScrollPane) View(net.infonode.docking.View) MapView(org.freeplane.view.swing.map.MapView)

Example 5 with View

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

the class MapViewDockingWindows method setTitle.

public void setTitle() {
    if (loadingLayoutFromObjectInpusStream)
        return;
    for (Component mapViewComponent : mapViews) {
        if (mapViewComponent instanceof MapView) {
            MapView mapView = (MapView) mapViewComponent;
            String name = mapView.getName();
            String title;
            if (mapView.getModel().isSaved())
                title = name;
            else
                title = name + " *";
            View containingDockedWindow = getContainingDockedWindow(mapViewComponent);
            containingDockedWindow.getViewProperties().setTitle(title);
        }
    }
}
Also used : MapView(org.freeplane.view.swing.map.MapView) 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

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