Examples of IIsotope


Examples of org.openscience.cdk.interfaces.IIsotope

      isotopeFac = IsotopeFactory.getInstance(builder);
    } catch (Exception e) {
      e.printStackTrace();
      return 0;
    }
    IIsotope majorIsotope = isotopeFac.getMajorIsotope(element);
    // If the isotope which such symbol does not exist, return 0
    if (majorIsotope == null) {
      return 0;
    }
    double mass = majorIsotope.getExactMass();
    return mass;
  }
View Full Code Here

Examples of org.openscience.cdk.interfaces.IIsotope

            formalChargeField.setValue(new Integer(atom.getFormalCharge()));
            if(atom.getProperty(CDKConstants.COMMENT)!=null)
              commentField.setText((String)(atom.getProperty(CDKConstants.COMMENT)));
           
            try {
                IIsotope isotope =
                    XMLIsotopeFactory.getInstance(
                                atom.getBuilder()).getMajorIsotope(
                                atom.getSymbol());
                majorIsotopeNumber = isotope.getMassNumber();
                isotopeField.setValue(atom.getMassNumber()-majorIsotopeNumber);
            } catch (Exception exception) {
                logger.error("Error while configuring atom");
                logger.debug(exception);
                isotopeField.setValue(0);
View Full Code Here

Examples of org.openscience.cdk.interfaces.IIsotope

                if (Character.isLowerCase(x))
                    x = Character.toUpperCase(x);
                System.out.println(x);
                IsotopeFactory ifa;
                ifa = XMLIsotopeFactory.getInstance(closestAtom.getBuilder());
                IIsotope iso = ifa.getMajorIsotope(Character.toString(x));
                if (iso != null) {
                    relay.setSymbol(closestAtom, Character.toString(x));
                }
                this.get2DHub().updateView();
            } catch (IOException e) {
View Full Code Here

Examples of org.openscience.cdk.interfaces.IIsotope

            IAtomContainer ac, IAtom atom, JChemPaintRendererModel model) {
       
        Integer majorIsotopeNumber = null;
        if(atom.getMassNumber()!=null){
            try {
          IIsotope isotope = XMLIsotopeFactory.getInstance(
                        atom.getBuilder()).getMajorIsotope(
                            atom.getSymbol());
          if(isotope!=null)
            majorIsotopeNumber = isotope.getMassNumber();
        } catch (IOException e) {
   
        }
        }
        if ((!hasCoordinates(atom)
View Full Code Here

Examples of org.openscience.cdk.interfaces.IIsotope

                    if(Character.isLowerCase(symbol.toCharArray()[0]))
                        symbol=Character.toUpperCase(symbol.charAt(0))+symbol.substring(1);
                    IsotopeFactory ifa;
                    try {
                        ifa = XMLIsotopeFactory.getInstance(jcpPanel.getChemModel().getBuilder());
                        IIsotope iso=ifa.getMajorIsotope(symbol);
                        if(iso==null){
                            JOptionPane.showMessageDialog(jcpPanel, GT.get("No valid element symbol entered"), GT.get("Invalid symbol"), JOptionPane.WARNING_MESSAGE);
                            return;
                        }
                    } catch (IOException e) {
View Full Code Here

Examples of org.openscience.cdk.interfaces.IIsotope

      return;
    while(atomsInRange.hasNext()){
            IAtom atom = atomsInRange.next();
            int isotopeNumber = 0;
            try {
                IIsotope isotope =
                    XMLIsotopeFactory.getInstance(
                                atom.getBuilder()).getMajorIsotope(
                                atom.getSymbol());
                isotopeNumber = isotope.getMassNumber();
            } catch (Exception exception) {
                logger.error("Error while configuring atom");
                logger.debug(exception);
            }
            // adapt for menu chosen
View Full Code Here

Examples of org.openscience.cdk.interfaces.IIsotope

                chemModelRelay.getController2DModel().setDrawElement(x);
            }else if(x!=null && x.length()>0){
                if(Character.isLowerCase(x.toCharArray()[0]))
                    x=Character.toUpperCase(x.charAt(0))+x.substring(1);
                IsotopeFactory ifa=XMLIsotopeFactory.getInstance(chemModelRelay.getIChemModel().getBuilder());
                IIsotope iso=ifa.getMajorIsotope(x);
                if(iso!=null){
                    if(closestAtom==null){
                        IAtomContainer addatom=chemModelRelay.getIChemModel().getBuilder().newInstance(IAtomContainer.class);
                        addatom.addAtom(chemModelRelay.addAtomWithoutUndo(x, worldCoord, false));
                        if(chemModelRelay.getUndoRedoFactory()!=null && chemModelRelay.getUndoRedoHandler()!=null){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.