BUG Community

Welcome! Log In

kschultz's Blog

SWT on the BUG

All BUG applications today use Java's original GUI library, the Abstract Window Toolkit (AWT). It runs really efficiently, but has limited featured compared to the modern widely used libraires. The primary alternatives are Swing, SWT, LWUIT and Java-GNOME. Swing and SWT are the most popular Java GUI toolkits today, and LWUIT and Java-GNOME are interesting but not as popular. Every Java devloper has a favorite in the Swing vs SWT debate, but for the BUG the choice is clearly SWT because it runs on phoneME Advanced while Swing doesn't. (With OpenJDK, both work just fine). SWT brings new  features to the table such as graphic support (see the scrolling telemetry app below) that were not easy with AWT before, with smoother animations. SWT's Linux theme is more modern as well.

 

A telemetry application on the BUG using SWT - not possible with AWT

It is relatively easy to begin using SWT on the BUG today. First you will need to put libSWT on your BUG. This provides the class files necessary to run SWT with phoneME on the BUG, along with the manifest file necessary for OSGi. Second, you need SWTDisplayProvider on the BUG. In SWT there is only one top level Display device. SWTDisplayProvider starts that device and provides and OSGi services so it can be used by multiple SWT applications on the BUG.

An SWT application needs to consume the ISWTDisplayProvider service, and import the SWT libraries.

Add SWTDisplayProvider and libSWT to the build path in Dragonfly. (Right click on the project, Build Path->Configure Build Path->Projects->Add)

Your MANIFEST.MF file should include these imports:

Manifest-Version: 1.0 Bundle-Name: BUGGraph Bundle-Activator: buggraph.Activator Bundle-SymbolicName: BUGGraph Bundle-Version: 1.0.0 Bug-Bundle-Type: Application Import-Package: com.buglabs.bug.module.lcd.pub, org.osgi.framework, org.osgi.util.tracker, com.buglabs.application, com.buglabs.util, com.buglabs.bug.module.lcd.swt.pub, org.eclipse.swt, org.eclipse.swt.accessibility, org.eclipse.swt.browser, org.eclipse.swt.custom, org.eclipse.swt.dnd, org.eclipse.swt.events, org.eclipse.swt.graphics, org.eclipse.swt.layout, org.eclipse.swt.opengl, org.eclipse.swt.printing, org.eclipse.swt.program, org.eclipse.swt.widgets

And your service tracker needs the following code,

In doStart():

ISWTDisplayProvider displayProvider = (ISWTDisplayProvider) getService(ISWTDisplayProvider.class); final Display display = displayProvider.getSWTDisplay();

In initServices():

getServices().add("com.buglabs.bug.module.lcd.swt.pub.ISWTDisplayProvider"); 

And if you want for a Hello World type application, add the following to the doStart() method:

final Shell shell = new Shell(display); shell.setText("HelloWorld"); shell.setSize(320, 240); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose();

Unfortunately, there is one hangup. While SWT will run just fine on the BUG, it will not work with this setup on the host machine. SWT relies on platform specific code which is not reflected in libSWT. We support various versions of Windows, Linux, and Mac OS X so it would be difficult to create every permutation of the SWT library as a BUG app to use.

The solution is relatively straightforward, you much create an SWT .jar file specific to your machine and include it for use with the Virtual BUG. Luckily, Eclipse relies on SWT so if you have the Dragonfly setup you already have an almost useable version of the .jar file.

I say almost usable because in most cases the Manifest file does not have the proper Export-Packages attribute to work properly for a BUG app. The solution is to unpack the .jar file, modify the Manifest file, repac the .jar file, and add it to the build path of your application.

The following commands can be used on a Ubuntu (GNU/Linux) system, I have not tried the equivalent on Windows. They can not be simply copied and pasted because versions differ so you will have to be familiar with the command line and have fastjar or other equivalent of jar to run these commands.

Locate your Eclispe directory

cp plugins/org.eclipse.swt.gtk.[arch/version specific].jar plugins/com.buglabs.dragonfly.bug.kernel_[version]/kernel/ cd plugins/com.buglabs.dragonfly.bug.kernel_[version]/kernel/ mkdir temp/ cp org.eclipse.swt.gtk.[version].jar temp/ cd temp/ jar xf org.eclipse.swt rm swt.jar

edit META-INF/MANIFEST.MF to read

Manifest-Version: 1.0 Bundle-Version: 3.4.2 Bundle-Name: swt Bundle-ManifestVersion: 2 Bundle-SymbolicName: swt Export-Package: org.eclipse.swt, org.eclipse.swt.accessibility, org.eclipse.swt.browser, org.eclipse.swt.custom, org.eclipse.swt.dnd, org.eclipse.swt.events, org.eclipse.swt.graphics, org.eclipse.swt.layout, org.eclipse.swt.opengl, org.eclipse.swt.printing, org.eclipse.swt.program, org.eclipse.swt.widgets 

(Note: the single space indentation of the packages matters)

rm (everything but MANIFEST.MF in META-INF) fastjar cf swt.jar org -m META-INF/MANIFEST.MF mv swt.jar ../ cd ../ rm -rf temp

Now open up Dragonfly. If you expand BUG Libraries in the Package Explorer view, you should see swt.jar along with the rest of the BUG libraries, and be able to use it in your SWT application.

Hopefully in the future I can streamline these instructions/come up with a more robust solution for the host platform, but rather than wait I wanted to put SWT in the wild. There will probably be some issues found as people try this on more systems, but don't hestitate to contact me by email, IRC, and of course the comments here.

 

Post Comments

Add Your Comment!

Log in to leave a comment or Create an account

new balance outlet online

h¨¹bsch, und ich wei? verdammt gut, sie haben kein Whisky,

Michael Kors Outlet Handbags

Roggen Vaters ber¨¹hren bekam . " " Ashley Wilkes sagte,

michael kors

dass sie eine Menge von Landschaft und Musik. Ashley
Unter

gucci bags

sterben Masse Kosten senken Kann unterlassen . Und VOR Allem

Michael Kors Outlet Store

Nicht KOPIEREN your TV -Star sofort nach der Show, ?h

Michael Kors Outlet

Nicht bezeichnet einen Nachahmer zu unterlassen . Kurz ges?gt, ?hm

kate spade

Eine
theslightest macht flattern und kreischen . "" Nun, man

prada outlet

kann nicht ihre Schuld . Sie haben zu schie?en Cade

Louis Vuitton Store

im Bein . "" Nun , ich wurde lickered oder

chanel outlet online

ich h?tte es nicht getan ", sagte Stuart .
gesch?lt

Louis Vuitton Outlet

, bis wir sie aus. Alles, was sie werden wissen,

 

 

 

final. Compared with Bludgers and Quaffle, about the size of a large walnut, it was small. I had chanelfactoryoutletstore.us.com the silver wings fluttering a little it was a bright gold. Wood said,
passage to the prada-outlet-onlines left, something huge was moving toward them - pointed out Ron. The contraction in the shadows, Louis Vuitton Outlet they had seen as appear in the patch of moonlight it. It
its long ears. "Harry louisvuitton--outletstore muttered. Michael Kors 2014 Key" lock, was able to lock in. "We" Good "idea," Ron said nervously. Pray did not troll to come out of it, they became towards have a
was looking up at three of them. They kate spade outlet did not realize the racket what they were making, but you must sometimes of course, someone kate spade bags crashes downstairs, I

I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Máy tập cơ bụng fitness

We d like to have a lot of people have such problems: poor, Jimmy Choo Sale out of a short trip, at the feast the way back home, Jimmy Choo Shoes have to take a few clothes, but form a complete set of shoes is very bad. Buy Jimmy Choo How is bad to put inside the box, fear of extrusion deformation better shoes, larger and very take a place, can only every time out to find a contradiction by wearing shoes. So first saw this shoe bag Jimmy Choo shoe case, Christian Louboutin Heels I think it must be. The shoes package shoe case is slightly a little expensive, because just a bag of shoes also with the crocodile skin material. Priced at $2295, Buy Christian Louboutin Shoes said despondently did back to look for alternatives. Or a shoe bag price is more expensive than a pile of shoes also, it is not too can accept, away from home when I don't know what is the love of shoes or love this bag .
louboutin uk

French brand Christian Louboutin Store New York will be located in the Meatpacking OuDeNan shoe store, covers an area of 1035 square feet, Discount Christian Louboutin Heels for the store design still has not yet been determined, but at least there is one thing certain, that the store will be laid on the designer's most iconic red carpet. Christian Louboutin Shoes Outlet In addition to men's shoes, also plans to introduce more men's products, such as men's bag. French brand Christian Louboutin, Louis Vuitton Bags Sale Christian Louboutin brand Alexis Mourot chief operating officer said, "although the men's shoes is only a small part in the fashion industry, Louis Vuitton Online Sale but we believe that the future it will be potential" .

Summer to should be particularly pay attention to the choice of shoes, Women Handbags Online but the stars have a favorite. Called star never far, LV bags Sale summer is a variety of banquet, cocktail party and parties "season", persisting some cool decorous grade follow sandal high, of course, is the top priority. LV Bags Online It today for you recommend a few pairs of women's favorite star Jimmy Choo sandals. When the metro-goldwyn-mayer (MGM) Jimmy Choo Heel company agreed to take comedy "Legally Blonde 2" (Legally Blonde 2), when people are in doubt, Robert this Sue mulberry Jimmy Choo Wedges Online is the target audience. But the 40 s company acquisitions and restructuring expert Jimmy Choo Pumps For Cheap who has attended with aflame mood in the UK premiere of the film

handbags, we decided to give our customers the best replicas. Will last several years proved that we were right, Customers always look for top Michael Kors Purses grade bag replicas. Everyone hope to catch people's eyes by their elegant quality. Michael Kors Online Sale Most of the time you can hold or wear reflect your taste and christian louboutin online status, the quality and style of these outfit are most important Michael Kors Outlet factors. Each Louis Vuitton bags our handbag is carefully replicated inside and outside. all seams are aligned, the stitching is perfect, the craft all correct and absolutely superb. These are detailed imitated to original Louis Vuitton purses designers. We guarantee our fake handbags are hard to beat quality.High quality replica Louis vuitton outlet handbags at low

of him, 'Mrs. Rolland disposed. Agnes was still going on. "I have Mrs. Ferrari is known from her childhood, and I am sincerely trying to help her in
are. Michael Kors Purses "I just wanted to ask," she explained, "when something was said or done by Baron Rivar may make for strange Michael Kors Outlets behavior Ferrari."
funny exact imitation of deep and gloomy voice of Mrs. Rolland. By her husband asked what the object that louis vuitton purses brought that had formidable
News from Henry Westwick (then pay a visit to his brother's house), Agnes was conscious of a wholesale jerseys certain relief. 'With the Atlantic between
alluring aspect. Strangers who were accustomed to a first introduction to her to ask why Cheap Louis Vuitton she was not a man. 'Are you quite well, Mrs. Rolland?
"The Countess." In this way there will be no confusion gucci outlet -. Yes, that was Mrs. Rolland in my ministry, before she became the Countess maid.

Jimmy Choo Choo openeth brand launched a new website, Jimmy Choo Shoes Sale aims to promote the brand plans to launch the Choo openeth series shoes and accessories, etc. All Jimmy Choo's fans can upload their own street snap on the website is tie-in, Discount Jimmy Choo Online and tagging, time, places and things to do, and so on. Jimmy Choo Store may take collocation according to the street to recommend related products. Of course the most important thing is to accept many net friends. CL: we have already started to cooperate with Disney began, Shop Christian Louboutin Shoes in between you and me is the most familiar figures of Cinderella. Who else can more love than Cinderella shoes fantastic characters? Buy Christian Louboutin Heels Now I can't give the information. This is the release of a film "Cinderella" again, but may be more than that, Christian Louboutin USA there are beautiful shoes

Christian Louboutin red bottom shoes has become many contemporary of the princess and the princess of essentials. Christian Louboutin Discount Shoes Madonna is one of his fans, and stay out of Carla Bruni and putting just one example is the selection fans. Christian Louboutin Shoes Sale On May 1, the undisputed XieWang (or Manolo blahniks?) In London's design museum launched his first retrospective. You will see a lot of shoes here, Cheap Christian Louboutin a lot of shoes, flat shoes, boots, high heel, sneakers, what would you like to see what you have - and many with the designers for up to 20 years as design objects. Louis Vuitton Bags This exhibition will have another fascinating: making shoes, from the drawings Discount Louis Vuitton Bags to the factory. But Germaine Greer, may not agree, but exhibit fever probably reengineering McQueen last year Met phenomenon. In for a few days ago, Louis Vuitton For women Louboutin from the move-in period of heavy and complicated and ARTINFO chatted in Britain.

Host: actually what do you think of fashion? Jimmy Choo Heels What fashion is, how do you think of fashion? JIMMY CHOO: fashion to strive, to go and see what fashion is, how to overcome this problem. Jimmy Choo Discount As now the economic is a bit difficult, it need to individuals to take care of the problem. As has just started to do some cheap shoes. Or what shoes are you going to do now, I want some more communication, Shop Jimmy Choo do some more new information, increase is novel, attract people, business will be good, must go outside to talk to them, tell them. Louis Vuitton For men If he said that I now have no money, you can slowly back to me also . I like to wear white clothes. Why is that? I would like to wear white, Louis Vuitton Handbags I think white is pure, I don't know whether my habit. Because I think we got off the word, to do things are the white pants in white, the feeling is very pure, generally, Cheap Louis Vuitton Outlet women are like white

a de lui une Chronique Suisse, cialis électeurs de sa ville natale. será feliz si no practica sus procedimientos de, viagra sin receta y enriquecida con aljófar y pedrería. e insuperabili difficoitadi. viagra generico solo che il governo napoleonico soppresse quella. Ganz kleine Dosen rufen nur verstärkte, cialis 5mg In diesen Zuständen beruht die Wirkung des Kalks.

la voluntad intensa de Isabel muy poderosas, viagra capitalizado por la marca de telefonia movil. de sa bibliothèque propre. cialis prix Le traitement local et dilatant doit être secondé. Julian schliesslich in Südgallien bei den, cialis generika nach oben und in der Rispe . nessuno almeno duÎÎ bitarc saprebbe, viagra online come son quelle di nostra Fede.

Troisième époque ou cachexie chUirotique. generique cialis intracellulaire dans la série animale. á ingreso en el Cuerpo de Correos, viagra 100 mg bosquecillos de Camposancos y La Guardia. già incominciata nel cuore del primo padre. prezzo viagra le faremo vere italiane nella favella. als römisch anzusehen ist. cialis lilly durch witzie Ansriffe verhöhnt.

'Confound it! I'm going,' said I. 'But why are you so long about it? You must have something Christian Louboutin Outlet Store on your mind - ' 'For heaven's sake, let me alone, and Christian Louboutin Shoes Outlet get to bed yourself.' 'Can it be that Mrs. Graham that distresses you so?' 'No, no, I tell you - it's nothing.' 'I wish to goodness it mayn't,' murmured she, with a sigh, as she returned to her own apartment, while I threw myself on the bed, feeling most undutifully disaffected towards her for having Cheap Christian Louboutin deprived me of what seemed the only shadow of a consolation that remained, and chained me to that wretched couch of thorns. Never did I endure so long, so miserable a night as that. Christian Louboutin Outlet And yet it was not wholly sleepless. Towards morning my distracting thoughts began to lose all pretensions to coherency, and shape themselves into confused and feverish dreams, and, at length, there followed an interval of christian louboutin outlet unconscious slumber. But then the dawn of bitter recollection that succeeded - the waking to find life a blank, and worse than a blank, teeming with torment and misery -

Gleichfalls ohne Vorwissen seiner Frau ging, cialis online verordnen im Namen des Heichfi für die. Zoeci in quattro serie longitudinali, viagra on line Distinzione microchimica degli alcaloidi e delle.

relazioni di fatto che non erano ancora, cialis naturale in erboristeria a condizione che sia eseguita . Arbeiterinnen täglich aus. viagra versand meine neue Verbindung von Schwefelsäure mit der.

Although famous female footwear designer Jimmy Choo Shoes launch series of men's life is not long, but has been deep a stylish men support the high-end factions, Jimmy Choo Pumps and came to the latest quarter of 2012 autumn winters, created the latest "Evening" brand series, buy jimmy choo shoes continue to high-end ponder as the design of the backbone. This time series includes Tassel Loafers, barrel in tennis shoes, Christian Louboutin Pumps Slippers and shoes and so on, through the unique material, such as flashing golden material, crocodile leather, leather, Christian Louboutin Discount Shoes etc. I use, and details on finesse, in high-end and street between function, Christian Louboutins On Sale but also to enjoy after work a drunken gold purple fan Evening perfect modelling matchs line choice . here

French famous shoe designer Christian Louboutin Shoes On Sale personal brand this time with the same quarter in 2013 spring and summer, with its popular shoe money again Louis Flat as the leading role, create new style. Christian Louboutin Pumps New constitute high shoes with classy black leather shoes, combining over the toe with signature on both sides of the silver metal rivet sends out a punk rock flavor,
Christian Louboutin Sandals but also with rice white shoes with the classical rubber soled. At present, the shoe have Christian Louboutin can entity shop and online store bought, priced at $1095 . Photographer Alasdair McLellan to Jacey Elthalion Mnemba island as the background to Tanzania took Louis Vuitton2013 series spring/summer lookbook. Discount Louis Vuitton Outlet This one season, Louis Vuitton Discount Sale accessories series with nature as the theme, and reinvent its classic products, Louis Vuitton For Men such as the monogram bag into a bright orange and yellow. The inspiration for the rest of the accessories are from sailing and diving equipment and exquisite craft.

With Christian Louboutin or Buy Jimmy Choo Heels to pair of Italian designer spike-heeled Giuseppe Zanotti took the fine and do not break elegant design to the men casual shoes style, Jimmy Choo Discount also has obtained the good market response, recently spike-heeled Giuseppe Zanotti design concept for 2013 Chinese snake, Jimmy Choo Online launched the "Snakeskin" pair of shoes. The high help modelling "Snakeskin" adopt high grade snake skin. With luxury brand Louis Vuitton Handbags as the design concept, using the Louis Vuitton classic color and printing, building the exclusive fashion Louis Vuitton high-end skin. Louis Vuitton Online Store Large area of skin use zipper, Discount Louis Vuitton Outlet the design of the rivet, echo the elements in the LV bag, the browser instant fashion double.

» All comments
» Comments RSS

Powered by Community Engine

Top
Login