Package org.openscience.cdk.renderer.selection

Examples of org.openscience.cdk.renderer.selection.IChemObjectSelection.elements()


  private IAtom getClosestSelAtom(Point2d worldCoord) {
    IAtom closestAtom = null;
    IChemObjectSelection sel = chemModelRelay.getRenderer().getRenderer2DModel().getSelection();
    double closestDistanceSQ = Double.MAX_VALUE;

    for (IAtom atom : sel.elements(IAtom.class)) {
      if (atom.getPoint2d() != null) {
        double distanceSQ = atom.getPoint2d().distanceSquared(
            worldCoord);
        if (distanceSQ < closestDistanceSQ) {
          closestAtom = atom;
View Full Code Here


  private IBond getClosestSelBond(Point2d worldCoord) {
    IBond closestBond = null;
    IChemObjectSelection sel = chemModelRelay.getRenderer().getRenderer2DModel().getSelection();
    double closestDistanceSQ = Double.MAX_VALUE;

    for (IBond bond : sel.elements(IBond.class)) {
      if (bond.get2DCenter() != null) {
        double distanceSQ = bond.get2DCenter().distanceSquared(
            worldCoord);
        if (distanceSQ < closestDistanceSQ) {
          closestBond = bond;
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.