1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
<!-- Generated by javadoc (build 1.4.2_01) on Tue Oct 18 20:10:26 CEST 2005 -->
10
<META NAME="keywords" CONTENT="spin.Spin class">
12
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
14
<SCRIPT type="text/javascript">
15
function windowTitle()
17
parent.document.title="Spin";
23
<BODY BGCOLOR="white" onload="windowTitle();">
26
<!-- ========= START OF TOP NAVBAR ======= -->
27
<A NAME="navbar_top"><!-- --></A>
28
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
29
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
31
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
32
<A NAME="navbar_top_firstrow"><!-- --></A>
33
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
34
<TR ALIGN="center" VALIGN="top">
35
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
36
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
37
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
38
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
39
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
40
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
41
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
45
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
51
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
52
<A HREF="../spin/ProxyFactory.html" title="class in spin"><B>PREV CLASS</B></A>
53
NEXT CLASS</FONT></TD>
54
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
55
<A HREF="../index.html" target="_top"><B>FRAMES</B></A>
56
<A HREF="Spin.html" target="_top"><B>NO FRAMES</B></A>
57
<SCRIPT type="text/javascript">
60
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
65
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
71
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
72
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
73
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
74
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
77
<A NAME="skip-navbar_top"></A>
78
<!-- ========= END OF TOP NAVBAR ========= -->
81
<!-- ======== START OF CLASS DATA ======== -->
89
<IMG SRC="../resources/inherit.gif" ALT="extended by"><B>spin.Spin</B>
93
<DT>public class <B>Spin</B><DT>extends java.lang.Object</DL>
97
<em>Spin</em> offers a transparent threading solution for developing
98
non-freezing Swing applications.
101
Let <code>bean</code> be a reference to a non-visual (possibly
102
multithreaded) bean implementing the interface <code>Bean</code> whose
103
methods have to be called by a Swing component. You can avoid any freezing by
104
using one line of code:
107
bean = (Bean)Spin.off(bean);
110
Now each method call on <code>bean</code> is executed on a separate thread,
111
while the EDT is continuing to dispatch events. All return values or
112
exceptions are handled by <em>Spin</em> and transparently returned to the
116
For calls from other threads than the EDT to your Swing component you can use
117
the following (being <ode>XYListener</code> any interface your component
121
bean.addXYListener((XYListener)Spin.over(component);
124
Now all required updates to your component (and/or its model) are
125
transparently excuted on the EDT.
131
<DT><B>See Also:</B><DD><A HREF="../spin/Spin.html#off(java.lang.Object)"><CODE>off(Object)</CODE></A>,
132
<A HREF="../spin/Spin.html#over(java.lang.Object)"><CODE>over(Object)</CODE></A>,
133
<A HREF="../spin/ProxyFactory.html" title="class in spin"><CODE>ProxyFactory</CODE></A>,
134
<A HREF="../spin/off/SpinOffEvaluator.html" title="class in spin.off"><CODE>SpinOffEvaluator</CODE></A>,
135
<A HREF="../spin/over/SpinOverEvaluator.html" title="class in spin.over"><CODE>SpinOverEvaluator</CODE></A></DL>
139
<!-- ======== NESTED CLASS SUMMARY ======== -->
142
<!-- =========== FIELD SUMMARY =========== -->
145
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
147
<A NAME="constructor_summary"><!-- --></A>
148
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
149
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
150
<TD COLSPAN=2><FONT SIZE="+2">
151
<B>Constructor Summary</B></FONT></TD>
153
<TR BGCOLOR="white" CLASS="TableRowColor">
154
<TD><CODE><B><A HREF="../spin/Spin.html#Spin(java.lang.Object, spin.Evaluator)">Spin</A></B>(java.lang.Object object,
155
<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</CODE>
158
Create a <em>Spin</em> wrapper for the given object.</TD>
160
<TR BGCOLOR="white" CLASS="TableRowColor">
161
<TD><CODE><B><A HREF="../spin/Spin.html#Spin(java.lang.Object, spin.ProxyFactory, spin.Evaluator)">Spin</A></B>(java.lang.Object object,
162
<A HREF="../spin/ProxyFactory.html" title="class in spin">ProxyFactory</A> proxyFactory,
163
<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</CODE>
166
Create a <em>Spin</em> wrapper for the given object.</TD>
170
<!-- ========== METHOD SUMMARY =========== -->
172
<A NAME="method_summary"><!-- --></A>
173
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
174
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
175
<TD COLSPAN=2><FONT SIZE="+2">
176
<B>Method Summary</B></FONT></TD>
178
<TR BGCOLOR="white" CLASS="TableRowColor">
179
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
180
<CODE>static <A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A></CODE></FONT></TD>
181
<TD><CODE><B><A HREF="../spin/Spin.html#getDefaultOffEvaluator()">getDefaultOffEvaluator</A></B>()</CODE>
184
Get the default evaluator for spin-off.</TD>
186
<TR BGCOLOR="white" CLASS="TableRowColor">
187
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
188
<CODE>static <A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A></CODE></FONT></TD>
189
<TD><CODE><B><A HREF="../spin/Spin.html#getDefaultOverEvaluator()">getDefaultOverEvaluator</A></B>()</CODE>
192
Get the default evaluator for spin-over.</TD>
194
<TR BGCOLOR="white" CLASS="TableRowColor">
195
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
196
<CODE>static <A HREF="../spin/ProxyFactory.html" title="class in spin">ProxyFactory</A></CODE></FONT></TD>
197
<TD><CODE><B><A HREF="../spin/Spin.html#getDefaultProxyFactory()">getDefaultProxyFactory</A></B>()</CODE>
200
Get the default proxy factory.</TD>
202
<TR BGCOLOR="white" CLASS="TableRowColor">
203
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
204
<CODE> java.lang.Object</CODE></FONT></TD>
205
<TD><CODE><B><A HREF="../spin/Spin.html#getProxy()">getProxy</A></B>()</CODE>
208
Get a proxy for the wrapped object. </TD>
210
<TR BGCOLOR="white" CLASS="TableRowColor">
211
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
212
<CODE>static java.lang.Object</CODE></FONT></TD>
213
<TD><CODE><B><A HREF="../spin/Spin.html#off(java.lang.Object)">off</A></B>(java.lang.Object object)</CODE>
216
217
Convenience method to spin-off the given object from Swing.
220
<TR BGCOLOR="white" CLASS="TableRowColor">
221
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
222
<CODE>static java.lang.Object</CODE></FONT></TD>
223
<TD><CODE><B><A HREF="../spin/Spin.html#over(java.lang.Object)">over</A></B>(java.lang.Object object)</CODE>
226
Convenience method to spin-over the given object with Swing. </TD>
228
<TR BGCOLOR="white" CLASS="TableRowColor">
229
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
230
<CODE>static void</CODE></FONT></TD>
231
<TD><CODE><B><A HREF="../spin/Spin.html#setDefaultOffEvaluator(spin.Evaluator)">setDefaultOffEvaluator</A></B>(<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</CODE>
234
Set the default evaluator for spin-off.</TD>
236
<TR BGCOLOR="white" CLASS="TableRowColor">
237
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
238
<CODE>static void</CODE></FONT></TD>
239
<TD><CODE><B><A HREF="../spin/Spin.html#setDefaultOverEvaluator(spin.Evaluator)">setDefaultOverEvaluator</A></B>(<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</CODE>
242
Set the default evaluator for spin-over.</TD>
244
<TR BGCOLOR="white" CLASS="TableRowColor">
245
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
246
<CODE>static void</CODE></FONT></TD>
247
<TD><CODE><B><A HREF="../spin/Spin.html#setDefaultProxyFactory(spin.ProxyFactory)">setDefaultProxyFactory</A></B>(<A HREF="../spin/ProxyFactory.html" title="class in spin">ProxyFactory</A> factory)</CODE>
250
Set the default factory of proxies.</TD>
253
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
254
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
255
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
256
<TD><B>Methods inherited from class java.lang.Object</B></TD>
258
<TR BGCOLOR="white" CLASS="TableRowColor">
259
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
265
<!-- ============ FIELD DETAIL =========== -->
268
<!-- ========= CONSTRUCTOR DETAIL ======== -->
270
<A NAME="constructor_detail"><!-- --></A>
271
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
272
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
273
<TD COLSPAN=1><FONT SIZE="+2">
274
<B>Constructor Detail</B></FONT></TD>
278
<A NAME="Spin(java.lang.Object, spin.Evaluator)"><!-- --></A><H3>
281
public <B>Spin</B>(java.lang.Object object,
282
<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</PRE>
284
<DD>Create a <em>Spin</em> wrapper for the given object.
286
<DT><B>Parameters:</B><DD><CODE>object</CODE> - object to wrap<DD><CODE>evaluator</CODE> - evaluator of invocations on the given object</DL>
289
<A NAME="Spin(java.lang.Object, spin.ProxyFactory, spin.Evaluator)"><!-- --></A><H3>
292
public <B>Spin</B>(java.lang.Object object,
293
<A HREF="../spin/ProxyFactory.html" title="class in spin">ProxyFactory</A> proxyFactory,
294
<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</PRE>
296
<DD>Create a <em>Spin</em> wrapper for the given object.
298
<DT><B>Parameters:</B><DD><CODE>object</CODE> - object to wrap<DD><CODE>proxyFactory</CODE> - factory for a proxy<DD><CODE>evaluator</CODE> - evaluator of invocations on the given object</DL>
300
<!-- ============ METHOD DETAIL ========== -->
302
<A NAME="method_detail"><!-- --></A>
303
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
304
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
305
<TD COLSPAN=1><FONT SIZE="+2">
306
<B>Method Detail</B></FONT></TD>
310
<A NAME="getProxy()"><!-- --></A><H3>
313
public java.lang.Object <B>getProxy</B>()</PRE>
315
<DD>Get a proxy for the wrapped object. <br>
316
The returned object can safely be casted to any interface the wrapped
321
<DT><B>Returns:</B><DD>the new proxy</DL>
326
<A NAME="off(java.lang.Object)"><!-- --></A><H3>
329
public static java.lang.Object <B>off</B>(java.lang.Object object)</PRE>
332
Convenience method to spin-off the given object from Swing.
335
The returned object can safely be casted to any interface the given
340
<DT><B>Parameters:</B><DD><CODE>object</CODE> - the object to spin-off
341
<DT><B>Returns:</B><DD>proxy for the given object<DT><B>See Also:</B><DD><A HREF="../spin/Spin.html#setDefaultProxyFactory(spin.ProxyFactory)"><CODE>setDefaultProxyFactory(ProxyFactory)</CODE></A>,
342
<A HREF="../spin/Spin.html#setDefaultOffEvaluator(spin.Evaluator)"><CODE>setDefaultOffEvaluator(Evaluator)</CODE></A></DL>
347
<A NAME="over(java.lang.Object)"><!-- --></A><H3>
350
public static java.lang.Object <B>over</B>(java.lang.Object object)</PRE>
352
<DD>Convenience method to spin-over the given object with Swing. <br>
353
The returned object can safely be casted to any interface the given
357
<DT><B>Parameters:</B><DD><CODE>object</CODE> - the object to spin-over
358
<DT><B>Returns:</B><DD>proxy for the given object<DT><B>See Also:</B><DD><A HREF="../spin/Spin.html#setDefaultProxyFactory(spin.ProxyFactory)"><CODE>setDefaultProxyFactory(ProxyFactory)</CODE></A>,
359
<A HREF="../spin/Spin.html#setDefaultOverEvaluator(spin.Evaluator)"><CODE>setDefaultOverEvaluator(Evaluator)</CODE></A></DL>
364
<A NAME="setDefaultProxyFactory(spin.ProxyFactory)"><!-- --></A><H3>
365
setDefaultProxyFactory</H3>
367
public static void <B>setDefaultProxyFactory</B>(<A HREF="../spin/ProxyFactory.html" title="class in spin">ProxyFactory</A> factory)</PRE>
369
<DD>Set the default factory of proxies.
372
<DT><B>Parameters:</B><DD><CODE>factory</CODE> - proxy factore to use as default</DL>
377
<A NAME="setDefaultOffEvaluator(spin.Evaluator)"><!-- --></A><H3>
378
setDefaultOffEvaluator</H3>
380
public static void <B>setDefaultOffEvaluator</B>(<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</PRE>
382
<DD>Set the default evaluator for spin-off.
385
<DT><B>Parameters:</B><DD><CODE>evaluator</CODE> - evaluator to use for spin-off</DL>
390
<A NAME="setDefaultOverEvaluator(spin.Evaluator)"><!-- --></A><H3>
391
setDefaultOverEvaluator</H3>
393
public static void <B>setDefaultOverEvaluator</B>(<A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> evaluator)</PRE>
395
<DD>Set the default evaluator for spin-over.
398
<DT><B>Parameters:</B><DD><CODE>evaluator</CODE> - evaluator for spin-over</DL>
403
<A NAME="getDefaultProxyFactory()"><!-- --></A><H3>
404
getDefaultProxyFactory</H3>
406
public static <A HREF="../spin/ProxyFactory.html" title="class in spin">ProxyFactory</A> <B>getDefaultProxyFactory</B>()</PRE>
408
<DD>Get the default proxy factory.
412
<DT><B>Returns:</B><DD>the default factory of proxies</DL>
417
<A NAME="getDefaultOffEvaluator()"><!-- --></A><H3>
418
getDefaultOffEvaluator</H3>
420
public static <A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> <B>getDefaultOffEvaluator</B>()</PRE>
422
<DD>Get the default evaluator for spin-off.
426
<DT><B>Returns:</B><DD>evaluator for spin-off</DL>
431
<A NAME="getDefaultOverEvaluator()"><!-- --></A><H3>
432
getDefaultOverEvaluator</H3>
434
public static <A HREF="../spin/Evaluator.html" title="class in spin">Evaluator</A> <B>getDefaultOverEvaluator</B>()</PRE>
436
<DD>Get the default evaluator for spin-over.
440
<DT><B>Returns:</B><DD>evaluator for spin-over</DL>
443
<!-- ========= END OF CLASS DATA ========= -->
447
<!-- ======= START OF BOTTOM NAVBAR ====== -->
448
<A NAME="navbar_bottom"><!-- --></A>
449
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
450
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
452
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
453
<A NAME="navbar_bottom_firstrow"><!-- --></A>
454
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
455
<TR ALIGN="center" VALIGN="top">
456
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
457
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
458
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
459
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
460
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
461
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
462
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
466
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
472
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
473
<A HREF="../spin/ProxyFactory.html" title="class in spin"><B>PREV CLASS</B></A>
474
NEXT CLASS</FONT></TD>
475
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
476
<A HREF="../index.html" target="_top"><B>FRAMES</B></A>
477
<A HREF="Spin.html" target="_top"><B>NO FRAMES</B></A>
478
<SCRIPT type="text/javascript">
481
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
486
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
492
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
493
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
494
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
495
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
498
<A NAME="skip-navbar_bottom"></A>
499
<!-- ======== END OF BOTTOM NAVBAR ======= -->