OSDN Git Service

lejos_NXJ_win32_0_5_0beta.zip
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / docs / apidocs / lejos / util / ButtonCounter.html
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.5.0_09) on Tue Jan 08 20:46:02 GMT 2008 -->
6 <TITLE>
7 ButtonCounter (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="lejos.util.ButtonCounter class">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17     parent.document.title="ButtonCounter (leJOS NXT API documentation)";
18 }
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
22
23 </HEAD>
24
25 <BODY BGCOLOR="white" onload="windowTitle();">
26
27
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36   <TR ALIGN="center" VALIGN="top">
37   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44   </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
51
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../lejos/util/Assertion.html" title="class in lejos.util"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;<A HREF="../../lejos/util/Datalogger.html" title="class in lejos.util"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57   <A HREF="../../index.html?lejos/util/ButtonCounter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58 &nbsp;<A HREF="ButtonCounter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60   <!--
61   if(window==top) {
62     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
63   }
64   //-->
65 </SCRIPT>
66 <NOSCRIPT>
67   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
69
70
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
82
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 lejos.util</FONT>
88 <BR>
89 Class ButtonCounter</H2>
90 <PRE>
91 <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
92   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>lejos.util.ButtonCounter</B>
93 </PRE>
94 <HR>
95 <DL>
96 <DT><PRE>public class <B>ButtonCounter</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>
97 </PRE>
98
99 <P>
100 This is class is for data entry using the NXT keyboard.
101 Counts number of presses of left and right buttons <br>
102 Press ENTER together with together with LEFT  or RIGHT to decrease the count. 
103 Press ESCAPE or ENTER alone to end counting. 
104 Displays the count as it is entered, and makes a sound with each button press.
105 Stores the count in public fields
106 <P>
107
108 <P>
109 <DL>
110 <DT><B>Author:</B></DT>
111   <DD>Roger Glassey 8/20/07</DD>
112 </DL>
113 <HR>
114
115 <P>
116 <!-- =========== FIELD SUMMARY =========== -->
117
118 <A NAME="field_summary"><!-- --></A>
119 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
120 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
121 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
122 <B>Field Summary</B></FONT></TH>
123 </TR>
124 <TR BGCOLOR="white" CLASS="TableRowColor">
125 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
126 <CODE>&nbsp;int</CODE></FONT></TD>
127 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#_leftCount">_leftCount</A></B></CODE>
128
129 <BR>
130 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output only not used in calculations; use after count() returns;</TD>
131 </TR>
132 <TR BGCOLOR="white" CLASS="TableRowColor">
133 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
134 <CODE>&nbsp;int</CODE></FONT></TD>
135 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#_rightCount">_rightCount</A></B></CODE>
136
137 <BR>
138 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output only not used in calculations ; use this value after count() returns;</TD>
139 </TR>
140 </TABLE>
141 &nbsp;
142 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
143
144 <A NAME="constructor_summary"><!-- --></A>
145 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
146 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
147 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
148 <B>Constructor Summary</B></FONT></TH>
149 </TR>
150 <TR BGCOLOR="white" CLASS="TableRowColor">
151 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#ButtonCounter()">ButtonCounter</A></B>()</CODE>
152
153 <BR>
154 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
155 </TR>
156 </TABLE>
157 &nbsp;
158 <!-- ========== METHOD SUMMARY =========== -->
159
160 <A NAME="method_summary"><!-- --></A>
161 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
162 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
163 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
164 <B>Method Summary</B></FONT></TH>
165 </TR>
166 <TR BGCOLOR="white" CLASS="TableRowColor">
167 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
168 <CODE>&nbsp;void</CODE></FONT></TD>
169 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#count()">count</A></B>()</CODE>
170
171 <BR>
172 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;called by count( string)</TD>
173 </TR>
174 <TR BGCOLOR="white" CLASS="TableRowColor">
175 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
176 <CODE>&nbsp;void</CODE></FONT></TD>
177 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#count(java.lang.String)">count</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s)</CODE>
178
179 <BR>
180 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start counting; parameter string is displayed; use it to identify this  particular call <br>
181 returns when ESC or ENTER button is pressed <br>
182 Hold Enter and left or right to decrease count,  otherwise it increases <br>
183 counters are reset when this method is called.</TD>
184 </TR>
185 <TR BGCOLOR="white" CLASS="TableRowColor">
186 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
187 <CODE>&nbsp;void</CODE></FONT></TD>
188 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#count(java.lang.String, int, int)">count</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s,
189       int&nbsp;left,
190       int&nbsp;right)</CODE>
191
192 <BR>
193 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes values of left count and right count.</TD>
194 </TR>
195 <TR BGCOLOR="white" CLASS="TableRowColor">
196 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
197 <CODE>&nbsp;int</CODE></FONT></TD>
198 <TD><CODE><B><A HREF="../../lejos/util/ButtonCounter.html#getLeftCount()">getLeftCount</A></B>()</CODE>
199
200 <BR>
201 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this method after counting is complete;</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="../../lejos/util/ButtonCounter.html#getRightCount()">getRightCount</A></B>()</CODE>
207
208 <BR>
209 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this method after counting is complete;</TD>
210 </TR>
211 </TABLE>
212 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
213 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
214 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
215 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
216 </TR>
217 <TR BGCOLOR="white" CLASS="TableRowColor">
218 <TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A></CODE></TD>
219 </TR>
220 </TABLE>
221 &nbsp;
222 <P>
223
224 <!-- ============ FIELD DETAIL =========== -->
225
226 <A NAME="field_detail"><!-- --></A>
227 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
228 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
229 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
230 <B>Field Detail</B></FONT></TH>
231 </TR>
232 </TABLE>
233
234 <A NAME="_rightCount"><!-- --></A><H3>
235 _rightCount</H3>
236 <PRE>
237 public int <B>_rightCount</B></PRE>
238 <DL>
239 <DD>Output only not used in calculations ; use this value after count() returns;
240 <P>
241 <DL>
242 </DL>
243 </DL>
244 <HR>
245
246 <A NAME="_leftCount"><!-- --></A><H3>
247 _leftCount</H3>
248 <PRE>
249 public int <B>_leftCount</B></PRE>
250 <DL>
251 <DD>Output only not used in calculations; use after count() returns;
252 <P>
253 <DL>
254 </DL>
255 </DL>
256
257 <!-- ========= CONSTRUCTOR DETAIL ======== -->
258
259 <A NAME="constructor_detail"><!-- --></A>
260 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
261 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
262 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
263 <B>Constructor Detail</B></FONT></TH>
264 </TR>
265 </TABLE>
266
267 <A NAME="ButtonCounter()"><!-- --></A><H3>
268 ButtonCounter</H3>
269 <PRE>
270 public <B>ButtonCounter</B>()</PRE>
271 <DL>
272 </DL>
273
274 <!-- ============ METHOD DETAIL ========== -->
275
276 <A NAME="method_detail"><!-- --></A>
277 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
278 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
279 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
280 <B>Method Detail</B></FONT></TH>
281 </TR>
282 </TABLE>
283
284 <A NAME="getRightCount()"><!-- --></A><H3>
285 getRightCount</H3>
286 <PRE>
287 public int <B>getRightCount</B>()</PRE>
288 <DL>
289 <DD>Use this method after counting is complete;
290 <P>
291 <DD><DL>
292
293 <DT><B>Returns:</B><DD>value of right count.</DL>
294 </DD>
295 </DL>
296 <HR>
297
298 <A NAME="getLeftCount()"><!-- --></A><H3>
299 getLeftCount</H3>
300 <PRE>
301 public int <B>getLeftCount</B>()</PRE>
302 <DL>
303 <DD>Use this method after counting is complete;
304 <P>
305 <DD><DL>
306
307 <DT><B>Returns:</B><DD>value of left count.</DL>
308 </DD>
309 </DL>
310 <HR>
311
312 <A NAME="count(java.lang.String)"><!-- --></A><H3>
313 count</H3>
314 <PRE>
315 public void <B>count</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s)</PRE>
316 <DL>
317 <DD>Start counting; parameter string is displayed; use it to identify this  particular call <br>
318 returns when ESC or ENTER button is pressed <br>
319 Hold Enter and left or right to decrease count,  otherwise it increases <br>
320 counters are reset when this method is called.
321 <P>
322 <DD><DL>
323 </DL>
324 </DD>
325 </DL>
326 <HR>
327
328 <A NAME="count()"><!-- --></A><H3>
329 count</H3>
330 <PRE>
331 public void <B>count</B>()</PRE>
332 <DL>
333 <DD>called by count( string)
334 <P>
335 <DD><DL>
336 </DL>
337 </DD>
338 </DL>
339 <HR>
340
341 <A NAME="count(java.lang.String, int, int)"><!-- --></A><H3>
342 count</H3>
343 <PRE>
344 public void <B>count</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s,
345                   int&nbsp;left,
346                   int&nbsp;right)</PRE>
347 <DL>
348 <DD>Initializes values of left count and right count.
349  Displays parameter   s   ; sets _leftcount = left,  _rightCount = right
350 <P>
351 <DD><DL>
352 </DL>
353 </DD>
354 </DL>
355 <!-- ========= END OF CLASS DATA ========= -->
356 <HR>
357
358
359 <!-- ======= START OF BOTTOM NAVBAR ====== -->
360 <A NAME="navbar_bottom"><!-- --></A>
361 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
362 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
363 <TR>
364 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
365 <A NAME="navbar_bottom_firstrow"><!-- --></A>
366 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
367   <TR ALIGN="center" VALIGN="top">
368   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
369   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
370   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
371   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
372   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
373   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
374   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
375   </TR>
376 </TABLE>
377 </TD>
378 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
379 </EM>
380 </TD>
381 </TR>
382
383 <TR>
384 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
385 &nbsp;<A HREF="../../lejos/util/Assertion.html" title="class in lejos.util"><B>PREV CLASS</B></A>&nbsp;
386 &nbsp;<A HREF="../../lejos/util/Datalogger.html" title="class in lejos.util"><B>NEXT CLASS</B></A></FONT></TD>
387 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
388   <A HREF="../../index.html?lejos/util/ButtonCounter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
389 &nbsp;<A HREF="ButtonCounter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
390 &nbsp;<SCRIPT type="text/javascript">
391   <!--
392   if(window==top) {
393     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
394   }
395   //-->
396 </SCRIPT>
397 <NOSCRIPT>
398   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
399 </NOSCRIPT>
400
401
402 </FONT></TD>
403 </TR>
404 <TR>
405 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
406   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
407 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
408 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
409 </TR>
410 </TABLE>
411 <A NAME="skip-navbar_bottom"></A>
412 <!-- ======== END OF BOTTOM NAVBAR ======= -->
413
414 <HR>
415
416 </BODY>
417 </HTML>