Class SelectionVisibility

java.lang.Object
org.openscience.cdk.renderer.SymbolVisibility
org.openscience.cdk.renderer.generators.standard.SelectionVisibility

public final class SelectionVisibility extends SymbolVisibility
Extended existing symbol visibility options to account for selection of atoms in the standard generator. The selection viability displays an atom symbol regardless as to whether it is normally 'shown'. By default, the symbol is shown if the atom is selected an not next to any selected bonds (disconnected). Alternatively, all select atoms can be displayed. An atom or bond is selected if the StandardGenerator.HIGHLIGHT_COLOR is non-null.
Author:
John May
  • Method Details

    • disconnected

      public static SymbolVisibility disconnected(SymbolVisibility visibility)
      Display the atom symbol if is disconnected from any other selected atoms or bonds. The provided visibility is used when the atom is not selected.
      Parameters:
      visibility - visibility when not selected
      Returns:
      visibility instance
    • all

      public static SymbolVisibility all(SymbolVisibility visibility)
      Display the atom symbol if is selected, otherwise use the provided visibility.
      Parameters:
      visibility - visibility when not selected
      Returns:
      visibility instance
    • visible

      public boolean visible(IAtom atom, List<IBond> neighbors, RendererModel model)
      Determine if an atom with the specified bonds is visible.
      Specified by:
      visible in class SymbolVisibility
      Parameters:
      atom - an atom
      neighbors - neighboring bonds
      Returns:
      whether the atom symbol is visible