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

14
LINES

< > BotCompany Repo | #1035453 // JG22NetworkPort - Swing representation of a G22NetworkElement.Port

JavaX fragment (include) [tags: use-pretranspiled]

Uses 2164K of libraries. Click here for Pure Java version (54103L/285K).

srecord noeq JG22NetworkPort(G22Utils g22utils, JG22NetworkElement element, G22NetworkElement.Port port) > JPanel {
  int size = 10;
  
  void init {
    setOpaque(true);
    setBackground(Color.red);
    setSize(size, size);
    Rect r = toRect(main getBounds(element.visualize()));
    r = growRectTopAndLeft(r, size);
    setLocation(r.x+iround(port.position.x*r.w),
      r.y+iround(port.position.y*r.h));
    _print("Port " + port.name + " : " + getBounds());
  }
}

Author comment

Began life as a copy of #1035449

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035453
Snippet name: JG22NetworkPort - Swing representation of a G22NetworkElement.Port
Eternal ID of this version: #1035453/13
Text MD5: 07f7e2108157c87526b6c8b3d95c29e4
Transpilation MD5: 866d0855a3b6a3eaeaa0b46f9988caad
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-13 21:25:25
Source code size: 483 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 18 / 42
Version history: 12 change(s)
Referenced in: [show references]