com.corticon.eclipse.core.util

## Class MatrixSelection

- java.lang.Object
- - com.corticon.eclipse.core.util.Selection
  - - com.corticon.eclipse.core.util.MatrixSelection

- All Implemented Interfaces:
    java.lang.Cloneable

      public class MatrixSelection
      extends Selection

  This class is a container used to encapsulate the selection state of a given Matrix, or a set of Matrix instances operating in tandem. The class allows selection changes to be conveyed to the model in a platform-neutral manner as an atomic unit, facilitating convenient before/after selection state comparisons during view update (notification) processing.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `SELECTION_MODE_COLUMN`
    `static int` | `SELECTION_MODE_NORMAL`
    `static int` | `SELECTION_MODE_ROW`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MatrixSelection()` Constructs a MatrixSelection instance with no selection state.
    `MatrixSelection(int aiMatrixID, int aiSelectionMode, int aiColumnIndexAnchor, int aiRowIndexAnchor, int aiColumnIndexLead, int aiRowIndexLead)` Constructs a MatrixSelection instance using integer and point arguments.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()` Creates a clone of this MatrixSelection object.
    `boolean` | `containsCell(int aiColumnIndex, int aiRowIndex)` Determine whether the selection contains the specified cell.
    `boolean` | `containsColumn(int aiColumnIndex)` Determine whether the selection contains the specified column.
    `boolean` | `containsRow(int aiRowIndex)` Determine whether the selection contains the specified row.
    `boolean` | `equals(java.lang.Object aObjectSelection)` Determines whether the given MatrixSelection instance is logically equivalent to this one.
    `int` | `getAnchorColumn()` Returns the anchor column index.
    `int` | `getAnchorRow()` Returns the anchor row index.
    `int` | `getColumnCount()` Returns a count of the number of columns selected.
    `int` | `getFirstColumn()` Returns the index of the first column of the selected range.
    `int` | `getFirstRow()` Returns the index of the first row of the selected range.
    `int` | `getLastColumn()` Returns the index of the last column of the selected range.
    `int` | `getLastRow()` Returns the index of the last row of the selected range.
    `int` | `getLeadColumn()` Returns the lead column index.
    `int` | `getLeadRow()` Returns the lead row index.
    `int` | `getMatrixID()` Returns the matrix identifier.
    `int` | `getRowCount()` Returns a count of the number of rows selected.
    `int` | `getSelectionMode()` Returns the selection mode
    `boolean` | `isValid()` Is selection valid?
    `java.lang.String` | `toString()` Renders the selection state as a string.

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SELECTION_MODE_NORMAL

          public static final int SELECTION_MODE_NORMAL

      See Also:
        Constant Field Values

    - #### SELECTION_MODE_ROW

          public static final int SELECTION_MODE_ROW

      See Also:
        Constant Field Values

    - #### SELECTION_MODE_COLUMN

          public static final int SELECTION_MODE_COLUMN

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MatrixSelection

          public MatrixSelection()

      Constructs a MatrixSelection instance with no selection state.

    - #### MatrixSelection

          public MatrixSelection(int aiMatrixID,
                         int aiSelectionMode,
                         int aiColumnIndexAnchor,
                         int aiRowIndexAnchor,
                         int aiColumnIndexLead,
                         int aiRowIndexLead)

      Constructs a MatrixSelection instance using integer and point arguments.
      Parameters:
        `aiMatrixID` - Matrix ID.
        `aiSelectionMode` - Selection mode.
        `aiColumnIndexAnchor` - Anchor column index.
        `aiRowIndexAnchor` - Anchor row index.
        `aiColumnIndexLead` - Lead column index.
        `aiRowIndexLead` - Lead row index.

  - ### Method Detail

    - #### clone

          public java.lang.Object clone()

      Creates a clone of this MatrixSelection object.
      Overrides:
        `clone` in class `Selection`
      Returns:
        Clone of MatrixSelection object.

    - #### containsCell

          public boolean containsCell(int aiColumnIndex,
                             int aiRowIndex)

      Determine whether the selection contains the specified cell.
      Parameters:
        `aiColumnIndex` - Column index.
        `aiRowIndex` - Row index.
      Returns:
        `true` if this MatrixSelection contains the specified cell.

    - #### containsColumn

          public boolean containsColumn(int aiColumnIndex)

      Determine whether the selection contains the specified column.
      Parameters:
        `aiColumnIndex` - Column index.
      Returns:
        `true` if this MatrixSelection contains the specified column.

    - #### containsRow

          public boolean containsRow(int aiRowIndex)

      Determine whether the selection contains the specified row.
      Parameters:
        `aiRowIndex` - Row index index.
      Returns:
        `true` if this MatrixSelection contains the specified row.

    - #### equals

          public boolean equals(java.lang.Object aObjectSelection)

      Determines whether the given MatrixSelection instance is logically equivalent to this one.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `aObjectSelection` - Selection instance.
      Returns:
        `true` if the specified MatrixSelection matches the receiver.

    - #### getAnchorColumn

          public int getAnchorColumn()

      Returns the anchor column index.
      Returns:
        Anchor column index.

    - #### getAnchorRow

          public int getAnchorRow()

      Returns the anchor row index.
      Returns:
        Anchor row index.

    - #### getColumnCount

          public int getColumnCount()

      Returns a count of the number of columns selected.
      Returns:
        Count of number of columns selected.

    - #### getFirstColumn

          public int getFirstColumn()

      Returns the index of the first column of the selected range.
      Returns:
        Index of first column of selected range.

    - #### getFirstRow

          public int getFirstRow()

      Returns the index of the first row of the selected range.
      Returns:
        Index of first row of selected range.

    - #### getLastColumn

          public int getLastColumn()

      Returns the index of the last column of the selected range.
      Returns:
        Index of last column of selected range.

    - #### getLastRow

          public int getLastRow()

      Returns the index of the last row of the selected range.
      Returns:
        Index of last row of selected range.

    - #### getLeadColumn

          public int getLeadColumn()

      Returns the lead column index.
      Returns:
        lead column index.

    - #### getLeadRow

          public int getLeadRow()

      Returns the lead row index.
      Returns:
        Lead row index.

    - #### getMatrixID

          public int getMatrixID()

      Returns the matrix identifier.
      Returns:
        Matrix identifier.

    - #### getRowCount

          public int getRowCount()

      Returns a count of the number of rows selected.
      Returns:
        Count of number of rows selected.

    - #### getSelectionMode

          public int getSelectionMode()

      Returns the selection mode
      Returns:
        Selection mode.

    - #### isValid

          public boolean isValid()

      Is selection valid?
      Overrides:
        `isValid` in class `Selection`

    - #### toString

          public java.lang.String toString()

      Renders the selection state as a string.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Selection state as string

Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.