use of cbit.vcell.client.ChildWindowListener in project vcell by virtualcell.
the class LoginManager method showLoginDialog.
/**
* @wbp.parser.entryPoint
*/
public void showLoginDialog(Component requester, DocumentWindowManager documentWindowManager, final LoginDelegate loginDelegate) {
loginPanel = new LoginPanel(loginDelegate);
loginPanel.setLoggedInUser(documentWindowManager.getUser());
childWindow = ChildWindowManager.findChildWindowManager(requester).addChildWindow(loginPanel, loginPanel, LOGIN_PANEL_TITLE);
childWindow.addChildWindowListener(new ChildWindowListener() {
public void closing(ChildWindow childWindow) {
loginDelegate.userCancel();
}
});
childWindow.setIsCenteredOnParent();
childWindow.setTitle(LOGIN_PANEL_TITLE);
childWindow.pack();
childWindow.showModal();
}
use of cbit.vcell.client.ChildWindowListener in project vcell by virtualcell.
the class BioModelEditorModelPanel method floatDiagramView.
private void floatDiagramView(boolean bFloating) {
ChildWindowManager childWindowManager = null;
try {
childWindowManager = ChildWindowManager.findChildWindowManager(this);
if (childWindowManager != null) {
lastChildWindowManager = childWindowManager;
}
} catch (Exception e) {
if (childWindowManager == null && lastChildWindowManager != null) {
childWindowManager = lastChildWindowManager;
} else {
throw (e);
}
}
if (bFloating) {
//
// insert dummy panel into tabbed pane, real one is floating now.
//
tabbedPane.setComponentAt(ModelPanelTabID.reaction_diagram.ordinal(), new JPanel());
//
// create new panel to add to client window (and hold the reactionCartoonEditorPanel)
//
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
panel.add(p, BorderLayout.NORTH);
panel.add(reactionCartoonEditorPanel, BorderLayout.CENTER);
ChildWindow childWindow = childWindowManager.addChildWindow(panel, reactionCartoonEditorPanel, "model diagram");
childWindow.setSize(500, 400);
childWindow.setIsCenteredOnParent();
childWindow.addChildWindowListener(new ChildWindowListener() {
public void closing(ChildWindow childWindow) {
reactionCartoonEditorPanel.setFloatingRequested(false);
}
});
childWindow.show();
// diagramViewInternalFrame.setFrameIcon(new ImageIcon(getClass().getResource("/images/step.gif")));
} else {
if (childWindowManager != null) {
ChildWindow childWindow = childWindowManager.getChildWindowFromContext(reactionCartoonEditorPanel);
if (childWindow != null) {
childWindowManager.closeChildWindow(childWindow);
}
}
tabbedPane.setComponentAt(ModelPanelTabID.reaction_diagram.ordinal(), modelPanelTabs[ModelPanelTabID.reaction_diagram.ordinal()].getComponent());
tabbedPane.setSelectedIndex(ModelPanelTabID.reaction_diagram.ordinal());
}
}
Aggregations