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

15
LINES

< > BotCompany Repo | #1020034 // actuallyVisibleComponentArea (dev.)

JavaX fragment (include)

static Area actuallyVisibleComponentArea(Component c) {
  ret c == null ? null : swing(func -> Area {
    Area area = new Area(0, 0, new Rectangle(getWidth(c), getHeight(c)));
    Container parent = c.getParent();
    if (parent == null) ret area;
    for (Component peer : componentsSortedByZOrder(getChildren(parent))) {
      if (peer = c) break;
      area.subtract(peer.getBounds());
    }
    Area parentArea = actuallyVisibleComponentArea(parent);
    parentArea.transform(AffineTransform.getTranslateInstance(-c.getX(), -c.getY()));
    area.intersect(parentArea);
    ret area;
  });
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1020034
Snippet name: actuallyVisibleComponentArea (dev.)
Eternal ID of this version: #1020034/2
Text MD5: 66eaa01ed30f107b412362f5e4d23535
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-04 16:33:57
Source code size: 608 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 333 / 356
Version history: 1 change(s)
Referenced in: [show references]