From 95fbbb0110ca57f27097b4a0e9ab9aa78dd92424 Mon Sep 17 00:00:00 2001 From: "gune.kim" Date: Wed, 29 Jun 2011 19:28:25 +0900 Subject: [PATCH] Added motion sensor UI --- com.samsung.linuxplatform.sensor.motion/.classpath | 7 + com.samsung.linuxplatform.sensor.motion/.project | 28 ++++ .../.settings/org.eclipse.jdt.core.prefs | 8 + .../META-INF/MANIFEST.MF | 14 ++ .../linuxplatform/sensor/motion/Motion.class | Bin 0 -> 722 bytes .../sensor/motion/page/MotionPage$1.class | Bin 0 -> 1007 bytes .../sensor/motion/page/MotionPage$2.class | Bin 0 -> 1007 bytes .../sensor/motion/page/MotionPage$3.class | Bin 0 -> 1007 bytes .../sensor/motion/page/MotionPage$4.class | Bin 0 -> 1007 bytes .../sensor/motion/page/MotionPage$5.class | Bin 0 -> 1007 bytes .../sensor/motion/page/MotionPage$6.class | Bin 0 -> 1008 bytes .../sensor/motion/page/MotionPage$7.class | Bin 0 -> 1008 bytes .../sensor/motion/page/MotionPage$8.class | Bin 0 -> 1008 bytes .../sensor/motion/page/MotionPage$9.class | Bin 0 -> 1008 bytes .../sensor/motion/page/MotionPage.class | Bin 0 -> 4434 bytes .../build.properties | 5 + com.samsung.linuxplatform.sensor.motion/plugin.xml | 14 ++ .../linuxplatform/sensor/motion/Motion.java | 13 ++ .../sensor/motion/page/MotionPage.java | 165 +++++++++++++++++++++ 19 files changed, 254 insertions(+) create mode 100644 com.samsung.linuxplatform.sensor.motion/.classpath create mode 100644 com.samsung.linuxplatform.sensor.motion/.project create mode 100644 com.samsung.linuxplatform.sensor.motion/.settings/org.eclipse.jdt.core.prefs create mode 100644 com.samsung.linuxplatform.sensor.motion/META-INF/MANIFEST.MF create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/Motion.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$1.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$2.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$3.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$4.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$5.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$6.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$7.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$8.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$9.class create mode 100644 com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage.class create mode 100644 com.samsung.linuxplatform.sensor.motion/build.properties create mode 100644 com.samsung.linuxplatform.sensor.motion/plugin.xml create mode 100644 com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/Motion.java create mode 100644 com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/page/MotionPage.java diff --git a/com.samsung.linuxplatform.sensor.motion/.classpath b/com.samsung.linuxplatform.sensor.motion/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/com.samsung.linuxplatform.sensor.motion/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.samsung.linuxplatform.sensor.motion/.project b/com.samsung.linuxplatform.sensor.motion/.project new file mode 100644 index 0000000..eed3f49 --- /dev/null +++ b/com.samsung.linuxplatform.sensor.motion/.project @@ -0,0 +1,28 @@ + + + com.samsung.linuxplatform.sensor.motion + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.samsung.linuxplatform.sensor.motion/.settings/org.eclipse.jdt.core.prefs b/com.samsung.linuxplatform.sensor.motion/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..5f79cf8 --- /dev/null +++ b/com.samsung.linuxplatform.sensor.motion/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Jun 29 14:18:42 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/com.samsung.linuxplatform.sensor.motion/META-INF/MANIFEST.MF b/com.samsung.linuxplatform.sensor.motion/META-INF/MANIFEST.MF new file mode 100644 index 0000000..ffe2b9a --- /dev/null +++ b/com.samsung.linuxplatform.sensor.motion/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Motion +Bundle-SymbolicName: com.samsung.linuxplatform.sensor.motion;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: SAMSUNG +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.swt, + com.samsung.linuxplatform.injector +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Import-Package: com.samsung.freshide.connection.device, + com.samsung.linuxplatform.injector.provider, + org.eclipse.swt diff --git a/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/Motion.class b/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/Motion.class new file mode 100644 index 0000000000000000000000000000000000000000..2891c3dcecb6bc6025d25f028e0373226fffb6e5 GIT binary patch literal 722 zcmbtS%StOj5IvPdCr+Z{jqk_Coyo!xH+PY%D54-l5tN9_&ZLbkGt;4`BmS0~D=7E@ zew0{k26dq#xT)%@>T{}2bw54dKLXgmvWEg;Ez(Jti6k4Oy)ahk;HDo7d!Y?yWtwRd zCfX{UhKH}tLy55cHAbaZGO~>78-1<1(u6ym%o-8dgS>KJWkMMJr&49N2*uTUn^4-- zUFoBUu_{I|N(fpil}Cf5Bh9Jk#F9{J=}5$FVU&yWWXWEtjIiGNdZN!%Gzn$V?H-Gs z%sfmI{{9r-XGp#Zhc2VWT869f5n$SlKSMZM{br({?Wozh64xS(1;5LQH7e~j>un!| zxhm$dK=5(}guUN&b3&M#;GgJ$iR8X=`>qUCt+^?%!hMVUYk&fu_=VVd9EI$O{Yc{u z<=fY?&(@Wlt+1^QFR&lysDz0(@Fo+vdqLv?!Fi+h=MGczy6XoINvhe*FCQ9l!=21}F(^r)HE`IkFR-CArd*593_ALsPJq zv^7OCGENztjAceie`>#Dv$Yx+14{A(p!>Ahe39fR_=wsPP{bA;{$<8*9@r!fpZZ8oDES% zBSH;LfpY8v8a<`y&15v7;=LT?B(T~usmu>#q5OI7toWh?I?Ix2t#eVAPSr3Y_lgeX zBzLpc(NLfr_x{!1UEl7GCoGuaqyLN-sL!taeOHLUMt_m#zI+7y`rK$%~3Y_>`}xbxjGHroF=Z#fo6$5^)jyTSK#U&h?gAWA!_YUh$>%j pZ2>jovBm7S|AMQ{dH8B(aAmI7^SFz9yjOT!_wj%&U#n-%&o53d`Dg$D literal 0 HcmV?d00001 diff --git a/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$2.class b/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$2.class new file mode 100644 index 0000000000000000000000000000000000000000..ed87fd852dc4e22e71a66ffe4a7c415457073cd6 GIT binary patch literal 1007 zcmbVKZEq4m5Pp`UAoK*RTHoJMPfWaq#HgWZQn4mYpqkY5`*KX_HpecxU0VN^iPgjp z{s4cJah5~zn})mW?d;slv(L;tKYo7u4xo)kWfTNnC1xC3Ikrk=~L_It;R@v~pVlo6*uJPYwi%T{EN#1kQ&j<6IR1 z>LDs<2n3N2sP~knz3F&B*#|jDNnovK5}6*zO!@QNS@cB-be1L4Y;#eUPt|Zl?hPHv zY3lOU(NLfj_5Rh~9pCPbCoGuakDN)^O9oEj!sfzl^*rU9hqT>rk_JC$w)ft8qET7+~jaq zvyi%}w3aOH^6&y)D-ex_pCL;<;8j7Dy{l}!M1fzR+Io71u=N$SPkbuig7?k-`0NhW z_#ASM_g=&$-gzWgpQAkIvquq&J?n&ufVlG5ZfH%Au6rU2v@$~ p`T{EFvCZsX{{>f>^YGQ=Z~@ordECQ&-iti02YASquhlc>=NDyA`Huhq literal 0 HcmV?d00001 diff --git a/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$3.class b/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$3.class new file mode 100644 index 0000000000000000000000000000000000000000..070db20b1dd80dbdb25bdfaf052364f65704133a GIT binary patch literal 1007 zcmbVK+iuf95IviOgt#UN1eCi|CNF zv(XM^9KvX^vW_(60#&!KZ2JKdiI-&3V~`D{m3txlq=9FDdqH=_E5&>2yGD-;6@E{Tv!ePSR1|Xcmy;CWqUa zh1AcawPbOPhgarx45HQYGi0fkdDRiHcZIDdDDevf-Fu%AcE6(WkxwO@^uF02pS_7y zK8Kv+y{B-RcOD7W<|vQ&>`}xbxjGAeIZIrd0~Lur^(@ZuSK#~~i02&RA?n>v2&-Rk pVF6X}c*X2r{{>f{^YGOaaAmI7^SF*1yjOT!H*t$CU#n-%&o6v&`L+N6 literal 0 HcmV?d00001 diff --git a/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$4.class b/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$4.class new file mode 100644 index 0000000000000000000000000000000000000000..8cdfb87c78b8fb9b59736e17576ac5232ebc751e GIT binary patch literal 1007 zcmbVK+iuf95IviO7`rA31A3wi+2k;d41C#__W@emNIkrz zX={pPY@9MWnaB|(y_vnsW^*$@MWAsck7bfePJTZ)qRa)T3bafyN+`?K#8P5UTtdgB zolW|ba|olQ$~w|i2vpsnvdt$L+R%>OHhx-DRt{GAYfip1zoQ_aN zJw}LzK)K}u>Z#K7ZaN-Nu_p&P39P3klli_Zls_+=6nt}`=~0i|p&7<#`Z?6Hf~2Fa(JUaxO^$ao z3#pq+Ysumk53kJY6hx!pXUI}7^9m8Mca5zVDDewK?MI&xx4)wHkxwO@^}g93pWVYc zpJUGP-g7w5JC6h#3zTPk_9$YRT%85)&Js5kK=VYOdJ&iSD{%P_#A}Z65Mlch;@}Ie pETQH+`pkasFSu~Q!&fthD|5Y`$8FrtM?E8WA_SEbL1KkMQiV!D&<~r-G~II94Yzx(e@pNM z{NNApM~SmZG=5WZ$KKA)%{=?e%=6>tx9CBN&u;-uV~{;(yg4`$h&U&EhH`y z4}1V0g_w;~!W$^I);lwvIeT{I{QUL(2Y|=8TSH0Ud19uql~bGRNt`O3f1IV#jZMZ; z($-}0)Hr2yJd+cO2Xp%!o2|_nDgx1gJd|-Nx%lnyfD%_jRiJIMNlZzqW|m@mrImXju+?4}<^G;PrDsM|hrp>2HJl7k zMl(bmkwCfa6PkUc=}kTzQubaBQxaJ3n?$C2GE?4P1S|eh0^L=~v^M!t=Z@59Lhcof zWuCgCbu<#_wEO>R@3wDu*Ao^@@!o&t3p9!&kIxEl8CPq#BJgy@*@U=;>jG;mrO|+_ zW#Mp_+dH0Guxs)xq1Vc{vAI;%LoX?gZ0jU7R_V!r+`buwX!$ubl8mIIp3y8I$4w4* zGz+PhN^8mD1`n^y>jXp;`5Cg*%e?9cIJ(BxGnDuRg3g042s_`<_{3fbr+sYx$5(&A zI{P8l_~;p&<()@@jRndR_C1PN7FXxV!+GJx0;nkTrRQ;hzXBKkK)mFfg2-otQS~b> nEwKtB#I(nM;T;q4lnT5uU)U45iCer^cwV=0hb@0uPo1CNz9RZP literal 0 HcmV?d00001 diff --git a/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$7.class b/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$7.class new file mode 100644 index 0000000000000000000000000000000000000000..1743ab57220b4cf5260dfe2d8535efeeb7ef1837 GIT binary patch literal 1008 zcmbVKZEq4m5PlYr6M6zxt?zFw>WPVGObi+tKZrGH0@b9Z- zlC~y`C&nqGs^HY5={AaE{3fU{K; zQ4di;L!cP>gnCbD+M7)Vl)aaOlmym$CXwlZ%#`;R!IHm}Kxb7l%{E`^(uo?5$i1dR zIZIvMIvNVJqTavSyW`v4@q`6aeDI(70=4|e)3d6$j++5)2((w6O^92#EwIK?8urOr z77lkg+V#|``(~CU^hWtM)|bk9>?OsK9i61cDn06x8=GN>rk_JC$w)ft8qET7+~jaq zvyi%}w3aOH@bHSf&OkI8eugadBCiUn99?7UISTv&)z+gg2wUG!`@~)W=Y4Gc$5)TB z&VI->K6(KcdFPQ}V}bIFeUBoR#pQYOhk4<~0w^!^rI&GqzXDhPK)m9doXBT{jo>S; nEwOSUnrWNA@J@+%N;zJUFYJlj#U}41p4S%cvE?u8sq^z2)mQpt literal 0 HcmV?d00001 diff --git a/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$8.class b/com.samsung.linuxplatform.sensor.motion/bin/com/samsung/linuxplatform/sensor/motion/page/MotionPage$8.class new file mode 100644 index 0000000000000000000000000000000000000000..c14c6a3f4389f71b5976125bd503bc743c231c03 GIT binary patch literal 1008 zcmbVKZEq4m5Pp_JDD(uZTHoJM5fjgt7%?<{5Npx|s!2`1FLzVA&9RHOOX=S-@g?zt zKfoVloaLzaO~YOGc4lto*=J{-pTEBU0PqYC$|wlDjLkT*a%`u16s1Z}PbR5!2PWev zX=}1*Y@9MWn#d7FgSq{l&1R>JqCn$F9?K||T>Nf$M6oNQB+xS1D55x36HAeuxrmNQ zI~(m$$|;Q2SJsiHOrYcrm2Ey{BK;MabQxqzY2{uCY_(QKd9*K3?3sir5I7s6jI}BP z)I(Iz5C~d6q25=TcBkVZWgp})C4r5;iDkMkGv)n7u;?!(&|Q^Gv%{CVI8(`p+#5QO z)70gyqeP(H>i?^~+rHghPgpR;hyR%`P|J@zJ*$dqxKYM+ffp;zCd5tL5?E&`B?GdS zg~MHL?RaX{Ju}T>daHaJ>q})l@si@mwvJO{l^zYq9hxLW)6bz6XCxirK0E>NDc?@`3ExHM08^TN#qP+sUuFX1wO1+M&oc+ELEk3W*Ape&1ZC>6XiGxZSiO2>O!* zU%(Ik0DqJ?n@f$~l-#kmGjlV~K0EXL{Pq0@fQPtUMnRyRm~m|7*iQ8*PL-a%outz3 znT(^Pt;yoCamwg;B1aVWXZCA0o9!}+0*wQCDC1Oe@vFfBC9aH;KxDE}Oi8LHmSTJ4 zVmc)4Y`jA$r!ZPiSx1^Ofs)%-w)udG^p<4OVUSIwm3u0%87+-+cUPd;HAAXE;8ch* zPF4}19-@MVKoI$adQWM3IUNrudm{%a39R-^BGX-&DeupNMSm%Q&az~hZNAjGBQ+e6 zdro_Dn!3DoG!$q>y??cL%eTAZ2@9rp=RflWYWb1JXH{_-SIf8}@Oa7Dgt&(50xK+~ zVV|sJ;c%CuZBMPbW2RX`FO+X%eW9%TUQ!&{(n)Hp(xX1PeKQQv^mC{s8A(T7qggrK$%~2k)?@`2}xHLT2d4e;FT7(So>Gn%@P$2*b!_lnAXVqBc{^t%(}OiRZ2N)bSe}5PEF3KtrzPwhzGBXs$%08wGJ$71vnhd&0oU;Z z(+S4SLfML=T_AEq7l@s(9XohjV4{1tUjN-&@V~uC2Uan)T5->~Ky<*(TRK{>#ejj1 zHqb-^8sY+*hi%7Fc8{6U1xp(5=FGyl>Ddy8FQdVn?F$@hVqw!D(f_DT0|ibup;)Jr z!P&E(CUgv0abeGN&eoxJIUgT$hq; zdklOKdl{*c=~0is-eK39OlcbO}rm99sfe z0w!2EEfL3um%tRkN0vY~q2ZLk?#9>^%xB$lkUZogGb2)V@b` zoWrOz^htpe&1y$e9@-(jd&;Mf5j zV;I#ixdD!YIwmB?$2P!mNJmz3d}0F}hjm<(9L$0LJJ3gTT$UX94R9RQk&_&=8{l|M z$Bg8-vH^}`I&6&cfD}#JSuU0WTc&H3=2E^^jaZBXy4EaVVeJsu8m{tX{iu}>R?PZ$ ztRU32^oCVrlEn3RssU#k@FZ`nyXH6GEOBI(O7^U>wxO)BKyCG`S=lmpPg^<5p0_;S zSnWKV`4P+adExM0>rTtE@JWHewaY^NEg85ux3JV7jahz>skKTWp^h7PURH?bxB?Di^S9lTe{#@RNZQVU}1v8v4`Cc~gRlLHh*esQ}aRMw%jp|dY*M=7H zQoe~-4SZcHj0dhF*6~ezOT%kT(|UQ+|NBlD_%>c={A4uO@HVUC4ZNk{O@Vt>Og?ix zXO(1cY2drq#q=$)T@0AZxvOLBQJE911y))%Fe1(Vrs(qo53MI+>~@eZvy;b@pzFSI|GAz#}y##=J$FWxXjLMv zL`;b`B{U`Un&_|M+*I!(Mk+X;sA5cx$2r~^tztrgDG6Gu$V%{W3F1{;l;DyCu_`W0 zFfBn_6*&nk3A8F^B$$(c7TXeBC0Gf~0{bb4?b*Ki%}eLtU`Th!Ctl*^zzE;6E zCT<}VcZoOT{5DOV1c$fSUyoUoj8wvzt=M}W + + + + + + + + diff --git a/com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/Motion.java b/com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/Motion.java new file mode 100644 index 0000000..263e4a6 --- /dev/null +++ b/com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/Motion.java @@ -0,0 +1,13 @@ +package com.samsung.linuxplatform.sensor.motion; + +import com.samsung.linuxplatform.injector.provider.AbstractInjectorItem; +import com.samsung.linuxplatform.sensor.motion.page.MotionPage; + +public class Motion extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new MotionPage(this, "Motion")); + } + +} diff --git a/com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/page/MotionPage.java b/com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/page/MotionPage.java new file mode 100644 index 0000000..c6315f3 --- /dev/null +++ b/com.samsung.linuxplatform.sensor.motion/src/com/samsung/linuxplatform/sensor/motion/page/MotionPage.java @@ -0,0 +1,165 @@ +package com.samsung.linuxplatform.sensor.motion.page; + + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; + +import com.samsung.freshide.connection.device.DeviceChecker; +import com.samsung.freshide.connection.device.IDeviceListener; +import com.samsung.linuxplatform.injector.protocol.sensor.TestSensorMessage; +import com.samsung.linuxplatform.injector.provider.AbstractInjectorItem; +import com.samsung.linuxplatform.injector.provider.AbstractInjectorPage; + +public class MotionPage extends AbstractInjectorPage implements IDeviceListener { + private final String sensorNumber = "6\n"; + + public MotionPage(AbstractInjectorItem item, String name) { + super(item, name); + } + + @Override + protected void createContents() { + Composite mainComposite = formUtil.createComposite(parent, 3); + + Button button_doubleTap = formUtil.createButton(mainComposite, "Double Tap", SWT.PUSH); + Button button_shakeStart = formUtil.createButton(mainComposite, "Shake Start", SWT.PUSH); + Button button_shakeEnd = formUtil.createButton(mainComposite, "Shake End", SWT.PUSH); + Button button_snapXp = formUtil.createButton(mainComposite, "Snap X+", SWT.PUSH); + Button button_snapYp = formUtil.createButton(mainComposite, "Snap Y+", SWT.PUSH); + Button button_snapZp = formUtil.createButton(mainComposite, "Snap Z+", SWT.PUSH); + Button button_snapXm = formUtil.createButton(mainComposite, "Snap X-", SWT.PUSH); + Button button_snapYm = formUtil.createButton(mainComposite, "Snap Y-", SWT.PUSH); + Button button_snapZm = formUtil.createButton(mainComposite, "Snap Z-", SWT.PUSH); + + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false); + + button_doubleTap.setLayoutData(gd); + button_shakeStart.setLayoutData(gd); + button_shakeEnd.setLayoutData(gd); + button_snapXp.setLayoutData(gd); + button_snapXm.setLayoutData(gd); + button_snapYp.setLayoutData(gd); + button_snapYm.setLayoutData(gd); + button_snapZp.setLayoutData(gd); + button_snapZm.setLayoutData(gd); + + button_doubleTap.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(1); + } + }); + button_shakeStart.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(2); + } + }); + button_shakeEnd.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(3); + } + }); + button_snapXp.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(4); + } + }); + button_snapXm.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(5); + } + }); + button_snapYp.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(6); + } + }); + button_snapYm.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(7); + } + }); + button_snapZp.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(8); + } + }); + button_snapZm.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(9); + } + }); + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + public void sendMessage(int level) { + TestSensorMessage msg = new TestSensorMessage(level); + try { + sensorSocket.send(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + + @Override + protected void finalize() throws Throwable { +// DeviceLauncherManager.removeDeviceListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void ConnectionChanged() { + if (DeviceChecker.hasActiveVirtualDevice( null)) { +// connect(); + } + else { +// disconnect(); + } + } + +} -- 2.7.4