Search in sources :

Example 1 with ModeImpl

use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.

the class DefaultView method userDroppedTopComponents.

// DnD
@Override
public void userDroppedTopComponents(ModeView modeView, TopComponentDraggable draggable) {
    if (DEBUG) {
        // NOI18N
        debugLog("User dropped TopComponent's");
    }
    ModeAccessor modeAccessor = (ModeAccessor) hierarchy.getAccessorForView(modeView);
    ModeImpl mode = getModeForModeAccessor(modeAccessor);
    controllerHandler.userDroppedTopComponents(mode, draggable);
}
Also used : ModeImpl(org.netbeans.core.windows.ModeImpl)

Example 2 with ModeImpl

use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.

the class DefaultView method userDroppedTopComponents.

@Override
public void userDroppedTopComponents(ModeView modeView, TopComponentDraggable draggable, String side) {
    if (DEBUG) {
        // NOI18N
        debugLog("User dropped TopComponent's to side=" + side);
    }
    ModeAccessor modeAccessor = (ModeAccessor) hierarchy.getAccessorForView(modeView);
    ModeImpl mode = getModeForModeAccessor(modeAccessor);
    controllerHandler.userDroppedTopComponents(mode, draggable, side);
}
Also used : ModeImpl(org.netbeans.core.windows.ModeImpl)

Example 3 with ModeImpl

use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.

the class DefaultView method userResizedSlidingWindow.

@Override
public void userResizedSlidingWindow(ModeView modeView, SlideOperation operation) {
    ((SlidingView) modeView).setSlideBounds(modeView.getSelectedTopComponent().getBounds());
    hierarchy.performSlideResize(operation);
    ModeAccessor modeAccessor = (ModeAccessor) hierarchy.getAccessorForView(modeView);
    ModeImpl mode = getModeForModeAccessor(modeAccessor);
    controllerHandler.userResizedSlidingMode(mode, operation.getFinishBounds());
}
Also used : ModeImpl(org.netbeans.core.windows.ModeImpl)

Example 4 with ModeImpl

use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.

the class DefaultView method userTriggeredSlideOut.

@Override
public void userTriggeredSlideOut(ModeView modeView, SlideOperation operation) {
    hierarchy.performSlideOut(operation);
    // restore focus if needed
    if (operation.requestsActivation()) {
        ModeView lastNonSlidingActive = hierarchy.getLastNonSlidingActiveModeView();
        ModeImpl mode = null;
        if (lastNonSlidingActive != null) {
            mode = getModeForModeAccessor((ModeAccessor) hierarchy.getAccessorForView(lastNonSlidingActive));
        }
        if (mode != null) {
            controllerHandler.userActivatedMode(mode);
        } else {
            // no appropriate mode exists - select editor as last resort
            controllerHandler.userActivatedEditorWindow();
        }
    }
}
Also used : ModeImpl(org.netbeans.core.windows.ModeImpl)

Example 5 with ModeImpl

use of org.netbeans.core.windows.ModeImpl in project netbeans-rcp-lite by outersky.

the class DefaultView method updateSeparateBoundsForView.

// XXX PENDING This is just for the cases split modes doesn't have a separated
// opposite ones, so they keep the bounds for them. Revise.
void updateSeparateBoundsForView(ViewElement view) {
    if (view.getComponent() instanceof JComponent) {
        // when updating the views after resizing the split, do
        // set the preffered size accordingly to prevent jumping splits
        // in SplitView.updateAwtHierarchy()
        // is basically a workaround, the problem should be fixed by reimplementing the
        // splits without using the JSplitPane
        // #45186 for more details
        JComponent comp = (JComponent) view.getComponent();
        Dimension dim = new Dimension(comp.getSize());
        comp.setPreferredSize(dim);
        // NOI18N
        comp.putClientProperty("lastAvailableSpace", dim);
    }
    if (view instanceof ModeView) {
        ModeView mv = (ModeView) view;
        ModeAccessor ma = (ModeAccessor) hierarchy.getAccessorForView(mv);
        if (ma != null) {
            Component comp = mv.getComponent();
            Rectangle bounds = comp.getBounds();
            Point point = new Point(0, 0);
            SwingUtilities.convertPointToScreen(point, comp);
            bounds.setLocation(point);
            ModeImpl mode = getModeForModeAccessor(ma);
            // XXX ControllerHandler
            controllerHandler.userResizedModeBoundsSeparatedHelp(mode, bounds);
        }
    } else if (view instanceof SplitView) {
        SplitView sv = (SplitView) view;
        List children = sv.getChildren();
        for (Iterator i = children.iterator(); i.hasNext(); ) {
            ViewElement child = (ViewElement) i.next();
            updateSeparateBoundsForView(child);
        }
    } else if (view instanceof EditorView) {
        updateEditorAreaBoundsHelp();
    // Editor area content isn't needed to remember.
    }
}
Also used : ModeImpl(org.netbeans.core.windows.ModeImpl) Iterator(java.util.Iterator) List(java.util.List) TopComponent(org.openide.windows.TopComponent)

Aggregations

ModeImpl (org.netbeans.core.windows.ModeImpl)60 TopComponent (org.openide.windows.TopComponent)35 WindowManagerImpl (org.netbeans.core.windows.WindowManagerImpl)22 ArrayList (java.util.ArrayList)5 IOException (java.io.IOException)3 List (java.util.List)3 FileObject (org.openide.filesystems.FileObject)3 Component (java.awt.Component)2 File (java.io.File)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 BackingStoreException (java.util.prefs.BackingStoreException)2 Preferences (java.util.prefs.Preferences)2 WindowSystem (org.netbeans.core.WindowSystem)2 ModeStructureSnapshot (org.netbeans.core.windows.ModeStructureSnapshot)2 TopComponentTracker (org.netbeans.core.windows.TopComponentTracker)2 MultiSplitPane (org.netbeans.core.windows.view.ui.MultiSplitPane)2 TabActionEvent (org.netbeans.swing.tabcontrol.event.TabActionEvent)2 NbPreferences (org.openide.util.NbPreferences)2