dial.adoc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. = dial
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../../
  6. :imagesdir: ../../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. == Dial Class
  9. The Dial class provides:
  10. * A rotating knob for selecting step values
  11. The Dial class provides the standard 3 common constructors as sown in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>.
  12. *Constructor 1:*
  13. [source,java]
  14. ----
  15. /** Parameters:
  16. * Screen screen,
  17. * String UID,
  18. * Vector2f position
  19. */
  20. Dial dial = new Dial(screen, “dial”, new Vector2f(15, 15));
  21. ----
  22. *Constructor 2:*
  23. [source,java]
  24. ----
  25. /** Additional Parameter:
  26. * Vector2f dimensions */
  27. Dial dial = new Dial(screen, “dial”, new Vector2f(15, 15),
  28. new Vector2f(35, 35)
  29. );
  30. ----
  31. *Constructor 3:*
  32. [source,java]
  33. ----
  34. /** Additional Parameters:
  35. * Vector4f resizeBorders,
  36. * String defaultImg
  37. */
  38. Dial dial = new Dial(screen, “dial”, new Vector2f(15, 15), new Vector2f(35, 35),
  39. new Vector4f(0,0,0,0),
  40. “tonegod/gui/style/def/Dial/dial_x.png”
  41. );
  42. ----
  43. === Abstract Event Methods:
  44. [source,java]
  45. ----
  46. public void onChange(int selectedIndex, String value);
  47. ----
  48. === Methods specific to the Dial class:
  49. [source,java]
  50. ----
  51. // Adding removing list info
  52. dial.addStepValue(String value);
  53. dial.removeStepValue(String value);
  54. // Retrieval of current selected step
  55. dial.getSelectedIndex();
  56. ----