Saturday, September 08, 2007

Widgets in MeTA Studio

Using the MeTA Studio and Java APIs, RK came up with some cool simple widgets (http://chem.unipune.ernet.in/~tcg/members/ritwik.html)

For those of you who had gone through the widgets/ directory in MeTA Studio, you will already have an idea of how to create your own widgets. I give a small description using RKs, Flakes Widget (http://chem.unipune.ernet.in/~tcg/codes/flakes.bsh)

1. Each Widget should have a unique file and function name in a given MeTA Studio installation. In this case it is flakes.bsh and the function name is flakes().

2. The first thing done by the widgets function is to get a shared instance of widgets panel:
panel = getWidgetsPanel();

3. Next a widget is created with a unique string identifier for the widget:
flakes = widget("flakesWidget");

4. Now "flakes" is a panel (just like javax.swing.JPanel) to with components can be added.

5. At the end give a call to :
panel.addWidget(flakes);

is made to finally add the widget to the panel.

6. Finally at the end of this file you give a call to the flakes function:
flakes();


and well here are some cool screen shots taken directly RK's page:

Flakes:


and Plane angles:



Note: There will not be any updates to MeTA Studio in coming 2 weeks ...

No comments: