Search in sources :

Example 1 with ChildWindowListener

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();
}
Also used : ChildWindowListener(cbit.vcell.client.ChildWindowListener) ChildWindow(cbit.vcell.client.ChildWindowManager.ChildWindow)

Example 2 with ChildWindowListener

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());
    }
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) ChildWindowManager(cbit.vcell.client.ChildWindowManager) ChildWindow(cbit.vcell.client.ChildWindowManager.ChildWindow) ChildWindowListener(cbit.vcell.client.ChildWindowListener) PropertyVetoException(java.beans.PropertyVetoException) ExpressionBindingException(cbit.vcell.parser.ExpressionBindingException) ModelException(cbit.vcell.model.ModelException) UserCancelException(org.vcell.util.UserCancelException)

Aggregations

ChildWindowListener (cbit.vcell.client.ChildWindowListener)2 ChildWindow (cbit.vcell.client.ChildWindowManager.ChildWindow)2 ChildWindowManager (cbit.vcell.client.ChildWindowManager)1 ModelException (cbit.vcell.model.ModelException)1 ExpressionBindingException (cbit.vcell.parser.ExpressionBindingException)1 BorderLayout (java.awt.BorderLayout)1 FlowLayout (java.awt.FlowLayout)1 PropertyVetoException (java.beans.PropertyVetoException)1 JPanel (javax.swing.JPanel)1 UserCancelException (org.vcell.util.UserCancelException)1