One more comment to this: If it is illegal to create a model before component is paintet, Jmol should throw an exception when you attempt to do so. In the current implementation (version 11.8.12) it simply freezes.
Tomas On Dec 11, 2009, at 12:33 PM, Tomas Pluskal wrote: > Dear Robert, > > Thank you for the reply. I understand that I can call > viewer.loadInline() after the component is constructed... However, I > don't like this :) > I would like to design a component (JComponent), which takes a > structure (as String) in a constructor parameter and shows the > structure in 3D. > > JComponent threeDcomponent = new MyThreeDComponent(myStructure); > > In Swing, I think this is a common approach. For example: > > JComponent labelComponent = new JLabel(myText); > > or > > JComponent tableComponent = new JTable(myData, columnNames); > > However, with Jmol 11.8 designing such component is impossible. > I will always have to write > > JComponent threeDcomponent = new MyThreeDComponent(); > ((MyThreeDComponent ) threeDcomponent).loadStructure(myStructure); > > So, even though this is not a huge problem, I believe it should be > changed. > Or is there any practical reason why model should not be created > before the component is shown? > > Best, > > Tomas > =============================================== Tomas Pluskal G0 Cell Unit, Okinawa Institute of Science and Technology 12-22 Suzaki, Uruma-shi, Okinawa 904-2234, JAPAN TEL: +81-98-921-3966 ------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev _______________________________________________ Jmol-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-developers
