Package org.openscience.jchempaint.renderer.selection

Examples of org.openscience.jchempaint.renderer.selection.RectangleSelection


       
        applet.button("select").click();
        panel.get2DHub().updateView();
        applet.panel("renderpanel").robot.waitForIdle();
    IAtomContainer ethane = panel.getChemModel().getMoleculeSet().getAtomContainer(0);
        RectangleSelection sel = new RectangleSelection();
        sel.addAtom (ethane.getAtom(0));
        sel.addBond(ethane.getBond(0));
        panel.getRenderPanel().getRenderer().getRenderer2DModel().setSelection(sel);
        panel.selectionChanged();
        try {
      applet.button("cut").click();
          panel.get2DHub().updateView();
View Full Code Here


                for (IAtomContainer container :
                    ReactionManipulator.getAllAtomContainers(
                            (IReaction)object)) {
                    wholeModel.add(container);
                }
                ShapeSelection container = new RectangleSelection();
                for (IAtom atom : wholeModel.atoms()) {
                    container.atoms.add(atom);
                }
                for (IBond bond : wholeModel.bonds()) {
                    container.bonds.add(bond);
                }
                renderModel.setSelection(container);
            }
            else {
                logger.warn("Cannot select everything in : ", object);
            }
        } else if (type.equals("selectReactionReactants")) {
            IChemObject object = getSource(e);
            if (object instanceof IReaction) {
                IReaction reaction = (IReaction) object;
                IAtomContainer wholeModel =
                    jcpPanel.getChemModel().getBuilder().newInstance(IAtomContainer.class);
                for (IAtomContainer container :
                    MoleculeSetManipulator.getAllAtomContainers(
                            reaction.getReactants())) {
                        wholeModel.add(container);
                }
                ShapeSelection container = new RectangleSelection();
                for (IAtom atom : wholeModel.atoms()) {
                    container.atoms.add(atom);
                }
                for (IBond bond : wholeModel.bonds()) {
                    container.bonds.add(bond);
                }
                renderModel.setSelection(container);
            }
            else {
                logger.warn("Cannot select reactants from : ", object);
            }
        } else if (type.equals("selectReactionProducts")) {
            IChemObject object = getSource(e);
            if (object instanceof IReaction) {
                    IReaction reaction = (IReaction) object;
                    IAtomContainer wholeModel =
                        jcpPanel.getChemModel().getBuilder().newInstance(IAtomContainer.class);
                for (IAtomContainer container :
                    MoleculeSetManipulator.getAllAtomContainers(
                            reaction.getProducts())) {
                        wholeModel.add(container);
                }
                ShapeSelection container = new RectangleSelection();
                for (IAtom atom : wholeModel.atoms()) {
                    container.atoms.add(atom);
                }
                for (IBond bond : wholeModel.bonds()) {
                    container.bonds.add(bond);
View Full Code Here

*/
public class SelectSquareModule extends AbstractSelectModule {
   
    public SelectSquareModule(IChemModelRelay chemModelRelay) {
        super(chemModelRelay);
        selection = new RectangleSelection();
    }
View Full Code Here

TOP

Related Classes of org.openscience.jchempaint.renderer.selection.RectangleSelection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.