public class SelectionModel extends Object implements ISelectionModel
SelectionLayer
Constructor and Description |
---|
SelectionModel(SelectionLayer selectionLayer) |
SelectionModel(SelectionLayer selectionLayer,
boolean multipleSelectionAllowed) |
Modifier and Type | Method and Description |
---|---|
void |
addSelection(int columnPosition,
int rowPosition) |
void |
addSelection(org.eclipse.swt.graphics.Rectangle range) |
void |
clearSelection() |
void |
clearSelection(int columnPosition,
int rowPosition) |
void |
clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection) |
protected boolean |
contains(org.eclipse.swt.graphics.Rectangle containerRectangle,
org.eclipse.swt.graphics.Rectangle rectangle) |
int[] |
getFullySelectedColumnPositions(int columnHeight) |
int[] |
getFullySelectedRowPositions(int rowWidth) |
int[] |
getSelectedColumnPositions() |
int |
getSelectedRowCount() |
Set<Range> |
getSelectedRowPositions() |
List<org.eclipse.swt.graphics.Rectangle> |
getSelections() |
boolean |
isCellPositionSelected(int columnPosition,
int rowPosition) |
boolean |
isColumnPositionFullySelected(int columnPosition,
int columnHeight)
Are all cells in this column selected?
Different selection rectangles might aggregate to cover the entire column.
|
boolean |
isColumnPositionSelected(int columnPosition) |
boolean |
isEmpty() |
boolean |
isMultipleSelectionAllowed() |
boolean |
isRowPositionFullySelected(int rowPosition,
int rowWidth) |
boolean |
isRowPositionSelected(int rowPosition) |
void |
setMultipleSelectionAllowed(boolean multipleSelectionAllowed) |
protected void |
sortByX(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInRow) |
protected void |
sortByY(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInColumn) |
String |
toString() |
public SelectionModel(SelectionLayer selectionLayer)
public SelectionModel(SelectionLayer selectionLayer, boolean multipleSelectionAllowed)
public boolean isMultipleSelectionAllowed()
isMultipleSelectionAllowed
in interface ISelectionModel
public void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
setMultipleSelectionAllowed
in interface ISelectionModel
public void addSelection(int columnPosition, int rowPosition)
addSelection
in interface ISelectionModel
public void addSelection(org.eclipse.swt.graphics.Rectangle range)
addSelection
in interface ISelectionModel
public void clearSelection()
clearSelection
in interface ISelectionModel
public void clearSelection(int columnPosition, int rowPosition)
clearSelection
in interface ISelectionModel
public void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
clearSelection
in interface ISelectionModel
public boolean isEmpty()
isEmpty
in interface ISelectionModel
public List<org.eclipse.swt.graphics.Rectangle> getSelections()
getSelections
in interface ISelectionModel
public boolean isCellPositionSelected(int columnPosition, int rowPosition)
isCellPositionSelected
in interface ISelectionModel
public int[] getSelectedColumnPositions()
getSelectedColumnPositions
in interface ISelectionModel
public boolean isColumnPositionSelected(int columnPosition)
isColumnPositionSelected
in interface ISelectionModel
public int[] getFullySelectedColumnPositions(int columnHeight)
getFullySelectedColumnPositions
in interface ISelectionModel
columnHeight
- the number of rows in a fully selected columnpublic boolean isColumnPositionFullySelected(int columnPosition, int columnHeight)
isColumnPositionFullySelected
in interface ISelectionModel
columnHeight
- the number of rows in a fully selected columnpublic int getSelectedRowCount()
getSelectedRowCount
in interface ISelectionModel
public Set<Range> getSelectedRowPositions()
getSelectedRowPositions
in interface ISelectionModel
public boolean isRowPositionSelected(int rowPosition)
isRowPositionSelected
in interface ISelectionModel
public int[] getFullySelectedRowPositions(int rowWidth)
getFullySelectedRowPositions
in interface ISelectionModel
rowWidth
- the number of columns in a fully selected rowpublic boolean isRowPositionFullySelected(int rowPosition, int rowWidth)
isRowPositionFullySelected
in interface ISelectionModel
protected boolean contains(org.eclipse.swt.graphics.Rectangle containerRectangle, org.eclipse.swt.graphics.Rectangle rectangle)
protected void sortByX(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInRow)
protected void sortByY(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInColumn)
Copyright © 2013. All Rights Reserved.