You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

451 lines
28 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Fri May 13 10:37:40 CEST 2022 -->
  5. <title>GameUI</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta name="dc.created" content="2022-05-13">
  9. <meta name="description" content="declaration: package: ui, class: GameUI">
  10. <meta name="generator" content="javadoc/ClassWriterImpl">
  11. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  12. <link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
  13. <link rel="stylesheet" type="text/css" href="../jquery-ui.overrides.css" title="Style">
  14. <script type="text/javascript" src="../script.js"></script>
  15. <script type="text/javascript" src="../script-dir/jquery-3.5.1.min.js"></script>
  16. <script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
  17. </head>
  18. <body class="class-declaration-page">
  19. <script type="text/javascript">var evenRowColor = "even-row-color";
  20. var oddRowColor = "odd-row-color";
  21. var tableTab = "table-tab";
  22. var activeTableTab = "active-table-tab";
  23. var pathtoroot = "../";
  24. loadScripts(document, 'script');</script>
  25. <noscript>
  26. <div>JavaScript is disabled on your browser.</div>
  27. </noscript>
  28. <div class="flex-box">
  29. <header role="banner" class="flex-header">
  30. <nav role="navigation">
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="top-nav" id="navbar-top">
  33. <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
  34. <ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
  35. <li><a href="../index.html">Overview</a></li>
  36. <li><a href="package-summary.html">Package</a></li>
  37. <li class="nav-bar-cell1-rev">Class</li>
  38. <li><a href="class-use/GameUI.html">Use</a></li>
  39. <li><a href="package-tree.html">Tree</a></li>
  40. <li><a href="../index-files/index-1.html">Index</a></li>
  41. <li><a href="../help-doc.html#class">Help</a></li>
  42. </ul>
  43. </div>
  44. <div class="sub-nav">
  45. <div>
  46. <ul class="sub-nav-list">
  47. <li>Summary:&nbsp;</li>
  48. <li>Nested&nbsp;|&nbsp;</li>
  49. <li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
  50. <li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
  51. <li><a href="#method-summary">Method</a></li>
  52. </ul>
  53. <ul class="sub-nav-list">
  54. <li>Detail:&nbsp;</li>
  55. <li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
  56. <li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
  57. <li><a href="#method-detail">Method</a></li>
  58. </ul>
  59. </div>
  60. <div class="nav-list-search"><label for="search-input">SEARCH:</label>
  61. <input type="text" id="search-input" value="search" disabled="disabled">
  62. <input type="reset" id="reset-button" value="reset" disabled="disabled">
  63. </div>
  64. </div>
  65. <!-- ========= END OF TOP NAVBAR ========= -->
  66. <span class="skip-nav" id="skip-navbar-top"></span></nav>
  67. </header>
  68. <div class="flex-content">
  69. <main role="main">
  70. <!-- ======== START OF CLASS DATA ======== -->
  71. <div class="header">
  72. <div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">ui</a></div>
  73. <h1 title="Class GameUI" class="title">Class GameUI</h1>
  74. </div>
  75. <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
  76. <div class="inheritance">ui.GameUI</div>
  77. </div>
  78. <section class="class-description" id="class-description">
  79. <dl class="notes">
  80. <dt>All Implemented Interfaces:</dt>
  81. <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionListener.html" title="class or interface in java.awt.event" class="external-link">ActionListener</a></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/EventListener.html" title="class or interface in java.util" class="external-link">EventListener</a></code></dd>
  82. </dl>
  83. <hr>
  84. <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">GameUI</span>
  85. <span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
  86. implements <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionListener.html" title="class or interface in java.awt.event" class="external-link">ActionListener</a></span></div>
  87. <div class="block">creates the game UI JFrame containing a canvas (see class <code>GamePanel</code>)) for the levels to
  88. paint the games. Has a menu for loading, saving games and an about menu item. two buttons allow
  89. restarting the game or exit.</div>
  90. </section>
  91. <section class="summary">
  92. <ul class="summary-list">
  93. <!-- =========== FIELD SUMMARY =========== -->
  94. <li>
  95. <section class="field-summary" id="field-summary">
  96. <h2>Field Summary</h2>
  97. <div class="caption"><span>Fields</span></div>
  98. <div class="summary-table three-column-summary">
  99. <div class="table-header col-first">Modifier and Type</div>
  100. <div class="table-header col-second">Field</div>
  101. <div class="table-header col-last">Description</div>
  102. <div class="col-first even-row-color"><code>static final int</code></div>
  103. <div class="col-second even-row-color"><code><a href="#ACTION_ABOUT" class="member-name-link">ACTION_ABOUT</a></code></div>
  104. <div class="col-last even-row-color">&nbsp;</div>
  105. <div class="col-first odd-row-color"><code>static final int</code></div>
  106. <div class="col-second odd-row-color"><code><a href="#ACTION_BUTTON" class="member-name-link">ACTION_BUTTON</a></code></div>
  107. <div class="col-last odd-row-color">&nbsp;</div>
  108. <div class="col-first even-row-color"><code>static final int</code></div>
  109. <div class="col-second even-row-color"><code><a href="#ACTION_LOAD" class="member-name-link">ACTION_LOAD</a></code></div>
  110. <div class="col-last even-row-color">&nbsp;</div>
  111. <div class="col-first odd-row-color"><code>static final int</code></div>
  112. <div class="col-second odd-row-color"><code><a href="#ACTION_NEW" class="member-name-link">ACTION_NEW</a></code></div>
  113. <div class="col-last odd-row-color">&nbsp;</div>
  114. <div class="col-first even-row-color"><code>static final int</code></div>
  115. <div class="col-second even-row-color"><code><a href="#ACTION_PAUSE" class="member-name-link">ACTION_PAUSE</a></code></div>
  116. <div class="col-last even-row-color">&nbsp;</div>
  117. <div class="col-first odd-row-color"><code>static final int</code></div>
  118. <div class="col-second odd-row-color"><code><a href="#ACTION_QUIT" class="member-name-link">ACTION_QUIT</a></code></div>
  119. <div class="col-last odd-row-color">&nbsp;</div>
  120. <div class="col-first even-row-color"><code>static final int</code></div>
  121. <div class="col-second even-row-color"><code><a href="#ACTION_RESET" class="member-name-link">ACTION_RESET</a></code></div>
  122. <div class="col-last even-row-color">&nbsp;</div>
  123. <div class="col-first odd-row-color"><code>static final int</code></div>
  124. <div class="col-second odd-row-color"><code><a href="#ACTION_SAVE" class="member-name-link">ACTION_SAVE</a></code></div>
  125. <div class="col-last odd-row-color">&nbsp;</div>
  126. </div>
  127. </section>
  128. </li>
  129. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  130. <li>
  131. <section class="constructor-summary" id="constructor-summary">
  132. <h2>Constructor Summary</h2>
  133. <div class="caption"><span>Constructors</span></div>
  134. <div class="summary-table two-column-summary">
  135. <div class="table-header col-first">Constructor</div>
  136. <div class="table-header col-last">Description</div>
  137. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(int,int)" class="member-name-link">GameUI</a><wbr>(int&nbsp;sizeX,
  138. int&nbsp;sizeY)</code></div>
  139. <div class="col-last even-row-color">
  140. <div class="block">as typical for GUI classes this constructor creates all the components and adds them to the
  141. frame.</div>
  142. </div>
  143. </div>
  144. </section>
  145. </li>
  146. <!-- ========== METHOD SUMMARY =========== -->
  147. <li>
  148. <section class="method-summary" id="method-summary">
  149. <h2>Method Summary</h2>
  150. <div id="method-summary-table">
  151. <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
  152. <div id="method-summary-table.tabpanel" role="tabpanel">
  153. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  154. <div class="table-header col-first">Modifier and Type</div>
  155. <div class="table-header col-second">Method</div>
  156. <div class="table-header col-last">Description</div>
  157. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  158. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#actionPerformed(java.awt.event.ActionEvent)" class="member-name-link">actionPerformed</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionEvent.html" title="class or interface in java.awt.event" class="external-link">ActionEvent</a>&nbsp;ae)</code></div>
  159. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  160. <div class="block">interface implementation of ActionListener to respond to GUI element actions.</div>
  161. </div>
  162. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html" title="class or interface in java.util" class="external-link">HashMap</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;</code></div>
  163. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCurrentKey()" class="member-name-link">getCurrentKey</a>()</code></div>
  164. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  165. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&gt;</code></div>
  166. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getKeyEvents()" class="member-name-link">getKeyEvents</a>()</code></div>
  167. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  168. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;</code></div>
  169. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMouseEvents()" class="member-name-link">getMouseEvents</a>()</code></div>
  170. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  171. <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div>
  172. <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getNewAction()" class="member-name-link">getNewAction</a>()</code></div>
  173. <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
  174. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  175. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#grabFocus()" class="member-name-link">grabFocus</a>()</code></div>
  176. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  177. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  178. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isPainting()" class="member-name-link">isPainting</a>()</code></div>
  179. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  180. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  181. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#repaint()" class="member-name-link">repaint</a>()</code></div>
  182. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  183. <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
  184. <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#resetAction()" class="member-name-link">resetAction</a>()</code></div>
  185. <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
  186. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  187. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPainting()" class="member-name-link">setPainting</a>()</code></div>
  188. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  189. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  190. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPlayground(playground.Playground)" class="member-name-link">setPlayground</a><wbr>(<a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;pg)</code></div>
  191. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  192. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  193. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#waitWhilePainting()" class="member-name-link">waitWhilePainting</a>()</code></div>
  194. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="inherited-list">
  199. <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
  200. <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
  201. </section>
  202. </li>
  203. </ul>
  204. </section>
  205. <section class="details">
  206. <ul class="details-list">
  207. <!-- ============ FIELD DETAIL =========== -->
  208. <li>
  209. <section class="field-details" id="field-detail">
  210. <h2>Field Details</h2>
  211. <ul class="member-list">
  212. <li>
  213. <section class="detail" id="ACTION_NEW">
  214. <h3>ACTION_NEW</h3>
  215. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_NEW</span></div>
  216. <dl class="notes">
  217. <dt>See Also:</dt>
  218. <dd>
  219. <ul class="see-list">
  220. <li><a href="../constant-values.html#ui.GameUI.ACTION_NEW">Constant Field Values</a></li>
  221. </ul>
  222. </dd>
  223. </dl>
  224. </section>
  225. </li>
  226. <li>
  227. <section class="detail" id="ACTION_LOAD">
  228. <h3>ACTION_LOAD</h3>
  229. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_LOAD</span></div>
  230. <dl class="notes">
  231. <dt>See Also:</dt>
  232. <dd>
  233. <ul class="see-list">
  234. <li><a href="../constant-values.html#ui.GameUI.ACTION_LOAD">Constant Field Values</a></li>
  235. </ul>
  236. </dd>
  237. </dl>
  238. </section>
  239. </li>
  240. <li>
  241. <section class="detail" id="ACTION_SAVE">
  242. <h3>ACTION_SAVE</h3>
  243. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_SAVE</span></div>
  244. <dl class="notes">
  245. <dt>See Also:</dt>
  246. <dd>
  247. <ul class="see-list">
  248. <li><a href="../constant-values.html#ui.GameUI.ACTION_SAVE">Constant Field Values</a></li>
  249. </ul>
  250. </dd>
  251. </dl>
  252. </section>
  253. </li>
  254. <li>
  255. <section class="detail" id="ACTION_RESET">
  256. <h3>ACTION_RESET</h3>
  257. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_RESET</span></div>
  258. <dl class="notes">
  259. <dt>See Also:</dt>
  260. <dd>
  261. <ul class="see-list">
  262. <li><a href="../constant-values.html#ui.GameUI.ACTION_RESET">Constant Field Values</a></li>
  263. </ul>
  264. </dd>
  265. </dl>
  266. </section>
  267. </li>
  268. <li>
  269. <section class="detail" id="ACTION_QUIT">
  270. <h3>ACTION_QUIT</h3>
  271. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_QUIT</span></div>
  272. <dl class="notes">
  273. <dt>See Also:</dt>
  274. <dd>
  275. <ul class="see-list">
  276. <li><a href="../constant-values.html#ui.GameUI.ACTION_QUIT">Constant Field Values</a></li>
  277. </ul>
  278. </dd>
  279. </dl>
  280. </section>
  281. </li>
  282. <li>
  283. <section class="detail" id="ACTION_BUTTON">
  284. <h3>ACTION_BUTTON</h3>
  285. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_BUTTON</span></div>
  286. <dl class="notes">
  287. <dt>See Also:</dt>
  288. <dd>
  289. <ul class="see-list">
  290. <li><a href="../constant-values.html#ui.GameUI.ACTION_BUTTON">Constant Field Values</a></li>
  291. </ul>
  292. </dd>
  293. </dl>
  294. </section>
  295. </li>
  296. <li>
  297. <section class="detail" id="ACTION_PAUSE">
  298. <h3>ACTION_PAUSE</h3>
  299. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_PAUSE</span></div>
  300. <dl class="notes">
  301. <dt>See Also:</dt>
  302. <dd>
  303. <ul class="see-list">
  304. <li><a href="../constant-values.html#ui.GameUI.ACTION_PAUSE">Constant Field Values</a></li>
  305. </ul>
  306. </dd>
  307. </dl>
  308. </section>
  309. </li>
  310. <li>
  311. <section class="detail" id="ACTION_ABOUT">
  312. <h3>ACTION_ABOUT</h3>
  313. <div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">ACTION_ABOUT</span></div>
  314. <dl class="notes">
  315. <dt>See Also:</dt>
  316. <dd>
  317. <ul class="see-list">
  318. <li><a href="../constant-values.html#ui.GameUI.ACTION_ABOUT">Constant Field Values</a></li>
  319. </ul>
  320. </dd>
  321. </dl>
  322. </section>
  323. </li>
  324. </ul>
  325. </section>
  326. </li>
  327. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  328. <li>
  329. <section class="constructor-details" id="constructor-detail">
  330. <h2>Constructor Details</h2>
  331. <ul class="member-list">
  332. <li>
  333. <section class="detail" id="&lt;init&gt;(int,int)">
  334. <h3>GameUI</h3>
  335. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GameUI</span><wbr><span class="parameters">(int&nbsp;sizeX,
  336. int&nbsp;sizeY)</span></div>
  337. <div class="block">as typical for GUI classes this constructor creates all the components and adds them to the
  338. frame. It adds this instance as ActionListener for all components. See
  339. <a href="#actionPerformed(java.awt.event.ActionEvent)"><code>actionPerformed(ActionEvent)</code></a> for details. It directly sets the frame visible as a
  340. final step.
  341. <p>
  342. If you want to extend this GUI, create a subclass and add new elements in constructor. It is
  343. necessary to call <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html#revalidate()" title="class or interface in java.awt" class="external-link"><code>Component.revalidate()</code></a> on <code>frame</code> attribute after changing/adding
  344. components to <code>panel</code> or <code>canvas</code>, because the constructor here already sets
  345. visibility to true and renders the IFrame.
  346. </p></div>
  347. <dl class="notes">
  348. <dt>Parameters:</dt>
  349. <dd><code>sizeX</code> - pixel dimension wanted in x direction</dd>
  350. <dd><code>sizeY</code> - pixel dimension wanted in y direction</dd>
  351. </dl>
  352. </section>
  353. </li>
  354. </ul>
  355. </section>
  356. </li>
  357. <!-- ============ METHOD DETAIL ========== -->
  358. <li>
  359. <section class="method-details" id="method-detail">
  360. <h2>Method Details</h2>
  361. <ul class="member-list">
  362. <li>
  363. <section class="detail" id="getCurrentKey()">
  364. <h3>getCurrentKey</h3>
  365. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html" title="class or interface in java.util" class="external-link">HashMap</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>,<wbr><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>&gt;</span>&nbsp;<span class="element-name">getCurrentKey</span>()</div>
  366. </section>
  367. </li>
  368. <li>
  369. <section class="detail" id="getKeyEvents()">
  370. <h3>getKeyEvents</h3>
  371. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html" title="class or interface in java.awt.event" class="external-link">KeyEvent</a>&gt;</span>&nbsp;<span class="element-name">getKeyEvents</span>()</div>
  372. </section>
  373. </li>
  374. <li>
  375. <section class="detail" id="getMouseEvents()">
  376. <h3>getMouseEvents</h3>
  377. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Stack.html" title="class or interface in java.util" class="external-link">Stack</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html" title="class or interface in java.awt.event" class="external-link">MouseEvent</a>&gt;</span>&nbsp;<span class="element-name">getMouseEvents</span>()</div>
  378. </section>
  379. </li>
  380. <li>
  381. <section class="detail" id="repaint()">
  382. <h3>repaint</h3>
  383. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">repaint</span>()</div>
  384. </section>
  385. </li>
  386. <li>
  387. <section class="detail" id="setPlayground(playground.Playground)">
  388. <h3>setPlayground</h3>
  389. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPlayground</span><wbr><span class="parameters">(<a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;pg)</span></div>
  390. </section>
  391. </li>
  392. <li>
  393. <section class="detail" id="isPainting()">
  394. <h3>isPainting</h3>
  395. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isPainting</span>()</div>
  396. </section>
  397. </li>
  398. <li>
  399. <section class="detail" id="setPainting()">
  400. <h3>setPainting</h3>
  401. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPainting</span>()</div>
  402. </section>
  403. </li>
  404. <li>
  405. <section class="detail" id="waitWhilePainting()">
  406. <h3>waitWhilePainting</h3>
  407. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">waitWhilePainting</span>()</div>
  408. </section>
  409. </li>
  410. <li>
  411. <section class="detail" id="getNewAction()">
  412. <h3>getNewAction</h3>
  413. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getNewAction</span>()</div>
  414. </section>
  415. </li>
  416. <li>
  417. <section class="detail" id="resetAction()">
  418. <h3>resetAction</h3>
  419. <div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">resetAction</span>()</div>
  420. </section>
  421. </li>
  422. <li>
  423. <section class="detail" id="grabFocus()">
  424. <h3>grabFocus</h3>
  425. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">grabFocus</span>()</div>
  426. </section>
  427. </li>
  428. <li>
  429. <section class="detail" id="actionPerformed(java.awt.event.ActionEvent)">
  430. <h3>actionPerformed</h3>
  431. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">actionPerformed</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionEvent.html" title="class or interface in java.awt.event" class="external-link">ActionEvent</a>&nbsp;ae)</span></div>
  432. <div class="block">interface implementation of ActionListener to respond to GUI element actions. It sets the
  433. attribute of newAction which is read by GameLoop.runGame to check for GUI actions.</div>
  434. <dl class="notes">
  435. <dt>Specified by:</dt>
  436. <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionListener.html#actionPerformed(java.awt.event.ActionEvent)" title="class or interface in java.awt.event" class="external-link">actionPerformed</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionListener.html" title="class or interface in java.awt.event" class="external-link">ActionListener</a></code></dd>
  437. </dl>
  438. </section>
  439. </li>
  440. </ul>
  441. </section>
  442. </li>
  443. </ul>
  444. </section>
  445. <!-- ========= END OF CLASS DATA ========= -->
  446. </main>
  447. </div>
  448. </div>
  449. </body>
  450. </html>