Rajarshi,

> I've attached the code.
>
> To run: java -cp ./:./Jmol.jar molview *.xyz

Very nice! ... code is small and easy to understand.

I made one small change ... to cut down on dynamic memory allocation.

But, it was code that you cloned from my Integration.java code, so the
problem was actually mine, not yours :-)

With as of Java 1.2, one can pass a Dimension to getSize. This is
generally better because it reuses the old Dimension rather than
allocating a new one each time.

  final Dimension currentSize = new Dimension();

  public void paint(Graphics g) {
    viewer.setScreenDimension(getSize(currentSize));
    Rectangle rectClip = new Rectangle();
    g.getClipBounds(rectClip);
    viewer.renderScreenImage(g, currentSize, rectClip);
  }


One enhancement that you may want to consider (if you have some spare
time) ... change the cell height dynamically so that the JmolApplet is
always square. You would have to add some type of Listener to tell when
the column width changes, then change the height to be the same.


Miguel



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to