panel.adoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. = panel
  2. :author:
  3. :revnumber:
  4. :revdate: 2016/03/17 20:48
  5. :relfileprefix: ../../../
  6. :imagesdir: ../../..
  7. ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  8. == Panel Class
  9. The Panel class extends Element and, like the Label class, it’s only purpose is to provide:
  10. . The 3 standard constructors as shown in the <<jme3/contributions/tonegodgui/quickstart#,Quick Start Guide>>
  11. . Default style information
  12. *Constructor 1:*
  13. [source,java]
  14. ----
  15. /** Parameters:
  16. * Screen screen,
  17. * String UID,
  18. * Vector2f position
  19. */
  20. Panel panel = new Panel(screen, “panel”, new Vector2f(15, 15));
  21. ----
  22. *Constructor 2:*
  23. [source,java]
  24. ----
  25. /** Additional Parameter:
  26. * Vector2f dimensions */
  27. Panel panel = new Panel(screen, “panel”, new Vector2f(15, 15),
  28. new Vector2f(400, 300)
  29. );
  30. ----
  31. *Constructor 3:*
  32. [source,java]
  33. ----
  34. /** Additional Parameters:
  35. * Vector4f resizeBorders,
  36. * String defaultImg
  37. */
  38. Panel panel = new Panel(screen, “panel”, new Vector2f(15, 15), new Vector2f(400, 300),
  39. new Vector4f(14,14,14,14),
  40. “tonegod/gui/style/def/Window/panel_x.png”
  41. );
  42. ----
  43. The Panel class creates a resizable, movable panel (<<jme3/contributions/tonegodgui/window#,Window>> without a dragbar). The entire panel is clickable for moving unless otherwise covered by added child Elements that have not called:
  44. [source,java]
  45. ----
  46. setIgnoreMouse(true);
  47. ----
  48. You can disable any of the default behaviors of the Panel class by using the methods described in the <<jme3/contributions/tonegodgui/element#,Element>> class.