* the component to open in the window
*/
protected void openInWindow(String displayName, ViewInfo nodeView, Window activeWindow, double horizontalScale,
double verticalScale, AbstractComponent component) {
MCTHousing housing = null;
if (component instanceof RootComponent) {
// THIS Object menu open new user environment
housing = MCTHousingFactory.newUserEnvironment();
} else if (component.isLeaf()) {
Set<ViewInfo> possibleViews = new LinkedHashSet<ViewInfo>(component.getViewInfos(ViewType.CENTER));
possibleViews.addAll(component.getViewInfos(ViewType.OBJECT));
housing = MCTHousingFactory.newHousing(displayName,
(byte) (MCTHousingFactory.CONTROL_AREA_ENABLE
| MCTHousingFactory.CONTENT_AREA_ENABLE | MCTHousingFactory.STATUS_AREA_ENABLE),
JFrame.DO_NOTHING_ON_CLOSE, possibleViews.iterator().next().createView(component),
horizontalScale, verticalScale, activeWindow);
} else {
housing = MCTHousingFactory.newHousing(displayName, MCTHousingFactory.ENABLE_ALL_AREA,
JFrame.DO_NOTHING_ON_CLOSE, GUIUtil.cloneTreeNode(component, nodeView), false, horizontalScale, verticalScale,
activeWindow);
}
((MCTAbstractHousing) housing).setJMenuBar(MenuFactory.createStandardHousingMenuBar((MCTStandardHousing) housing));
new StatusBarContentProvider(housing);
if (housing.getContentArea() != null && !housing.getContentArea().isAreaEmpty()) {
// use preferred size since the content area is going to be the dominate focus
MCTAbstractHousing abstractHousing = ((MCTAbstractHousing) housing);
abstractHousing.pack();
Rectangle maximumWindowBounds = abstractHousing.getGraphicsConfiguration() != null ? abstractHousing.getGraphicsConfiguration().getBounds() :
GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
abstractHousing.setSize(Math.min((int) (maximumWindowBounds.width*MAX_SCALE_FACTOR), abstractHousing.getSize().width),
Math.min((int) (maximumWindowBounds.height*MAX_SCALE_FACTOR), abstractHousing.getSize().height));
housing.getContentArea().getHousedViewManifestation().requestFocusInWindow();
}
if (activeWindow != null) {
Rectangle activeWindowGraphicsConfigBound = activeWindow.getGraphicsConfiguration().getBounds();