Package io.keikai.model
Class ViewAnchor
java.lang.Object
io.keikai.model.ViewAnchor
- All Implemented Interfaces:
Serializable
Represent a anchor position by its left-top cell index, width, height, x and y offset within the cell,
or a right-bottom anchor position by its right-bottom cell index with 0 width and height.
- Since:
- 3.5.0
- Author:
- dennis
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionViewAnchor(int rowIndex, int columnIndex, int width, int height) Create a view anchor with indexes for left-top corner cell, width, and height.ViewAnchor(int rowIndex, int columnIndex, int xOffset, int yOffset, int width, int height) Create a view anchor with indexes for left-top corner cell, x and y offset in the cell, width, and height.ViewAnchor(int rowIndex, int columnIndex, int xOffset, int yOffset, int width, int height, ViewAnchor.AnchorType anchorType) Create a view anchor with indexes for left-top corner cell, x and y offset in the cell, width, height, andViewAnchor.AnchorType. -
Method Summary
Modifier and TypeMethodDescriptionReturns the anchor type.intintgetRightBottomAnchor(SSheet sheet) intintgetWidth()Width of the anchor, in pixels.intThe x offset to left border of the anchor's left-top cell.intThe y offset to top border of the anchor's left-top cell.voidsetAnchorType(ViewAnchor.AnchorType anchorType) Sets the anchor type.voidsetColumnIndex(int columnIndex) set the left-top cell's column indexvoidsetHeight(int height) set the height of the anchor in pixels.voidsetRowIndex(int rowIndex) set the left-top cell's row indexvoidsetWidth(int width) Set width of the anchor in pixels.voidsetXOffset(int xOffset) voidsetYOffset(int yOffset) toString()
-
Constructor Details
-
ViewAnchor
public ViewAnchor(int rowIndex, int columnIndex, int width, int height) Create a view anchor with indexes for left-top corner cell, width, and height. -
ViewAnchor
public ViewAnchor(int rowIndex, int columnIndex, int xOffset, int yOffset, int width, int height) Create a view anchor with indexes for left-top corner cell, x and y offset in the cell, width, and height. -
ViewAnchor
public ViewAnchor(int rowIndex, int columnIndex, int xOffset, int yOffset, int width, int height, ViewAnchor.AnchorType anchorType) Create a view anchor with indexes for left-top corner cell, x and y offset in the cell, width, height, andViewAnchor.AnchorType.- Parameters:
rowIndex-columnIndex-xOffset-yOffset-width-height-anchorType-
-
-
Method Details
-
getRowIndex
public int getRowIndex()- Returns:
- the left-top cell's row index
-
setRowIndex
public void setRowIndex(int rowIndex) set the left-top cell's row index -
getColumnIndex
public int getColumnIndex()- Returns:
- the left-top cell's column index
-
setColumnIndex
public void setColumnIndex(int columnIndex) set the left-top cell's column index -
getXOffset
public int getXOffset()The x offset to left border of the anchor's left-top cell. The offset is larger if the anchor's position is closer to the right of the cell.- Returns:
- the x coordinate within the anchor's left-top cell.
-
setXOffset
public void setXOffset(int xOffset) -
getYOffset
public int getYOffset()The y offset to top border of the anchor's left-top cell. The offset is larger if the anchor's position is closer to the bottom of the cell.- Returns:
- the y coordinate within the anchor's left-top cell.
-
setYOffset
public void setYOffset(int yOffset) -
getWidth
public int getWidth()Width of the anchor, in pixels.- Returns:
- Width of the anchor
-
setWidth
public void setWidth(int width) Set width of the anchor in pixels.- Parameters:
width- the width of the anchor in pixels.
-
getHeight
public int getHeight()- Returns:
- height the height of the anchor in pixels.
-
setHeight
public void setHeight(int height) set the height of the anchor in pixels.- Parameters:
height- height of the anchor in pixels
-
getRightBottomAnchor
- Returns:
- Returns the right-bottom anchor with 0 height and width based on the anchor. Its offset is calculated depending on a sheet's row height and column width.
-
cloneViewAnchor
-
getAnchorType
Returns the anchor type. Default:ViewAnchor.AnchorType.MOVE_AND_RESIZE- Since:
- 5.9.0
-
setAnchorType
Sets the anchor type.- Since:
- 5.9.0
-
toString
-