Package org.openscience.jchempaint.controller

Examples of org.openscience.jchempaint.controller.AddBondDragModule


                    box.add(button);
                    if (toolKeys[i].equals("bondTool")) {
                        //button.setBackground(Color.GRAY);
                        button.setBackground(new Color(238, 238, 238));
                        chemPaintPanel.setLastActionButton(button);
                        AddBondDragModule activeModule = new AddBondDragModule(chemPaintPanel.get2DHub(), IBond.Stereo.NONE, true);
                        activeModule.setID(toolKeys[i]);
                        chemPaintPanel.get2DHub().setActiveDrawModule(activeModule);
                        chemPaintPanel.updateStatusBar();
                    } else if (toolKeys[i].equals("C")) {
                        button.setBackground(Color.GRAY);
                        chemPaintPanel.setLastSecondaryButton(button);
View Full Code Here


       
        String s = event.getActionCommand();
        String type = s.substring(s.indexOf("@") + 1);
       
        //first switch mode
        AddBondDragModule newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Stereo.NONE, true);;
        if(type.equals("down_bond")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Stereo.DOWN, true);
        }else if(type.equals("up_bond")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Stereo.UP, true);
        }else if(type.equals("undefined_bond")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Stereo.UP_OR_DOWN, true);
        }else if(type.equals("undefined_stereo_bond")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Stereo.E_OR_Z, true);
        }else if(type.equals("bondTool")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Stereo.NONE, true);
        }else if(type.equals("double_bondTool")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Order.DOUBLE, true);
        }else if(type.equals("triple_bondTool")){
            newActiveModule = new AddBondDragModule(jcpPanel.get2DHub(),IBond.Order.TRIPLE, true);
        }

        if (newActiveModule != null) { // null means that menu was used => don't change module           
            newActiveModule.setID(type);
            jcpPanel.get2DHub().setActiveDrawModule(newActiveModule);
        }
       
        // xxxTool -> xxx
        int l = type.length();
View Full Code Here

TOP

Related Classes of org.openscience.jchempaint.controller.AddBondDragModule

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.