0

I was wondering if there is a way to make a JavaFX Slider to show logaritmically spaced tick marks. I suspect there is none. If this is the case what would be the best way to go about implementing this do you think? I should mention that I have seen this but the accepted answer is not what I want.

So what I know is possible is this: enter image description here

But I want are tick marks spaced like this: http://www.dplot.com/logarithmic/loglin_h600.png

That the tick marks show their respective values is not important.

Thanks for your time.

Ivar Eriksson
  • 863
  • 1
  • 15
  • 30
  • You would need to write a new `SliderSkin` implementation... – James_D Apr 22 '18 at 16:58
  • What is a SliderSkin? – Ivar Eriksson Apr 22 '18 at 17:04
  • The skin for the slider... https://docs.oracle.com/javase/9/docs/api/javafx/scene/control/skin/SliderSkin.html See also the "Architecture" section in the [`javafx.scene.control` documentation](https://docs.oracle.com/javase/9/docs/api/javafx/scene/control/package-summary.html). – James_D Apr 22 '18 at 17:05
  • Hmm okay, have never heard of that before. Will look into it! – Ivar Eriksson Apr 22 '18 at 17:09
  • It's a highly non-trivial task to implement a skin. – James_D Apr 22 '18 at 17:09
  • Ohh okay, I don't like the sound of that. Do you know of any good tutorials? How did you learn it? Do you maybe know of a small example somewhere I can try to wrap my head around? – Ivar Eriksson Apr 22 '18 at 17:18
  • Maybe just look at the source code for the skin classes from the standard library: http://hg.openjdk.java.net/openjfx/10/rt/file/d14b61c6be12/modules/javafx.controls/src/main/java/javafx/scene/control/skin – James_D Apr 22 '18 at 17:21

1 Answers1

1

You can use a linear Slider with linear tick marks and every time you get a result you calculate the logarithmus of it and work with that.

dan1st
  • 12,568
  • 8
  • 34
  • 67