Marvin Beans requires at least Java 1.6.
The rotation and the linkage to the sketcher have negligible contribution to the memory footprint. The largest contributions are from
Even if we provided a "thin" panel without 3D support, it would only enable you to use about twice as many molecules. Then you would run out of memory again because of the double buffering.
The solution is to use only one n-molecule scrollable MViewPane instead of a JTable with n MViewPanes. Then the common data will be stored in only one place (instead of n) and the number of Swing components will be equal to the number of visible molecules which is usually much smaller than n.
I have this problem when I want to get a Molecule from MViewPane:
viewPane.getM(0) returns null although I put a molecule in 0. Here is my code:
The problem is that you called
getM(0)too early. The molecule was not loaded yet, since
MViewPane.setM(int,String)launches a new thread for loading a molecule and the
getM(0)method does not wait until this thread is finished. Thus, there is no guaranty that the molecule loading process is finished until the method returns. This method is generally used in case of loading a huge set of molecules in the same time. If you use debug option:
viewPane.setDebug(2), you can see when the molecule is loaded. Instead of
setM(int, java.io.File, java.lang.String)method. Using this method will cause
setMto wait until molecule loading is finished.
This example shows a similar problem:
In this case, there are several ways to avoid this problem. For example, you can use
MViewPane.setM(int, Molecule) method:
The MarvinPanel.setParams(String) method is used to set parameters when MarvinPane is initialized (before loading the molecule). You should avoid calling this method after setMol(..) or any other property-setting method. You can find more details about it at here.
The difference between a parameter and a property that you can modify a property's value after initialization, while a parameter can only be set once.
-Djava.awt.headless=true option to your Java command. E.g.: