Class AtomBondSelection

java.lang.Object
org.openscience.cdk.renderer.selection.AtomBondSelection
All Implemented Interfaces:
IChemObjectSelection

public class AtomBondSelection extends Object implements IChemObjectSelection
A simple implementation of an IChemObjectSelection which wraps a HashSet. This selection only allows select
  • Constructor Details

    • AtomBondSelection

      public AtomBondSelection()
  • Method Details

    • select

      public void select(IChemObject obj)
      Select the chemobject in this selection.
      Parameters:
      obj - the chemobject
    • remove

      public void remove(IChemObject obj)
      Deselect the chemobject in this selection.
      Parameters:
      obj - the chemobject
    • select

      public void select(IChemModel chemModel)
      Perform a selection by some method. This is used for selecting outside the hub, for example: IChemModel model = createModelBySomeMethod(); selection.select(model); renderModel.setSelection(selection);
      Specified by:
      select in interface IChemObjectSelection
      Parameters:
      chemModel - an IChemModel to select from.
    • getConnectedAtomContainer

      public IAtomContainer getConnectedAtomContainer()
      Make an IAtomContainer where all the bonds only have atoms that are in the selection.
      Specified by:
      getConnectedAtomContainer in interface IChemObjectSelection
      Returns:
      a well defined atom container.
    • isFilled

      public boolean isFilled()
      The opposite of a method like "isEmpty".
      Specified by:
      isFilled in interface IChemObjectSelection
      Returns:
      true if there is anything in the selection
    • contains

      public boolean contains(IChemObject obj)
      Determines if the IChemObject is part of the current selection.
      Specified by:
      contains in interface IChemObjectSelection
      Parameters:
      obj - IChemObject which might be part of the selection
      Returns:
      true, if the given obj is part of the selection
    • elements

      public <E extends IChemObject> Collection<E> elements(Class<E> cls)
      Returns a Collection of all selected IChemObjects of the given type.
      Specified by:
      elements in interface IChemObjectSelection
      Parameters:
      cls - type of IChemObjects that should be returned.
      Returns:
      a Collection of IChemObject of the given type