Skip to content
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

Alt input mode (ring sprout, bond sprout, kekule/tautomer shifting) #199

Open
wants to merge 103 commits into
base: master
Choose a base branch
from

Conversation

johnmay
Copy link
Contributor

@johnmay johnmay commented Jan 23, 2025

This adds an alternative input mode (alt key held) and changes the sprouting of rings on attached atoms. Spiro rings are incredibly rare and it is better to default to non-spiro (as shown in the video). If you really want a spiro you can hold down alt. This mirrors ChemDraw behaviour. In the case of adding Phenyl the valences would never be correct anyways :-)

JCP-alt-ring-mode.mov

RvdPloeg and others added 30 commits December 13, 2024 09:42
cdk-2.9 uses an IRGroup interface and cdk-2.0 not. To accept the IRGroup interface modifications were necessary.
update for jna.inchi
upgrade to cdk-2.9 and modification IRGroup no target
…cdk-2.10-wip

* 'cdk-2.10-wip' of github.com:JChemPaint/jchempaint:
  Update JNIInChIHandler.java
  Update .gitignore and remove ignored files from tracking
  add gitignore and *.class
  removed all target directories
  remove core/target directory
  upgrade to cdk-2.9 and modification IRGroup
…ping of min/max zoom was not done correctly.
…e here is be need a new AtomBondSet which is used for undo/redo and allows dangling bonds.
…ObjectSelection.getConnectedAtomContainer() returning dangling bonds.
…ing some "control points" on selected parts.
…ction to be combined with an existing selection.
…(if shift is pressed). Also change the mouse to correct cursor type if we are over a selection control point.
…d render rectangles like this since then the underlying graphics API can decide how to round coords (if at all)
…ting the cursor making sure atoms are correctly updated and mouseDrag modifiers.
…n we remove parts (or undo an add). If the highlighted atom is active move it to be valid.
…move the highlighted atom/bond with arrow keys.
…Generator. This can't be a .properties option as the current setup creates these before reading but perhaps could be in future.
@johnmay
Copy link
Contributor Author

johnmay commented Jan 30, 2025

Sorry lots more changes, need to push some CDK tweaks as well. Anyways looking pretty awesome, some things i've been working on include much better selection control (bugs in the current one) and moving/resizing. It was bugging me that you had to select the rotate tool to rotate for example. Now we render some control points which allow the manipulation all from the MoveModule. The video explains better.

MjcpGa-selection-controls.mov

Scaling/Rotation is either relative to the centre point or to where it is attached. Likewise i fixed the flipping so that if you flip on a singly connected bond it does what you would expect. You can still hold alt to get the old behaviour.

There were many updates needed to get this working including custom cursors etc but overall works well.

The second part is the highlight atom/bond now functions like ChemDraw's (hotspot) - see here: https://www.youtube.com/watch?v=AkkpuW322qo. It's not perfect but very nice for quickly entering structures without using a mouse which can be a lot faster once you get the hang of it.

MjcpGA-hotkeys-480.mov

After the initial mouse click, everything is done with the keyboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants