Class MarkerSelectionModelTest.StubbedMarkerSelectionModel
java.lang.Object
org.eclipse.nebula.widgets.nattable.selection.MarkerSelectionModelTest.StubbedMarkerSelectionModel
- All Implemented Interfaces:
ILayerEventHandler<IStructuralChangeEvent>,IMarkerSelectionModel,ISelectionModel
- Enclosing class:
- MarkerSelectionModelTest
public class MarkerSelectionModelTest.StubbedMarkerSelectionModel
extends Object
implements IMarkerSelectionModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelection(int columnPosition, int rowPosition) Selects a specified cellvoidaddSelection(org.eclipse.swt.graphics.Rectangle range) Selects the cells of a specified areavoidRemoves all cell selectionsvoidclearSelection(int columnPosition, int rowPosition) Deselects a specified cellvoidclearSelection(org.eclipse.swt.graphics.Rectangle removedSelection) Removes the selection of specified cellsint[]getFullySelectedColumnPositions(int columnHeight) int[]getFullySelectedRowPositions(int rowWidth) org.eclipse.swt.graphics.Pointorg.eclipse.swt.graphics.Rectangleint[]Retrieves the columns that have any selected cellsintRetrieves the number of rows that have any selected cellRetrieves the rows with a valid row position that have any selected cellsorg.eclipse.swt.graphics.PointList<org.eclipse.swt.graphics.Rectangle>Retrieves the cells that are selectedvoidbooleanisCellPositionSelected(int columnPosition, int rowPosition) Determines whether a specified cell is selectedbooleanisColumnPositionFullySelected(int columnPosition, int columnHeight) booleanisColumnPositionSelected(int columnPosition) Determines whether a specified column contains any selected cellbooleanisEmpty()Determines whether there are any selected cellsbooleanDetermines whether multiple cells can be selected simultaneouslybooleanisRowPositionFullySelected(int rowPosition, int rowWidth) Check if all cells in a row are selected, which means the row is fully selected.booleanisRowPositionSelected(int rowPosition) Determines whether a specified row contains any selected cellvoidsetLastSelectedCell(org.eclipse.swt.graphics.Point lastSelectedCell) voidsetLastSelectedRegion(int x, int y, int width, int height) Will copy the information of the parameters to the already existing Rectangle object of last selected region.voidsetLastSelectedRegion(org.eclipse.swt.graphics.Rectangle region) Will set the Rectangle object of the last selected region to be the same as the parameter object region.voidsetMultipleSelectionAllowed(boolean multipleSelectionAllowed) Sets whether multiple cells can be selected simultaneouslyvoidsetSelectionAnchor(org.eclipse.swt.graphics.Point anchor)
-
Constructor Details
-
StubbedMarkerSelectionModel
public StubbedMarkerSelectionModel()
-
-
Method Details
-
isMultipleSelectionAllowed
public boolean isMultipleSelectionAllowed()Description copied from interface:ISelectionModelDetermines whether multiple cells can be selected simultaneously- Specified by:
isMultipleSelectionAllowedin interfaceISelectionModel- Returns:
- whether multiple cells can be selected simultaneously
-
setMultipleSelectionAllowed
public void setMultipleSelectionAllowed(boolean multipleSelectionAllowed) Description copied from interface:ISelectionModelSets whether multiple cells can be selected simultaneously- Specified by:
setMultipleSelectionAllowedin interfaceISelectionModel- Parameters:
multipleSelectionAllowed- whether multiple cells can be selected simultaneously
-
addSelection
public void addSelection(int columnPosition, int rowPosition) Description copied from interface:ISelectionModelSelects a specified cell- Specified by:
addSelectionin interfaceISelectionModel- Parameters:
columnPosition- column position of the cell to selectrowPosition- row position of the cell to select
-
addSelection
public void addSelection(org.eclipse.swt.graphics.Rectangle range) Description copied from interface:ISelectionModelSelects the cells of a specified area- Specified by:
addSelectionin interfaceISelectionModel- Parameters:
range- the position based area to select
-
clearSelection
public void clearSelection()Description copied from interface:ISelectionModelRemoves all cell selections- Specified by:
clearSelectionin interfaceISelectionModel
-
clearSelection
public void clearSelection(int columnPosition, int rowPosition) Description copied from interface:ISelectionModelDeselects a specified cell- Specified by:
clearSelectionin interfaceISelectionModel- Parameters:
columnPosition- column position of the cell to deselectrowPosition- row position of the cell to deselect
-
clearSelection
public void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection) Description copied from interface:ISelectionModelRemoves the selection of specified cells- Specified by:
clearSelectionin interfaceISelectionModel- Parameters:
removedSelection- the position based area to deselect
-
isEmpty
public boolean isEmpty()Description copied from interface:ISelectionModelDetermines whether there are any selected cells- Specified by:
isEmptyin interfaceISelectionModel- Returns:
- whether there are any selected cells
-
getSelections
Description copied from interface:ISelectionModelRetrieves the cells that are selected- Specified by:
getSelectionsin interfaceISelectionModel- Returns:
- the cells that are selected, expressed in position coordinates
-
isCellPositionSelected
public boolean isCellPositionSelected(int columnPosition, int rowPosition) Description copied from interface:ISelectionModelDetermines whether a specified cell is selected- Specified by:
isCellPositionSelectedin interfaceISelectionModel- Parameters:
columnPosition- column position of the cell to inspectrowPosition- row position of the cell to inspect- Returns:
- whether the specified cell is selected
-
getSelectedColumnPositions
public int[] getSelectedColumnPositions()Description copied from interface:ISelectionModelRetrieves the columns that have any selected cells- Specified by:
getSelectedColumnPositionsin interfaceISelectionModel- Returns:
- the column positions that have any selected cells
-
isColumnPositionSelected
public boolean isColumnPositionSelected(int columnPosition) Description copied from interface:ISelectionModelDetermines whether a specified column contains any selected cell- Specified by:
isColumnPositionSelectedin interfaceISelectionModel- Parameters:
columnPosition- column position to inspect- Returns:
- whether the specified column contains any selected cell
-
getFullySelectedColumnPositions
public int[] getFullySelectedColumnPositions(int columnHeight) - Specified by:
getFullySelectedColumnPositionsin interfaceISelectionModel- Parameters:
columnHeight- the number of rows in a fully selected column
-
isColumnPositionFullySelected
public boolean isColumnPositionFullySelected(int columnPosition, int columnHeight) - Specified by:
isColumnPositionFullySelectedin interfaceISelectionModelcolumnHeight- the number of rows in a fully selected column
-
getSelectedRowCount
public int getSelectedRowCount()Description copied from interface:ISelectionModelRetrieves the number of rows that have any selected cell- Specified by:
getSelectedRowCountin interfaceISelectionModel- Returns:
- the number of rows that have any selected cell
-
getSelectedRowPositions
Description copied from interface:ISelectionModelRetrieves the rows with a valid row position that have any selected cells- Specified by:
getSelectedRowPositionsin interfaceISelectionModel- Returns:
- the row positions with a valid row position that have any selected cells
-
isRowPositionSelected
public boolean isRowPositionSelected(int rowPosition) Description copied from interface:ISelectionModelDetermines whether a specified row contains any selected cell- Specified by:
isRowPositionSelectedin interfaceISelectionModel- Parameters:
rowPosition- row position to inspect- Returns:
- whether the specified row contains any selected cell
-
getFullySelectedRowPositions
public int[] getFullySelectedRowPositions(int rowWidth) - Specified by:
getFullySelectedRowPositionsin interfaceISelectionModel- Parameters:
rowWidth- the number of columns in a fully selected row
-
isRowPositionFullySelected
public boolean isRowPositionFullySelected(int rowPosition, int rowWidth) Description copied from interface:ISelectionModelCheck if all cells in a row are selected, which means the row is fully selected.- Specified by:
isRowPositionFullySelectedin interfaceISelectionModel- Parameters:
rowPosition- The row position that should be checked.rowWidth- The number of columns in the row which is needed to determine if the all cells in a row are selected.- Returns:
trueif all cells in a row are selected,falseif not
-
getSelectionAnchor
public org.eclipse.swt.graphics.Point getSelectionAnchor()- Specified by:
getSelectionAnchorin interfaceIMarkerSelectionModel- Returns:
- point of the anchor expressed in position coordinates
-
getLastSelectedCell
public org.eclipse.swt.graphics.Point getLastSelectedCell()- Specified by:
getLastSelectedCellin interfaceIMarkerSelectionModel- Returns:
- point of the last selected cell expressed in position coordinates
-
getLastSelectedRegion
public org.eclipse.swt.graphics.Rectangle getLastSelectedRegion()- Specified by:
getLastSelectedRegionin interfaceIMarkerSelectionModel- Returns:
- rectangle of the last selected region expressed in position coordinates
-
setSelectionAnchor
public void setSelectionAnchor(org.eclipse.swt.graphics.Point anchor) - Specified by:
setSelectionAnchorin interfaceIMarkerSelectionModel- Parameters:
anchor- coordinate of the anchor
-
setLastSelectedCell
public void setLastSelectedCell(org.eclipse.swt.graphics.Point lastSelectedCell) - Specified by:
setLastSelectedCellin interfaceIMarkerSelectionModel- Parameters:
lastSelectedCell- coordinate of the last selected
-
setLastSelectedRegion
public void setLastSelectedRegion(org.eclipse.swt.graphics.Rectangle region) Description copied from interface:IMarkerSelectionModelWill set the Rectangle object of the last selected region to be the same as the parameter object region.- Specified by:
setLastSelectedRegionin interfaceIMarkerSelectionModel- Parameters:
region- the last selection position region
-
setLastSelectedRegion
public void setLastSelectedRegion(int x, int y, int width, int height) Description copied from interface:IMarkerSelectionModelWill copy the information of the parameters to the already existing Rectangle object of last selected region.- Specified by:
setLastSelectedRegionin interfaceIMarkerSelectionModel- Parameters:
x- origin of the last selection position regiony- origin of the last selection position regionwidth- of the last selection position regionheight- of the last selection position region
-
handleLayerEvent
- Specified by:
handleLayerEventin interfaceILayerEventHandler<IStructuralChangeEvent>
-
getLayerEventClass
- Specified by:
getLayerEventClassin interfaceILayerEventHandler<IStructuralChangeEvent>
-