Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#23 fix for autoBonds and $HOME/.jmol/properties

closed
nobody
None
5
2009-04-14
2009-04-13
pim
No

autoBonds were not written away correctly to the jmol configuration file, nor did the autoBond=false show up correctly in the properties menu.

This simple fix corrects both of these issues.

Index: src/org/openscience/jmol/app/PreferencesDialog.java

--- src/org/openscience/jmol/app/PreferencesDialog.java (revision 10803)
+++ src/org/openscience/jmol/app/PreferencesDialog.java (working copy)
@@ -344,6 +344,7 @@
c.weightx = 1.0;
c.weighty = 1.0;

+ // Automatic calculation of bonds upon molecule load
JPanel autobondPanel = new JPanel();
autobondPanel.setLayout(new BoxLayout(autobondPanel, BoxLayout.Y_AXIS));
autobondPanel.setBorder(new TitledBorder(GT._("Compute Bonds")));
@@ -359,14 +360,17 @@
abYes.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {
- viewer.setBooleanProperty("autoBond", true);
+ viewer.setBooleanProperty("autoBond", true);
+ currentProperties.put("autoBond", "" + "true");
}
});

+ abNo.setSelected(!viewer.getAutoBond());
abNo.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {
viewer.setBooleanProperty("autoBond", false);
+ currentProperties.put("autoBond", "" + "false");
}
});

Discussion

  • pim
    pim
    2009-04-13

    patch fixing behavior of autoBonds and $HOME/.jmol/properties

     
    Attachments
  • pim
    pim
    2009-04-14

    Note: changes in the autoBond parameter are currently (and in all versions before) only in effect on the next molecule that is loaded, not on currently loaded molecule. Is it at all possible to calculate bonds after loading, or to dump existing bonds? And if so, would it be desired to add that functionality.

     
  • Angel Herraez
    Angel Herraez
    2009-04-14

    According to the doc, "connect" by itself will delete all bonds and recalculate them using Jmol's algorithm (no bonds are retained from the file). All new bonds are single.
    To dump (delete) existing bonds, you can also use "connect" but with the "delete" argument.

     
  • pim
    pim
    2009-04-14

    The above patch is commited to svn by myself.

     
  • pim
    pim
    2009-04-14

    • status: open --> closed