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

26
LINES

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

JavaX fragment (include)

svoid stefansOS_popInModule(Module m) ctex {
  swing {
    final JInternalFrame myFrame = cast getPossiblyInternalFrame(m.vis);
    if (myFrame == null) ret;
    JDesktopPane desktopPane = cast getParent(myFrame);
    if (desktopPane == main.desktop) ret;
    removeFromParent(myFrame);
    myFrame.updateUI();
    myFrame.setMaximum(false);
    myFrame.setMaximizable(true);
    myFrame.setClosable(true);
    myFrame.setIconifiable(true);
    main.desktop.add(myFrame);
    Rectangle bounds = rectangleFromScreenToComponent(boundsOnScreen(getFrame(desktopPane)), main.desktop);
    print("Setting bounds: " + bounds);
    if (bounds != null)
      myFrame.setBounds(bounds);
    fixInternalFrame(myFrame);
    myFrame.toFront();
    myFrame.setSelected(true);
    print("Have bounds: " + getBounds(myFrame);
    disposeFrame(desktopPane);
    desktopPane = null;
    m.enhanceFrame(myFrame); // re-add title menus
  }
}

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/6
Text MD5: 856e493484849a9aeeb0ef7a428975d9
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-22 22:40:56
Source code size: 946 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 140 / 174
Version history: 5 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1020196 & http://1020196.tinybrain.de