-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A couple of minor improvements #96
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ | |
import org.RDKit.DrawColour; | ||
import org.RDKit.Int_Vect; | ||
import org.RDKit.MolDraw2DSVG; | ||
import org.RDKit.MolDrawOptions; | ||
import org.RDKit.ROMol; | ||
import org.knime.base.data.xml.SvgCell; | ||
import org.knime.base.data.xml.SvgCellFactory; | ||
|
@@ -417,6 +418,8 @@ public DataCell[] process(final InputDataInfo[] arrInputDataInfo, final DataRow | |
} | ||
|
||
final MolDraw2DSVG molDrawing = markForCleanup(new MolDraw2DSVG(300, 300), lUniqueWaveId); | ||
MolDrawOptions opts = molDrawing.drawOptions(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this also be wrapped in markForCleanup(..., lUniqueWaveId) ? There is a chance that it gets cleaned up with its parent object MolDraw2DSVG, but if in doubt (and I usually am, because you cannot look into that type of code) I would always call the delete() function at the end. The cleanup code handles it properly, if marked for cleanup. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question, but that object doesn't own any memory of its own... it's just a reference to memory that the MolDraw2DSVG owns, so it should not cause a leak. |
||
opts.setAddStereoAnnotation(true); | ||
molDrawing.drawMolecule(mol, "", ivAtoms, ivBonds, mapRdkitAtomColors, mapRdkitBondColors); | ||
molDrawing.finishDrawing(); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ | |
import java.lang.reflect.Field; | ||
import java.lang.reflect.Method; | ||
|
||
import org.RDKit.RDKFuncs; | ||
import org.eclipse.core.runtime.IConfigurationElement; | ||
import org.eclipse.core.runtime.IExtension; | ||
import org.eclipse.core.runtime.IExtensionPoint; | ||
|
@@ -137,7 +138,7 @@ public ImageData getImageData() { | |
|
||
// We use the pref store of the UI plugin | ||
setPreferenceStore(RDKitNodePlugin.getDefault().getPreferenceStore()); | ||
setDescription("This section contains sub sections to control preferences for RDKit Nodes."); | ||
setDescription("This section contains sub sections to control preferences for the RDKit Nodes.\nThe nodes are using version "+RDKFuncs.getRdkitVersion()+" of the RDKit backend."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very nice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I think this will be quite useful |
||
} | ||
|
||
/** {@inheritDoc} */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you merge this as planned with the RDKit binaries changes, you may just increment the version number together with the binaries change as discussed there. All version numbers should be in sync at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, these changes were made as part of the RDKit binaries merge, so they are in sync now