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