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).

!7

static Timer timer;
static Canvas canvas;
static CALSpringLayout layout;

p-subst {
  final new CirclesAndLines cal;
  Circle a = cal.circle_autoVis("Hello", 0.2, 0.5);
  Circle b = cal.circle_autoVis("World", 0.8, 0.5);
  cal.arrow(a, "", b);
  canvas = showCAL(cal);
  layout = new CALSpringLayout(cal);
  addToWindow(canvas, jcenteredline(jbutton("Start/Stop", r {
    if (timer != null) { cancelTimer(timer); timer = null; }
    else startTimer();
  })));
}

svoid startTimer {
  timer = awtCalcEvery2(canvas, 100, r {
    layout.step();
    updateCanvas(canvas);
  });
}

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: 415 / 925
Version history: 5 change(s)
Referenced in: [show references]