Package chemaxon.marvin.modules.reaction
Class ReactionEditUtils
java.lang.Object
chemaxon.marvin.paint.reaction.ReactionUtils
chemaxon.marvin.modules.reaction.ReactionEditUtils
Extends
ReactionUtils
with some additional methods.-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areArrowsAndLikelyTheSame
(MPolyline arrow1, MPolyline arrow2) Compares type and checks perfect equality of location.static Molecule
fixReaction
(Molecule mol, boolean autoFragment, chemaxon.marvin.sketch.MolEditor editor) Fixes a possibly broken reaction.static void
initOldDocuments
(MDocument document, boolean isAutomatic) Adds plus signs to a document if it is potentially an old reaction.Methods inherited from class chemaxon.marvin.paint.reaction.ReactionUtils
fixReaction, fixReaction, getReactionArrows, prepareForJoin, reactionArrowCount, rebuildReaction
-
Method Details
-
fixReaction
public static Molecule fixReaction(Molecule mol, boolean autoFragment, chemaxon.marvin.sketch.MolEditor editor) Fixes a possibly broken reaction.If the molecule model is a single-, multi-, or no-step reaction (reaction arrow has just been deleted), it is converted to a non-reaction.
If the molecule model is not a reaction, but there is exactly one arrow, it is converted to a reaction.
The main molecule graph of the molecule’s parent documet will be set to the new molecule.
- Parameters:
mol
- The molecule to be fixed; must have a parent document.autoFragment
- Indicates that automatic reaction calculation is set to on.editor
- Contains GUI information to calculate ReactionPlusSign.- Returns:
- The converted molecule or the original molecule if no modification happened.
-
areArrowsAndLikelyTheSame
Compares type and checks perfect equality of location.- Returns:
- True if conditions are met.
-
initOldDocuments
Adds plus signs to a document if it is potentially an old reaction.A document is potentially an old reaction if there are multiple components on either side of the reaction, but there are no calculated
MReactionSign
objects.- Parameters:
document
- The document to be fixed.isAutomatic
- Indicates if the automatic reaction calculations are set to on.
-