Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Wednesday, January 21, 2009

Open file from AIR using Merapi bridge

When I finished with vista style experiment I was thinking what if merapi could help to open files from AIR application. On the screen cast below I will show AIR application which could open MS Office file:


Before run my AIR application I needed to start java bridge (java project from Eclipse). I decided to zip all needed libraries into one runnable JAR file and run it from BAT file. But I still wanted to make one runnable file to start java bridge and AIR application together. One day, browsing on Merapi forum I found entry with solution to my problem. Using NSIS installer author has been built exe file.
The Bridge class from the Merapi library has a method called systemExecute with one string parameter Path. I tried to use this method with path to notepad.exe file, but in the result I had an error on Java side. I think this method was added to implement such feature as executing files from AIR application. Will check with new version of the Merapi library.

Update: Source code for Java project and for AIR project. In the java archive you could find runnable .jar and .bat files.

Tuesday, January 20, 2009

Experiment: Fake Transparency

Recently, I have tried to make window for AIR application in vista-style . I mean, transparent window and blur effect applied on it.


I realized that I can make transparent AIR window and apply blur effect on it, but all objects on this window will be blurred as well. After some research, I understood that it is impossible to implement such feature like window in vista-style with AIR 1.5. Then I decided to try to make a desktop screenshot, copy area under the window and apply it to the backgroundImage property. But there was another problem, AIR 1.5 could not do a screenshot. So I decided to postpone this experiment to next version of AIR.

But some days ago, on the everythingflex blog I found post about Java bridge to AIR application called Merapi. Using this bridge, AIR application could do a screen shot. I decided to a bit amend sample in that post. The result of my experiment is below:



Original size.

Update: Source code for AIR application is available here.