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

12
LINES

< > BotCompany Repo | #1031895 // jLiveValueSlider_double_bothWays

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

Libraryless. Click here for Pure Java version (9816L/55K).

static JSlider jLiveValueSlider_double_bothWays(double min, double max, IVarWithNotify<Double> lv) {
  new AtomicInt changing;
  JSlider slider = liveSliderZeroToOne((float) ((unnull(lv!)-min)/(max-min)), voidfunc(float f) {
    if (changing! == 0)
      lv.set(min+f*(max-min));
  });
  bindLiveValueListenerToComponent(slider, lv, r {
    temp tempIncAtomicInt(changing);
    setRelativeSliderValue(slider, (unnull(lv!)-min)/(max-min));
  });
  ret slider;
}

Author comment

Began life as a copy of #1026708

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031895
Snippet name: jLiveValueSlider_double_bothWays
Eternal ID of this version: #1031895/7
Text MD5: 2c1aac2455fe9d925cca7a686c1679f0
Transpilation MD5: 8a0da3837f31471d6282ddd586b26c86
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-19 20:02:29
Source code size: 471 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 182 / 282
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1031896 - dm_doubleSlider
#1035783 - jLiveValueSlider_double_noScaling (just uses ints)