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

25
LINES

< > BotCompany Repo | #1009856 // Test Auto-Layout Switch [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 4489K of libraries. Click here for Pure Java version (6483L/48K).

1  
!7
2  
3  
static Timer timer;
4  
static Canvas canvas;
5  
static CALSpringLayout layout;
6  
7  
p-subst {
8  
  final new CirclesAndLines cal;
9  
  Circle a = cal.circle_autoVis("Hello", 0.2, 0.5);
10  
  Circle b = cal.circle_autoVis("World", 0.8, 0.5);
11  
  cal.arrow(a, "", b);
12  
  canvas = showCAL(cal);
13  
  layout = new CALSpringLayout(cal);
14  
  addToWindow(canvas, jcenteredline(jbutton("Start/Stop", r {
15  
    if (timer != null) { cancelTimer(timer); timer = null; }
16  
    else startTimer();
17  
  })));
18  
}
19  
20  
svoid startTimer {
21  
  timer = awtCalcEvery2(canvas, 100, r {
22  
    layout.step();
23  
    updateCanvas(canvas);
24  
  });
25  
}

Author comment

Began life as a copy of #1009849

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009856
Snippet name: Test Auto-Layout Switch [OK]
Eternal ID of this version: #1009856/6
Text MD5: b4598a95698dd7cc164e7a3d1a1e2d8a
Transpilation MD5: d6c216e425aa0245817f9b533c298c85
Author: stefan
Category: javax / a.i. / gui
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-21 23:16:57
Source code size: 603 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 439 / 968
Version history: 5 change(s)
Referenced in: [show references]