window.adoc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. = window
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../../
  6. :imagesdir: ../../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. == Window Class
  9. The window class provides a movable, resizable window with a Drag Bar.
  10. It provides the 3 standard constructors as shown in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>.
  11. *Constructor 1:*
  12. [source,java]
  13. ----
  14. /** Parameters:
  15. * Screen screen,
  16. * String UID,
  17. * Vector2f position
  18. */
  19. Window win = new Window(screen, “win”, new Vector2f(15, 15));
  20. ----
  21. *Constructor 2:*
  22. [source,java]
  23. ----
  24. /** Additional Parameter:
  25. * Vector2f dimensions */
  26. Window win = new Window(screen, “win”, new Vector2f(15, 15),
  27. new Vector2f(400, 300)
  28. );
  29. ----
  30. *Constructor 3:*
  31. [source,java]
  32. ----
  33. /** Additional Parameters:
  34. * Vector4f resizeBorders,
  35. * String defaultImg
  36. */
  37. Window win = new Window(screen, “win”, new Vector2f(15, 15), new Vector2f(400, 300),
  38. new Vector4f(14,14,14,14),
  39. “tonegod/gui/style/def/Window/panel_x.png”
  40. );
  41. ----
  42. [NOTE]
  43. ====
  44. Once again, default behaviors, such as moving, and resizing can be disabled calling the appropriate setters from the <<jme3/contributions/tonegodgui/element#,Element>> class.
  45. ====
  46. === Methods specific to the Window Class:
  47. [source,java]
  48. ----
  49. win.getDragBar(); // returns a pointer to the dragbar Element
  50. win.getDragBarHeight(); // returns the height of the dragbar
  51. win.setWindowTitle(String title); // Sets the title displayed in the dragbar
  52. ----