Class CellOrComponentId

java.lang.Object
chemaxon.marvin.space.CellOrComponentId

@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) @PublicAPI public class CellOrComponentId extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Class to identify cells and components. This class let us handle cells and components uniformly, which is used during interactive selection. A cell is identified by its cellIndex, and -1 as a componentIndex.
E.g. 3rd cell of the Scene: new CellOrComponentId(2, -1);
E.g. 2nd component of the 1st cell: new CellOrComponentId(0, 1);
Since:
Marvin 4.0.2
  • Constructor Summary

    Constructors
    Constructor
    Description
    CellOrComponentId(int cellIndex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a cell id.
    CellOrComponentId(int cellIndex, int componentIndex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates an id.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the internal index of the cell either this is a cell id or a component id.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the internal index of the component or -1 if this is a cell id.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if this id identifies a cell.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if this id identifies a component.
    void
    setCellIndex(int cellIndex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the internal index of the cell.
    void
    setComponentIndex(int componentIndex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Warning: for internal use only.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the internal cell and component indices.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CellOrComponentId

      public CellOrComponentId(int cellIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a cell id. This can become a component id by setComponentIndex(int).
      Parameters:
      cellIndex - internal index of the cell
    • CellOrComponentId

      public CellOrComponentId(int cellIndex, int componentIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an id. If componentIndex equals -1 it identifies a cell.
      Parameters:
      cellIndex - internal index of the cell
      componentIndex - internal index of the component or -1
  • Method Details

    • isCell

      public boolean isCell()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if this id identifies a cell.
      Returns:
      the id identifies a cell or not
    • isComponent

      public boolean isComponent()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns true if this id identifies a component.
      Returns:
      the id identifies a component or not
    • getCellIndex

      public int getCellIndex()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the internal index of the cell either this is a cell id or a component id.
      Returns:
      internal index of the cell
    • getComponentIndex

      public int getComponentIndex()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the internal index of the component or -1 if this is a cell id.
      Returns:
      internal id of the component or -1
    • setCellIndex

      public void setCellIndex(int cellIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the internal index of the cell. This is useful when deleting cells, or moving components to other cells.
    • setComponentIndex

      public void setComponentIndex(int componentIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Warning: for internal use only. Sets the internal index of the component. This is useful when deleting components. Called by GraphicCell.removeComponent(GraphicComponent)
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the internal cell and component indices.
      Overrides:
      toString in class Object
      Returns:
      id as String