Package loci.poi.hssf.usermodel
Class HSSFClientAnchor
java.lang.Object
loci.poi.hssf.usermodel.HSSFAnchor
loci.poi.hssf.usermodel.HSSFClientAnchor
A client anchor is attached to an excel worksheet. It anchors against a
top-left and buttom-right cell.
- Author:
- Glen Stampoultzis (glens at apache.org)
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new client anchor and defaults all the anchor positions to 0.HSSFClientAnchor(int dx1, int dy1, int dx2, int dy2, short col1, int row1, short col2, int row2) Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAnchorHeightInPoints(HSSFSheet sheet) Calculates the height of a client anchor in points.intGets the anchor typeshortgetCol1()shortgetCol2()intgetRow1()intgetRow2()booleanbooleanvoidsetAnchor(short col1, int row1, int x1, int y1, short col2, int row2, int x2, int y2) Dets the top-left and bottom-right coordinates of the anchor.voidsetAnchorType(int anchorType) Sets the anchor typevoidsetCol1(short col1) voidsetCol2(short col2) voidsetRow1(int row1) voidsetRow2(int row2)
-
Constructor Details
-
HSSFClientAnchor
public HSSFClientAnchor()Creates a new client anchor and defaults all the anchor positions to 0. -
HSSFClientAnchor
public HSSFClientAnchor(int dx1, int dy1, int dx2, int dy2, short col1, int row1, short col2, int row2) Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor.- Parameters:
dx1- the x coordinate within the first cell.dy1- the y coordinate within the first cell.dx2- the x coordinate within the second cell.dy2- the y coordinate within the second cell.col1- the column (0 based) of the first cell.row1- the row (0 based) of the first cell.col2- the column (0 based) of the second cell.row2- the row (0 based) of the second cell.
-
-
Method Details
-
getAnchorHeightInPoints
Calculates the height of a client anchor in points.- Parameters:
sheet- the sheet the anchor will be attached to- Returns:
- the shape height.
-
getCol1
public short getCol1() -
setCol1
public void setCol1(short col1) -
getCol2
public short getCol2() -
setCol2
public void setCol2(short col2) -
getRow1
public int getRow1() -
setRow1
public void setRow1(int row1) -
getRow2
public int getRow2() -
setRow2
public void setRow2(int row2) -
setAnchor
public void setAnchor(short col1, int row1, int x1, int y1, short col2, int row2, int x2, int y2) Dets the top-left and bottom-right coordinates of the anchor.- Parameters:
x1- the x coordinate within the first cell.y1- the y coordinate within the first cell.x2- the x coordinate within the second cell.y2- the y coordinate within the second cell.col1- the column (0 based) of the first cell.row1- the row (0 based) of the first cell.col2- the column (0 based) of the second cell.row2- the row (0 based) of the second cell.
-
isHorizontallyFlipped
public boolean isHorizontallyFlipped()- Specified by:
isHorizontallyFlippedin classHSSFAnchor- Returns:
- true if the anchor goes from right to left.
-
isVerticallyFlipped
public boolean isVerticallyFlipped()- Specified by:
isVerticallyFlippedin classHSSFAnchor- Returns:
- true if the anchor goes from bottom to top.
-
getAnchorType
public int getAnchorType()Gets the anchor type0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
-
setAnchorType
public void setAnchorType(int anchorType) Sets the anchor type0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
-