Package org.openscience.jchempaint.controller

Examples of org.openscience.jchempaint.controller.IControllerModule


     */
    public String getStatus(int position) {
        String status = "";
        if (position == 0) {
            // depict editing mode
            IControllerModule activeDrawModule = hub.getActiveDrawModule();
            if (activeDrawModule == null) {
                return "";
            } else {
                String mode = activeDrawModule.getDrawModeString();
                status = JCPMenuTextMaker.getInstance("applet").getText(mode);
            }
        } else if (position == 1) {
            // depict bruto formula
            IChemModel chemModel = hub.getIChemModel();
View Full Code Here


        }
        if (orientation == SwingConstants.HORIZONTAL) {
            toolbar2.add(Box.createHorizontalGlue());
        }
        ControllerHub relay = chemPaintPanel.get2DHub();
        IControllerModule m = new SelectSquareModule(relay);
        m.setID("select");
        relay.setFallbackModule(m);
        return toolbar2;
    }
View Full Code Here

    private static final long serialVersionUID = -4056416630614934238L;

    public void actionPerformed(ActionEvent e) {
        ControllerHub hub = jcpPanel.get2DHub();
        IControllerModule newActiveModule=null;
        if (type.equals("lasso")) {
          newActiveModule=new SelectLassoModule(hub);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("select")) {
          newActiveModule=new SelectSquareModule(hub);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("triangle")) {
          newActiveModule=new AddRingModule(hub, 3, false);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("square")) {
          newActiveModule=new AddRingModule(hub, 4, false);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("pentagon")) {
          newActiveModule=new AddRingModule(hub, 5, false);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("hexagon")) {
          newActiveModule=new AddRingModule(hub, 6, false);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("heptagon")) {
          newActiveModule=new AddRingModule(hub, 7, false);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("octagon")) {
          newActiveModule=new AddRingModule(hub, 8, false);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("benzene")) {
          newActiveModule=new AddRingModule(hub, 6, true);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("atomatommapping")) {
          newActiveModule=new AtomAtomMappingModule(hub);
            hub.getController2DModel().setDrawElement("C");
        } else if (type.equals("rotate")) {
          newActiveModule=new RotateModule(hub);
        } else if (type.equals("rotate3d")) {
          newActiveModule=new Rotate3DModule(hub);
        } else if (type.equals("reactionArrow")) {
            newActiveModule=new ReactionArrowModule(hub);
        } else if (type.equals("chain")) {
            newActiveModule=new ChainModule(hub);
        }
        if(newActiveModule!=null){
          newActiveModule.setID(type);
          hub.setActiveDrawModule(newActiveModule);
        }
    }
View Full Code Here

TOP

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

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.