if (visible) {
descriptor.setIdOnTitleBar();
dockedContainer.getTitleBarButtons().setType(ToolWindowType.FLOATING_LIVE);
// Reset Layout
TableLayout layout = (TableLayout) sheet.getLayout();
layout.setColumn(0, 0);
layout.setColumn(2, 0);
layout.setRow(0, 0);
layout.setRow(2, 0);
content.setVisible(true);
sheet.add(content, "1,1,FULL,FULL");
// Prepare sheet
sheet.setBorder(BorderFactory.createEtchedBorder());
if (lastBounds == null) {
FloatingLiveTypeDescriptor typeDescriptor = (FloatingLiveTypeDescriptor) descriptor.getTypeDescriptor(ToolWindowType.FLOATING_LIVE);
// Set Size
if (typeDescriptor.getSize() == null) {
Component managerCmp = descriptor.getManager();
switch (toolWindow.getAnchor()) {
case LEFT:
case RIGHT:
sheet.setSize(descriptor.getDockedTypeDescriptor().getDockLength(),
(int) (managerCmp.getHeight() / 1.5));
break;
case TOP:
case BOTTOM:
sheet.setSize((int) (managerCmp.getWidth() / 1.5),
descriptor.getDockedTypeDescriptor().getDockLength());
break;
}
} else
sheet.setSize(typeDescriptor.getSize());
SwingUtil.validateBounds(sheet, descriptor.getManager().getMainContainer().getBounds());
// Set Location
if (typeDescriptor.getLocation() == null ||
typeDescriptor.getLocation().x > descriptor.getManager().getWidth() ||
typeDescriptor.getLocation().y > descriptor.getManager().getHeight() ||
typeDescriptor.getLocation().x < 0 ||
typeDescriptor.getLocation().y < 0) {
Component managerCmp = descriptor.getManager();
switch (toolWindow.getAnchor()) {
case LEFT:
sheet.setLocation(50, 50);
break;
case RIGHT:
sheet.setLocation(managerCmp.getWidth() - 50 - sheet.getWidth(),
50);
break;
case TOP:
sheet.setLocation(50, 50);
break;
case BOTTOM:
sheet.setLocation(50,
managerCmp.getHeight() - 50 - sheet.getHeight());
break;
}
} else
sheet.setLocation(typeDescriptor.getLocation());
} else {
sheet.setBounds(lastBounds);
lastBounds = null;
}
layeredPane.remove(sheet);
layeredPane.setLayer(sheet, JLayeredPane.DEFAULT_LAYER + 3);
layeredPane.add(sheet);
/*
if (manager.getTypeDescriptor(ToolWindowType.SLIDING).isAnimating())
slidingAnimation.show(sheet.getBounds());
*/
} else {
// Set Layout
TableLayout layout = (TableLayout) sheet.getLayout();
layout.setColumn(0, 2);
layout.setColumn(2, 2);
layout.setRow(0, 2);
layout.setRow(2, 2);
/*
if (manager.getTypeDescriptor(ToolWindowType.SLIDING).isAnimating())
slidingAnimation.hide(sheet.getBounds());
else {