Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1020196 // stefansOS_popInModule - move to main desktop again

JavaX fragment (include)

1  
svoid stefansOS_popInModule(Module m) ctex {
2  
  swing(r {
3  
    final JInternalFrame myFrame = cast getPossiblyInternalFrame(m.vis);
4  
    if (myFrame == null) ret;
5  
    JDesktopPane desktopPane = cast getParent(myFrame);
6  
    if (desktopPane == main.desktop) ret;
7  
    removeFromParent(myFrame);
8  
    myFrame.updateUI();
9  
    myFrame.setMaximum(false);
10  
    myFrame.setMaximizable(true);
11  
    myFrame.setClosable(true);
12  
    myFrame.setIconifiable(true);
13  
    main.desktop.add(myFrame);
14  
    //print("Layer: " + main.desktop.getLayer(myFrame));
15  
    Rectangle bounds = rectangleFromScreenToComponent(boundsOnScreen(getFrame(desktopPane)), main.desktop);
16  
    //print("Setting bounds: " + bounds);
17  
    if (bounds != null)
18  
      myFrame.setBounds(bounds);
19  
    fixInternalFrame(myFrame);
20  
    myFrame.toFront();
21  
    myFrame.setSelected(true);
22  
    print("Have bounds: " + getBounds(myFrame);
23  
    disposeFrame(desktopPane);
24  
    desktopPane = null;
25  
    m.enhanceFrame(myFrame); // re-add title menus
26  
    
27  
    cset(m, poppedOut := false);
28  
    vmBus_send modulePoppedIn(m, myFrame);
29  
  });
30  
}

Author comment

Began life as a copy of #1020195

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1020196
Snippet name: stefansOS_popInModule - move to main desktop again
Eternal ID of this version: #1020196/11
Text MD5: dea1e85b1f1db6bb399f7feacf43728b
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-16 16:56:59
Source code size: 1094 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 349 / 426
Version history: 10 change(s)
Referenced in: [show references]