public final class AnchorCell extends Object implements com.gembox.internal.core.Equatable<AnchorCell>
ExcelDrawingPosition
type to specify from which cell and to which cell drawing (picture, chart, etc.) spans.Constructor and Description |
---|
AnchorCell(AnchorCell anchorCell)
Initializes a new instance of the
AnchorCell class by using another anchor cell. |
AnchorCell(ExcelColumn column,
ExcelRow row,
boolean topLeft)
Initializes a new instance of the
AnchorCell class. |
AnchorCell(ExcelColumn column,
ExcelRow row,
double columnOffset,
double rowOffset,
LengthUnit unit)
Initializes a new instance of the
AnchorCell class by using offset values in arbitrary length unit. |
AnchorCell(ExcelColumn column,
ExcelRow row,
long columnOffset,
long rowOffset)
Initializes a new instance of the
AnchorCell class by using offset values in EMU units (1 point = 12 700 EMU). |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether the specified
java.lang.Object is equal to this AnchorCell instance. |
ExcelColumn |
getColumn()
Gets the column for the anchor cell.
|
long |
getColumnOffset()
Gets the column offset for the anchor cell in EMU units (1 point = 12 700 EMU).
|
double |
getColumnOffset(LengthUnit unit)
Gets the column offset for the anchor cell in arbitrary length unit.
|
ExcelRow |
getRow()
Gets the row for the anchor cell.
|
long |
getRowOffset()
Gets row offset for the anchor cell in EMU units (1 point = 12 700 EMU).
|
double |
getRowOffset(LengthUnit unit)
Gets the row offset for the anchor cell in arbitrary length unit.
|
int |
hashCode()
Returns a hash code for this
AnchorCell instance. |
void |
setColumn(ExcelColumn column)
Sets the column for the anchor cell.
|
void |
setColumnOffset(double value,
LengthUnit unit)
Sets the column offset for the anchor cell in arbitrary length unit.
|
void |
setColumnOffset(long offset)
Sets the column offset for the anchor cell in EMU units (1 point = 12 700 EMU).
|
void |
setRow(ExcelRow row)
Sets the row for the anchor cell.
|
void |
setRowOffset(double value,
LengthUnit unit)
Sets the row offset for the anchor cell in arbitrary length unit.
|
void |
setRowOffset(long offset)
Sets row offset for the anchor cell in EMU units (1 point = 12 700 EMU).
|
String |
toString()
Returns a
String that represents this AnchorCell instance. |
public AnchorCell(AnchorCell anchorCell)
AnchorCell
class by using another anchor cell.anchorCell
- Anchor cell to copy from.NullPointerException
- anchorCell
is null
.public AnchorCell(ExcelColumn column, ExcelRow row, boolean topLeft)
AnchorCell
class.column
- The column where the anchor is placed.row
- The row where the anchor is placed.topLeft
- If set to true
, anchor will be placed in the top left corner of the cell in current column and current row; otherwise, anchor will be placed in the top-left corner of the cell in next column and next row.public AnchorCell(ExcelColumn column, ExcelRow row, double columnOffset, double rowOffset, LengthUnit unit)
AnchorCell
class by using offset values in arbitrary length unit.column
- The column where the anchor is placed.row
- The row where the anchor is placed.columnOffset
- The column offset for the anchor in arbitrary length unit.rowOffset
- The row offset for the anchor in arbitrary length unit.unit
- The length unit in which columnOffset
and rowOffset
are specified.NullPointerException
- column
or row
is null
.IllegalArgumentException
- column
and row
do not belong to the same worksheet.public AnchorCell(ExcelColumn column, ExcelRow row, long columnOffset, long rowOffset)
AnchorCell
class by using offset values in EMU units (1 point = 12 700 EMU).column
- The column where the anchor is placed.row
- The row where the anchor is placed.columnOffset
- The column offset for the anchor.rowOffset
- The row offset for the anchor.NullPointerException
- column
or row
is null
.IllegalArgumentException
- column
and row
do not belong to the same worksheet.public boolean equals(Object obj)
java.lang.Object
is equal to this AnchorCell
instance.equals
in class Object
obj
- The java.lang.Object
to compare with this anchor cell instance.true
if the specified java.lang.Object
is an AnchorCell
and is equal to this AnchorCell
instance; otherwise, false
.public ExcelColumn getColumn()
public long getColumnOffset()
Length unit
for this method is EMU
(English Metric Unit) (1 point = 12 700 EMU) for historical reasons.
Use getColumnOffset(LengthUnit)
method to get the column offset using arbitrary length unit
.
public double getColumnOffset(LengthUnit unit)
getColumn()
.ExcelColumn.getWidth()
.unit
- The length unit in which to return column offset.public ExcelRow getRow()
public long getRowOffset()
Length unit
for this property is EMU
(English Metric Unit) (1 point = 12 700 EMU) for historical reasons.
Use getRowOffset(LengthUnit)
method to get the row offset using arbitrary length unit
.
public double getRowOffset(LengthUnit unit)
getRow()
.ExcelRow.getHeight()
.unit
- The length unit in which to return row offset.public int hashCode()
AnchorCell
instance.hashCode
in class Object
AnchorCell
instance.public void setColumn(ExcelColumn column)
column
- The column for the anchor cell.NullPointerException
- Value is null
.IllegalArgumentException
- Column doesn't belong to the same worksheet as anchor cell row.public void setColumnOffset(double value, LengthUnit unit)
value
- The column offset value.unit
- The length unit in which value
is specified.public void setColumnOffset(long offset)
Length unit
for this method is EMU
(English Metric Unit) (1 point = 12 700 EMU) for historical reasons.
Use setColumnOffset(double, LengthUnit)
method to set the column offset using arbitrary length unit
.
Column offset is constrained to Column
.ExcelColumn.getWidth()
.
offset
- The column offset for the anchor cell in EMU units (1 point = 12 700 EMU).public void setRow(ExcelRow row)
row
- The row for the anchor cell.NullPointerException
- Value is null
.IllegalArgumentException
- Row doesn't belong to the same worksheet as anchor cell column.public void setRowOffset(double value, LengthUnit unit)
value
- The row offset value.unit
- The length unit in which value
is specified.public void setRowOffset(long offset)
Length unit
for this property is EMU
(English Metric Unit) (1 point = 12 700 EMU) for historical reasons.
Use {setRowOffset(double, LengthUnit)
method to set the row offset using arbitrary length unit
.
Row offset is constrained to getRow()
.ExcelRow.getHeight()
.
offset
- The row offset for the anchor cell in EMU units (1 point = 12 700 EMU).public String toString()
String
that represents this AnchorCell
instance.
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
toString
in class Object
String
that represents this AnchorCell
instance.© GemBox d.o.o. — All rights reserved.