Simple single-color 8x8x8 LED Cube with AVRs
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0_29) on Mon Dec 05 17:23:17 CET 2011 -->
  6. <TITLE>
  7. cubeWorker
  8. </TITLE>
  9. <META NAME="date" CONTENT="2011-12-05">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="cubeWorker";
  16. }
  17. }
  18. </SCRIPT>
  19. <NOSCRIPT>
  20. </NOSCRIPT>
  21. </HEAD>
  22. <BODY BGCOLOR="white" onload="windowTitle();">
  23. <HR>
  24. <!-- ========= START OF TOP NAVBAR ======= -->
  25. <A NAME="navbar_top"><!-- --></A>
  26. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  27. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  28. <TR>
  29. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  30. <A NAME="navbar_top_firstrow"><!-- --></A>
  31. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  32. <TR ALIGN="center" VALIGN="top">
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  35. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  36. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  37. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  38. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  39. </TR>
  40. </TABLE>
  41. </TD>
  42. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  43. </EM>
  44. </TD>
  45. </TR>
  46. <TR>
  47. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  48. &nbsp;<A HREF="AnimationUtility.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
  49. &nbsp;<A HREF="Frame.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
  50. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  51. <A HREF="index.html?cubeWorker.html" target="_top"><B>FRAMES</B></A> &nbsp;
  52. &nbsp;<A HREF="cubeWorker.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  53. &nbsp;<SCRIPT type="text/javascript">
  54. <!--
  55. if(window==top) {
  56. document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
  57. }
  58. //-->
  59. </SCRIPT>
  60. <NOSCRIPT>
  61. <A HREF="allclasses-noframe.html"><B>All Classes</B></A>
  62. </NOSCRIPT>
  63. </FONT></TD>
  64. </TR>
  65. <TR>
  66. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  67. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  68. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  69. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  70. </TR>
  71. </TABLE>
  72. <A NAME="skip-navbar_top"></A>
  73. <!-- ========= END OF TOP NAVBAR ========= -->
  74. <HR>
  75. <!-- ======== START OF CLASS DATA ======== -->
  76. <H2>
  77. Class cubeWorker</H2>
  78. <PRE>
  79. java.lang.Object
  80. <IMG SRC="./resources/inherit.gif" ALT="extended by "><B>cubeWorker</B>
  81. </PRE>
  82. <HR>
  83. <DL>
  84. <DT><PRE>public class <B>cubeWorker</B><DT>extends java.lang.Object</DL>
  85. </PRE>
  86. <P>
  87. This class holds all Data of the Application. Additionally it performs the transmission of animation data to/from the cube and saves/loads animations in/from a file.
  88. <P>
  89. <P>
  90. <HR>
  91. <P>
  92. <!-- ========== METHOD SUMMARY =========== -->
  93. <A NAME="method_summary"><!-- --></A>
  94. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  95. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  96. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  97. <B>Method Summary</B></FONT></TH>
  98. </TR>
  99. <TR BGCOLOR="white" CLASS="TableRowColor">
  100. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  101. <CODE>&nbsp;int</CODE></FONT></TD>
  102. <TD><CODE><B><A HREF="cubeWorker.html#addAnimation()">addAnimation</A></B>()</CODE>
  103. <BR>
  104. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add an animation.</TD>
  105. </TR>
  106. <TR BGCOLOR="white" CLASS="TableRowColor">
  107. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  108. <CODE>&nbsp;int</CODE></FONT></TD>
  109. <TD><CODE><B><A HREF="cubeWorker.html#addFrame(int)">addFrame</A></B>(int&nbsp;anim)</CODE>
  110. <BR>
  111. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a Frame to an animation.</TD>
  112. </TR>
  113. <TR BGCOLOR="white" CLASS="TableRowColor">
  114. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  115. <CODE>&nbsp;boolean</CODE></FONT></TD>
  116. <TD><CODE><B><A HREF="cubeWorker.html#changedStateSinceSave()">changedStateSinceSave</A></B>()</CODE>
  117. <BR>
  118. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if something changed after loading/saving.</TD>
  119. </TR>
  120. <TR BGCOLOR="white" CLASS="TableRowColor">
  121. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  122. <CODE>&nbsp;int</CODE></FONT></TD>
  123. <TD><CODE><B><A HREF="cubeWorker.html#downloadState(java.lang.String)">downloadState</A></B>(java.lang.String&nbsp;port)</CODE>
  124. <BR>
  125. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get all animations from the cube, place it in this object</TD>
  126. </TR>
  127. <TR BGCOLOR="white" CLASS="TableRowColor">
  128. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  129. <CODE>&nbsp;int</CODE></FONT></TD>
  130. <TD><CODE><B><A HREF="cubeWorker.html#framesRemaining()">framesRemaining</A></B>()</CODE>
  131. <BR>
  132. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the number of frames you can add until the Cubes memory is full.</TD>
  133. </TR>
  134. <TR BGCOLOR="white" CLASS="TableRowColor">
  135. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  136. <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
  137. <TD><CODE><B><A HREF="cubeWorker.html#getAnimationName(int)">getAnimationName</A></B>(int&nbsp;selectedAnimation)</CODE>
  138. <BR>
  139. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the name of an animation</TD>
  140. </TR>
  141. <TR BGCOLOR="white" CLASS="TableRowColor">
  142. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  143. <CODE>&nbsp;short[]</CODE></FONT></TD>
  144. <TD><CODE><B><A HREF="cubeWorker.html#getFrame(int, int)">getFrame</A></B>(int&nbsp;anim,
  145. int&nbsp;frame)</CODE>
  146. <BR>
  147. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the data of a frame.</TD>
  148. </TR>
  149. <TR BGCOLOR="white" CLASS="TableRowColor">
  150. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  151. <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
  152. <TD><CODE><B><A HREF="cubeWorker.html#getFrameName(int, int)">getFrameName</A></B>(int&nbsp;anim,
  153. int&nbsp;frame)</CODE>
  154. <BR>
  155. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the name of a frame.</TD>
  156. </TR>
  157. <TR BGCOLOR="white" CLASS="TableRowColor">
  158. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  159. <CODE>&nbsp;short</CODE></FONT></TD>
  160. <TD><CODE><B><A HREF="cubeWorker.html#getFrameTime(int, int)">getFrameTime</A></B>(int&nbsp;anim,
  161. int&nbsp;frame)</CODE>
  162. <BR>
  163. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get frame duration.</TD>
  164. </TR>
  165. <TR BGCOLOR="white" CLASS="TableRowColor">
  166. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  167. <CODE>&nbsp;java.lang.String[]</CODE></FONT></TD>
  168. <TD><CODE><B><A HREF="cubeWorker.html#getSerialPorts()">getSerialPorts</A></B>()</CODE>
  169. <BR>
  170. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the names of all available serial ports.</TD>
  171. </TR>
  172. <TR BGCOLOR="white" CLASS="TableRowColor">
  173. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  174. <CODE>&nbsp;int</CODE></FONT></TD>
  175. <TD><CODE><B><A HREF="cubeWorker.html#loadState(java.lang.String)">loadState</A></B>(java.lang.String&nbsp;path)</CODE>
  176. <BR>
  177. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loads an animation file into this worker.</TD>
  178. </TR>
  179. <TR BGCOLOR="white" CLASS="TableRowColor">
  180. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  181. <CODE>&nbsp;void</CODE></FONT></TD>
  182. <TD><CODE><B><A HREF="cubeWorker.html#moveAnimation(int, int)">moveAnimation</A></B>(int&nbsp;dir,
  183. int&nbsp;selectedAnimation)</CODE>
  184. <BR>
  185. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Move an animation UP or DOWN.</TD>
  186. </TR>
  187. <TR BGCOLOR="white" CLASS="TableRowColor">
  188. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  189. <CODE>&nbsp;void</CODE></FONT></TD>
  190. <TD><CODE><B><A HREF="cubeWorker.html#moveFrame(int, int, int)">moveFrame</A></B>(int&nbsp;dir,
  191. int&nbsp;anim,
  192. int&nbsp;frame)</CODE>
  193. <BR>
  194. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Move a frame.</TD>
  195. </TR>
  196. <TR BGCOLOR="white" CLASS="TableRowColor">
  197. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  198. <CODE>&nbsp;int</CODE></FONT></TD>
  199. <TD><CODE><B><A HREF="cubeWorker.html#numOfAnimations()">numOfAnimations</A></B>()</CODE>
  200. <BR>
  201. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the number of animations in this worker.</TD>
  202. </TR>
  203. <TR BGCOLOR="white" CLASS="TableRowColor">
  204. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  205. <CODE>&nbsp;int</CODE></FONT></TD>
  206. <TD><CODE><B><A HREF="cubeWorker.html#numOfFrames(int)">numOfFrames</A></B>(int&nbsp;selectedAnimation)</CODE>
  207. <BR>
  208. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the number of frames in an animation.</TD>
  209. </TR>
  210. <TR BGCOLOR="white" CLASS="TableRowColor">
  211. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  212. <CODE>&nbsp;void</CODE></FONT></TD>
  213. <TD><CODE><B><A HREF="cubeWorker.html#removeAnimation(int)">removeAnimation</A></B>(int&nbsp;selectedAnimation)</CODE>
  214. <BR>
  215. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove an animation.</TD>
  216. </TR>
  217. <TR BGCOLOR="white" CLASS="TableRowColor">
  218. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  219. <CODE>&nbsp;void</CODE></FONT></TD>
  220. <TD><CODE><B><A HREF="cubeWorker.html#removeFrame(int, int)">removeFrame</A></B>(int&nbsp;anim,
  221. int&nbsp;frame)</CODE>
  222. <BR>
  223. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove a frame.</TD>
  224. </TR>
  225. <TR BGCOLOR="white" CLASS="TableRowColor">
  226. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  227. <CODE>&nbsp;int</CODE></FONT></TD>
  228. <TD><CODE><B><A HREF="cubeWorker.html#saveState(java.lang.String)">saveState</A></B>(java.lang.String&nbsp;path)</CODE>
  229. <BR>
  230. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Save the state of this object into a file.</TD>
  231. </TR>
  232. <TR BGCOLOR="white" CLASS="TableRowColor">
  233. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  234. <CODE>&nbsp;void</CODE></FONT></TD>
  235. <TD><CODE><B><A HREF="cubeWorker.html#setAnimationName(java.lang.String, int)">setAnimationName</A></B>(java.lang.String&nbsp;s,
  236. int&nbsp;selectedAnimation)</CODE>
  237. <BR>
  238. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the name of an animation
  239.  @param s New name</TD>
  240. </TR>
  241. <TR BGCOLOR="white" CLASS="TableRowColor">
  242. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  243. <CODE>&nbsp;void</CODE></FONT></TD>
  244. <TD><CODE><B><A HREF="cubeWorker.html#setFrame(short[], int, int)">setFrame</A></B>(short[]&nbsp;data,
  245. int&nbsp;anim,
  246. int&nbsp;frame)</CODE>
  247. <BR>
  248. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the data of a frame</TD>
  249. </TR>
  250. <TR BGCOLOR="white" CLASS="TableRowColor">
  251. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  252. <CODE>&nbsp;void</CODE></FONT></TD>
  253. <TD><CODE><B><A HREF="cubeWorker.html#setFrameName(java.lang.String, int, int)">setFrameName</A></B>(java.lang.String&nbsp;s,
  254. int&nbsp;anim,
  255. int&nbsp;frame)</CODE>
  256. <BR>
  257. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the name of a frame.</TD>
  258. </TR>
  259. <TR BGCOLOR="white" CLASS="TableRowColor">
  260. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  261. <CODE>&nbsp;void</CODE></FONT></TD>
  262. <TD><CODE><B><A HREF="cubeWorker.html#setFrameTime(short, int, int)">setFrameTime</A></B>(short&nbsp;time,
  263. int&nbsp;anim,
  264. int&nbsp;frame)</CODE>
  265. <BR>
  266. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the frames duration.</TD>
  267. </TR>
  268. <TR BGCOLOR="white" CLASS="TableRowColor">
  269. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  270. <CODE>&nbsp;int</CODE></FONT></TD>
  271. <TD><CODE><B><A HREF="cubeWorker.html#uploadState(java.lang.String)">uploadState</A></B>(java.lang.String&nbsp;port)</CODE>
  272. <BR>
  273. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Send all animations to the cube.</TD>
  274. </TR>
  275. </TABLE>
  276. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  277. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  278. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  279. <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
  280. </TR>
  281. <TR BGCOLOR="white" CLASS="TableRowColor">
  282. <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
  283. </TR>
  284. </TABLE>
  285. &nbsp;
  286. <P>
  287. <!-- ============ METHOD DETAIL ========== -->
  288. <A NAME="method_detail"><!-- --></A>
  289. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  290. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  291. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  292. <B>Method Detail</B></FONT></TH>
  293. </TR>
  294. </TABLE>
  295. <A NAME="numOfAnimations()"><!-- --></A><H3>
  296. numOfAnimations</H3>
  297. <PRE>
  298. public int <B>numOfAnimations</B>()</PRE>
  299. <DL>
  300. <DD>Get the number of animations in this worker.
  301. <P>
  302. <DD><DL>
  303. <DT><B>Returns:</B><DD>number of animations</DL>
  304. </DD>
  305. </DL>
  306. <HR>
  307. <A NAME="numOfFrames(int)"><!-- --></A><H3>
  308. numOfFrames</H3>
  309. <PRE>
  310. public int <B>numOfFrames</B>(int&nbsp;selectedAnimation)</PRE>
  311. <DL>
  312. <DD>Get the number of frames in an animation.
  313. <P>
  314. <DD><DL>
  315. <DT><B>Parameters:</B><DD><CODE>selectedAnimation</CODE> - the animation you want to check
  316. <DT><B>Returns:</B><DD>number of frames in this animation</DL>
  317. </DD>
  318. </DL>
  319. <HR>
  320. <A NAME="framesRemaining()"><!-- --></A><H3>
  321. framesRemaining</H3>
  322. <PRE>
  323. public int <B>framesRemaining</B>()</PRE>
  324. <DL>
  325. <DD>Get the number of frames you can add until the Cubes memory is full.
  326. <P>
  327. <DD><DL>
  328. <DT><B>Returns:</B><DD>number of frames remaining</DL>
  329. </DD>
  330. </DL>
  331. <HR>
  332. <A NAME="addAnimation()"><!-- --></A><H3>
  333. addAnimation</H3>
  334. <PRE>
  335. public int <B>addAnimation</B>()</PRE>
  336. <DL>
  337. <DD>Add an animation.
  338. <P>
  339. <DD><DL>
  340. <DT><B>Returns:</B><DD>Index of new animation, or -1 if not enough space remaining.</DL>
  341. </DD>
  342. </DL>
  343. <HR>
  344. <A NAME="removeAnimation(int)"><!-- --></A><H3>
  345. removeAnimation</H3>
  346. <PRE>
  347. public void <B>removeAnimation</B>(int&nbsp;selectedAnimation)</PRE>
  348. <DL>
  349. <DD>Remove an animation.
  350. <P>
  351. <DD><DL>
  352. <DT><B>Parameters:</B><DD><CODE>selectedAnimation</CODE> - the animation you want to delete</DL>
  353. </DD>
  354. </DL>
  355. <HR>
  356. <A NAME="getAnimationName(int)"><!-- --></A><H3>
  357. getAnimationName</H3>
  358. <PRE>
  359. public java.lang.String <B>getAnimationName</B>(int&nbsp;selectedAnimation)</PRE>
  360. <DL>
  361. <DD>Get the name of an animation
  362. <P>
  363. <DD><DL>
  364. <DT><B>Parameters:</B><DD><CODE>selectedAnimation</CODE> - The animation you want to get the name from
  365. <DT><B>Returns:</B><DD>The name</DL>
  366. </DD>
  367. </DL>
  368. <HR>
  369. <A NAME="setAnimationName(java.lang.String, int)"><!-- --></A><H3>
  370. setAnimationName</H3>
  371. <PRE>
  372. public void <B>setAnimationName</B>(java.lang.String&nbsp;s,
  373. int&nbsp;selectedAnimation)</PRE>
  374. <DL>
  375. <DD>Set the name of an animation
  376.  @param s New name
  377. <P>
  378. <DD><DL>
  379. <DT><B>Parameters:</B><DD><CODE>selectedAnimation</CODE> - Index of the animation you want to change</DL>
  380. </DD>
  381. </DL>
  382. <HR>
  383. <A NAME="moveAnimation(int, int)"><!-- --></A><H3>
  384. moveAnimation</H3>
  385. <PRE>
  386. public void <B>moveAnimation</B>(int&nbsp;dir,
  387. int&nbsp;selectedAnimation)</PRE>
  388. <DL>
  389. <DD>Move an animation UP or DOWN.
  390. <P>
  391. <DD><DL>
  392. <DT><B>Parameters:</B><DD><CODE>dir</CODE> - Direction. Use UP and DOWN defined in cubeWorker<DD><CODE>selectedAnimation</CODE> - Animation you want to move</DL>
  393. </DD>
  394. </DL>
  395. <HR>
  396. <A NAME="getFrameName(int, int)"><!-- --></A><H3>
  397. getFrameName</H3>
  398. <PRE>
  399. public java.lang.String <B>getFrameName</B>(int&nbsp;anim,
  400. int&nbsp;frame)</PRE>
  401. <DL>
  402. <DD>Get the name of a frame.
  403. <P>
  404. <DD><DL>
  405. <DT><B>Parameters:</B><DD><CODE>anim</CODE> - Animation the frame is in<DD><CODE>frame</CODE> - Index of the frame</DL>
  406. </DD>
  407. </DL>
  408. <HR>
  409. <A NAME="setFrameName(java.lang.String, int, int)"><!-- --></A><H3>
  410. setFrameName</H3>
  411. <PRE>
  412. public void <B>setFrameName</B>(java.lang.String&nbsp;s,
  413. int&nbsp;anim,
  414. int&nbsp;frame)</PRE>
  415. <DL>
  416. <DD>Set the name of a frame.
  417. <P>
  418. <DD><DL>
  419. <DT><B>Parameters:</B><DD><CODE>s</CODE> - New name<DD><CODE>anim</CODE> - Animation Index<DD><CODE>frame</CODE> - Frame Index</DL>
  420. </DD>
  421. </DL>
  422. <HR>
  423. <A NAME="addFrame(int)"><!-- --></A><H3>
  424. addFrame</H3>
  425. <PRE>
  426. public int <B>addFrame</B>(int&nbsp;anim)</PRE>
  427. <DL>
  428. <DD>Add a Frame to an animation.
  429. <P>
  430. <DD><DL>
  431. <DT><B>Parameters:</B><DD><CODE>anim</CODE> - Animation Index
  432. <DT><B>Returns:</B><DD>Index of new Frame or -1 if not enough space</DL>
  433. </DD>
  434. </DL>
  435. <HR>
  436. <A NAME="removeFrame(int, int)"><!-- --></A><H3>
  437. removeFrame</H3>
  438. <PRE>
  439. public void <B>removeFrame</B>(int&nbsp;anim,
  440. int&nbsp;frame)</PRE>
  441. <DL>
  442. <DD>Remove a frame.
  443. <P>
  444. <DD><DL>
  445. <DT><B>Parameters:</B><DD><CODE>anim</CODE> - Animation Index<DD><CODE>frame</CODE> - Frame you want to remove</DL>
  446. </DD>
  447. </DL>
  448. <HR>
  449. <A NAME="getFrame(int, int)"><!-- --></A><H3>
  450. getFrame</H3>
  451. <PRE>
  452. public short[] <B>getFrame</B>(int&nbsp;anim,
  453. int&nbsp;frame)</PRE>
  454. <DL>
  455. <DD>Get the data of a frame.
  456. <P>
  457. <DD><DL>
  458. <DT><B>Parameters:</B><DD><CODE>anim</CODE> - Animation Index
  459.  @param frame Frame Index
  460. <DT><B>Returns:</B><DD>64 byte array with data (8 bits per byte => 512 bits)</DL>
  461. </DD>
  462. </DL>
  463. <HR>
  464. <A NAME="setFrame(short[], int, int)"><!-- --></A><H3>
  465. setFrame</H3>
  466. <PRE>
  467. public void <B>setFrame</B>(short[]&nbsp;data,
  468. int&nbsp;anim,
  469. int&nbsp;frame)</PRE>
  470. <DL>
  471. <DD>Set the data of a frame
  472. <P>
  473. <DD><DL>
  474. <DT><B>Parameters:</B><DD><CODE>data</CODE> - 64 byte array with data<DD><CODE>anim</CODE> - Animation Index<DD><CODE>frame</CODE> - Frame Index<DT><B>See Also:</B><DD><A HREF="cubeWorker.html#getFrame(int, int)"><CODE>getFrame()</CODE></A></DL>
  475. </DD>
  476. </DL>
  477. <HR>
  478. <A NAME="getFrameTime(int, int)"><!-- --></A><H3>
  479. getFrameTime</H3>
  480. <PRE>
  481. public short <B>getFrameTime</B>(int&nbsp;anim,
  482. int&nbsp;frame)</PRE>
  483. <DL>
  484. <DD>Get frame duration.
  485. <P>
  486. <DD><DL>
  487. <DT><B>Parameters:</B><DD><CODE>anim</CODE> - Animation Index<DD><CODE>frame</CODE> - Frame Index
  488. <DT><B>Returns:</B><DD>Duration. 0 means 1/24th of a second.</DL>
  489. </DD>
  490. </DL>
  491. <HR>
  492. <A NAME="setFrameTime(short, int, int)"><!-- --></A><H3>
  493. setFrameTime</H3>
  494. <PRE>
  495. public void <B>setFrameTime</B>(short&nbsp;time,
  496. int&nbsp;anim,
  497. int&nbsp;frame)</PRE>
  498. <DL>
  499. <DD>Set the frames duration.
  500. <P>
  501. <DD><DL>
  502. <DT><B>Parameters:</B><DD><CODE>time</CODE> - New duration<DD><CODE>anim</CODE> - Animation Index<DD><CODE>frame</CODE> - Frame Index<DT><B>See Also:</B><DD><A HREF="cubeWorker.html#getFrameTime(int, int)"><CODE>getFrameTime()</CODE></A></DL>
  503. </DD>
  504. </DL>
  505. <HR>
  506. <A NAME="moveFrame(int, int, int)"><!-- --></A><H3>
  507. moveFrame</H3>
  508. <PRE>
  509. public void <B>moveFrame</B>(int&nbsp;dir,
  510. int&nbsp;anim,
  511. int&nbsp;frame)</PRE>
  512. <DL>
  513. <DD>Move a frame.
  514. <P>
  515. <DD><DL>
  516. <DT><B>Parameters:</B><DD><CODE>dir</CODE> - Direction to move. Use UP and DOWN from cubeWorker<DD><CODE>anim</CODE> - Animation Index<DD><CODE>frame</CODE> - Frame Index<DT><B>See Also:</B><DD><A HREF="cubeWorker.html#moveAnimation(int, int)"><CODE>moveAnimation()</CODE></A></DL>
  517. </DD>
  518. </DL>
  519. <HR>
  520. <A NAME="loadState(java.lang.String)"><!-- --></A><H3>
  521. loadState</H3>
  522. <PRE>
  523. public int <B>loadState</B>(java.lang.String&nbsp;path)</PRE>
  524. <DL>
  525. <DD>Loads an animation file into this worker.
  526. <P>
  527. <DD><DL>
  528. <DT><B>Parameters:</B><DD><CODE>path</CODE> - Path of file to load
  529. <DT><B>Returns:</B><DD>0 on success, -1 on error.</DL>
  530. </DD>
  531. </DL>
  532. <HR>
  533. <A NAME="saveState(java.lang.String)"><!-- --></A><H3>
  534. saveState</H3>
  535. <PRE>
  536. public int <B>saveState</B>(java.lang.String&nbsp;path)</PRE>
  537. <DL>
  538. <DD>Save the state of this object into a file.
  539. <P>
  540. <DD><DL>
  541. <DT><B>Parameters:</B><DD><CODE>path</CODE> - Path to save file in
  542. <DT><B>Returns:</B><DD>0 on success, -1 on error</DL>
  543. </DD>
  544. </DL>
  545. <HR>
  546. <A NAME="changedStateSinceSave()"><!-- --></A><H3>
  547. changedStateSinceSave</H3>
  548. <PRE>
  549. public boolean <B>changedStateSinceSave</B>()</PRE>
  550. <DL>
  551. <DD>Check if something changed after loading/saving.
  552. <P>
  553. <DD><DL>
  554. <DT><B>Returns:</B><DD>TRUE if something changed, FALSE otherwise</DL>
  555. </DD>
  556. </DL>
  557. <HR>
  558. <A NAME="uploadState(java.lang.String)"><!-- --></A><H3>
  559. uploadState</H3>
  560. <PRE>
  561. public int <B>uploadState</B>(java.lang.String&nbsp;port)</PRE>
  562. <DL>
  563. <DD>Send all animations to the cube.
  564. <P>
  565. <DD><DL>
  566. <DT><B>Parameters:</B><DD><CODE>port</CODE> - Name of serial port to use
  567. <DT><B>Returns:</B><DD>0 on success, -1 on error</DL>
  568. </DD>
  569. </DL>
  570. <HR>
  571. <A NAME="downloadState(java.lang.String)"><!-- --></A><H3>
  572. downloadState</H3>
  573. <PRE>
  574. public int <B>downloadState</B>(java.lang.String&nbsp;port)</PRE>
  575. <DL>
  576. <DD>Get all animations from the cube, place it in this object
  577. <P>
  578. <DD><DL>
  579. <DT><B>Parameters:</B><DD><CODE>port</CODE> - Name of serial port to use
  580.  @return 0 on success, -1 on error</DL>
  581. </DD>
  582. </DL>
  583. <HR>
  584. <A NAME="getSerialPorts()"><!-- --></A><H3>
  585. getSerialPorts</H3>
  586. <PRE>
  587. public java.lang.String[] <B>getSerialPorts</B>()</PRE>
  588. <DL>
  589. <DD>Get the names of all available serial ports.
  590. <P>
  591. <DD><DL>
  592. <DT><B>Returns:</B><DD>Array of port names. First entry is always "Select serial port..."</DL>
  593. </DD>
  594. </DL>
  595. <!-- ========= END OF CLASS DATA ========= -->
  596. <HR>
  597. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  598. <A NAME="navbar_bottom"><!-- --></A>
  599. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  600. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  601. <TR>
  602. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  603. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  604. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  605. <TR ALIGN="center" VALIGN="top">
  606. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  607. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  608. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  609. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  610. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  611. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  612. </TR>
  613. </TABLE>
  614. </TD>
  615. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  616. </EM>
  617. </TD>
  618. </TR>
  619. <TR>
  620. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  621. &nbsp;<A HREF="AnimationUtility.html" title="class in &lt;Unnamed&gt;"><B>PREV CLASS</B></A>&nbsp;
  622. &nbsp;<A HREF="Frame.html" title="class in &lt;Unnamed&gt;"><B>NEXT CLASS</B></A></FONT></TD>
  623. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  624. <A HREF="index.html?cubeWorker.html" target="_top"><B>FRAMES</B></A> &nbsp;
  625. &nbsp;<A HREF="cubeWorker.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  626. &nbsp;<SCRIPT type="text/javascript">
  627. <!--
  628. if(window==top) {
  629. document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
  630. }
  631. //-->
  632. </SCRIPT>
  633. <NOSCRIPT>
  634. <A HREF="allclasses-noframe.html"><B>All Classes</B></A>
  635. </NOSCRIPT>
  636. </FONT></TD>
  637. </TR>
  638. <TR>
  639. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  640. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  641. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  642. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  643. </TR>
  644. </TABLE>
  645. <A NAME="skip-navbar_bottom"></A>
  646. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  647. <HR>
  648. </BODY>
  649. </HTML>