Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IPseudoAtom


      String label=labelField.getText();
      if (label!=null && label.startsWith("R")&&label.length()>1 && !RGroupQuery.isValidRgroupQueryLabel(label) ) {
        JOptionPane.showMessageDialog(null, GT.get("This is not a valid R-group label.\nPlease label in range R1 .. R32"));
    }
      else {
        IPseudoAtom atom = (IPseudoAtom)source;
        atom.setLabel(labelField.getText());
      }
    }
View Full Code Here


   * @see
   * org.openscience.cdk.controller.IChemModelRelay#convertToPseudoAtom(org
   * .openscience.cdk.interfaces.IAtom, java.lang.String)
   */
  public IPseudoAtom convertToPseudoAtom(IAtom atom, String label) {
    IPseudoAtom pseudo = atom.getBuilder().newInstance(IPseudoAtom.class,atom);
    pseudo.setLabel(label);
    replaceAtom(pseudo, atom);
    return pseudo;
  }
View Full Code Here

        //Define new root apo's
        Map<IAtom, Map<Integer, IBond>> apoBonds= new HashMap<IAtom, Map<Integer, IBond>>();
        for (IAtom atom : molecule.atoms()) {
          if (atom instanceof IPseudoAtom) {
            IPseudoAtom pseudo = (IPseudoAtom)atom;
            if (pseudo.getLabel()!=null && RGroupQuery.isValidRgroupQueryLabel(pseudo.getLabel())) {
              chooseRootAttachmentBonds(pseudo,molecule,apoBonds);
            }
          }
        }
        rgrpQuery.setRootAttachmentPoints(apoBonds);

      }

      /* User action: certain atom+bond selection is to be a substituent. */
      else if (type.equals("setSubstitute")) {

        if (hub.getRGroupHandler() == null || hub.getRGroupHandler().getrGroupQuery()==null ||
            hub.getRGroupHandler().getrGroupQuery().getRootStructure()==null) {
          JOptionPane.showMessageDialog(jcpPanel, GT.get("Please define a root structure first."));
          return;
        }

        IAtomContainer atc =selection.getConnectedAtomContainer();
        if (!isProperSelection(atc)) {
          JOptionPane.showMessageDialog(jcpPanel, GT.get("Please do not make a fragmented selection."));
          return;
        }

        // Check - are there any R-groups -> collect them so that user input can be validated
        Map<Integer,Integer> validRnumChoices=new HashMap<Integer,Integer>();
        for (IAtom atom : hub.getRGroupHandler().getrGroupQuery().getRootStructure().atoms()) {
          if (atom instanceof IPseudoAtom) {
            IPseudoAtom pseudo = (IPseudoAtom)atom;
            if (pseudo.getLabel()!=null && RGroupQuery.isValidRgroupQueryLabel(pseudo.getLabel())) {
              int bondCnt=0;
              int rNum=new Integer(pseudo.getLabel().substring(1));
              for (IBond b : hub.getRGroupHandler().getrGroupQuery().getRootStructure().bonds())
                if (b.contains(atom))
                  bondCnt++;

              if ((!validRnumChoices.containsKey(rNum))||
View Full Code Here

TOP

Related Classes of org.openscience.cdk.interfaces.IPseudoAtom

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.