Package io.keikai.ui.impl
Class MergeMatrixHelper
- java.lang.Object
-
- io.keikai.ui.impl.MergeMatrixHelper
-
- All Implemented Interfaces:
Serializable
public class MergeMatrixHelper extends Object implements Serializable
Each sheet has its own MergeMatrixHelper and it manages all merged cells.- Author:
- Dennis.Chen, jumperchen
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MergeMatrixHelper(List<CellRegion> mergeRange, int frozenRow, int frozenCol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMergeRange(int left, int top, int right, int bottom, Set toadd, Set torem)
void
deleteMergeRange(int left, int top, int right, int bottom, Set torem)
int
getBottomConnectedRow(int row, int left, int right)
int
getLeftConnectedColumn(int col, int top, int bottom)
MergedRect
getMergedRect(int id)
ReturnsMergedRect
MergedRect by idMergedRect
getMergeRange(int row, int col)
Get a merged range which contains cell(row,col)List<MergedRect>
getRanges()
Get all merged range.Set
getRangesByColumn(int col)
Get merged range which contains colint
getRightConnectedColumn(int col, int top, int bottom)
int
getTopConnectedRow(int row, int left, int right)
boolean
isMergeRangeLeftTop(int row, int col)
Check is (row,col) in one of merge range's left-topvoid
update(int frozenRow, int frozenCol)
void
updateMergeRange(int oleft, int otop, int oright, int obottom, int left, int top, int right, int bottom, Set toadd, Set torem)
-
-
-
Constructor Detail
-
MergeMatrixHelper
public MergeMatrixHelper(List<CellRegion> mergeRange, int frozenRow, int frozenCol)
- Parameters:
mergeRange
- List of merge rangefrozenRow
-frozenCol
-
-
-
Method Detail
-
update
public void update(int frozenRow, int frozenCol)
-
isMergeRangeLeftTop
public boolean isMergeRangeLeftTop(int row, int col)
Check is (row,col) in one of merge range's left-top
-
getMergeRange
public MergedRect getMergeRange(int row, int col)
Get a merged range which contains cell(row,col)
-
getRanges
public List<MergedRect> getRanges()
Get all merged range.- Returns:
- a list which contains all merged range
-
getMergedRect
public MergedRect getMergedRect(int id)
ReturnsMergedRect
MergedRect by id- Parameters:
id
-- Returns:
- MergedRect
-
getRangesByColumn
public Set getRangesByColumn(int col)
Get merged range which contains col- Parameters:
col
- column index- Returns:
- a list which contains merged range
-
getRightConnectedColumn
public int getRightConnectedColumn(int col, int top, int bottom)
-
getLeftConnectedColumn
public int getLeftConnectedColumn(int col, int top, int bottom)
-
getBottomConnectedRow
public int getBottomConnectedRow(int row, int left, int right)
-
getTopConnectedRow
public int getTopConnectedRow(int row, int left, int right)
-
updateMergeRange
public void updateMergeRange(int oleft, int otop, int oright, int obottom, int left, int top, int right, int bottom, Set toadd, Set torem)
-
deleteMergeRange
public void deleteMergeRange(int left, int top, int right, int bottom, Set torem)
-
-