Hi all,


We have been using the Jmol applet for some time now. So far we have been able to make great use of Jmol Script to help integrate the applet with our web design e.g. change the background colour.


One small design improvement that would certainly help to integrate it further would be to specify round corners. Since our site makes great use of round corners I was hoping, with some luck, that I could create this effect in Jmol.


This might be considered a small aesthetic improvement and not something people would consider particular useful. Therefore I will be happy to attempt this myself but I hope you don't mind if I ask a few questions first.


My initial idea was to simply include four permanent polygons which would match the background colour of the web page. The simplest solution would be to simply included four General Paths in each corner, for the example the top left corner could use this:

Graphics2D g2 = (Graphics2D) g;

GeneralPath filledPolygon = new GeneralPath();

filledPolygon.moveTo(0, 0);

filledPolygon.lineTo(0, 50);

filledPolygon.curveTo(0, 50, 0, 0, 50, 0);

filledPolygon.lineTo(0, 0);





After poking around in the Source code it looks like making use of the Graphics2D class could be considered a problem. Instead I might need to implement some functions to draw Bézier curves in the org.jmol.g3d package.


The next question is where this should all sit? Is the Jmol class a good place to start adding shapes to the screen or should this really be inside the Viewer class?


I am not sure how useful this is to other people but I imagine having the ability to specify the radius, colour and presence for all four round corners via Jmol Script would certainly be a useful feature. For the moment though I am just interested in getting the shapes to display.