| Method from jxl.biff.drawing.Drawing Detail: |
public final int getBlipId() {
if (!initialized)
{
initialize();
}
return blipId;
}
|
public double getColumn() {
return getX();
}
|
public DrawingGroup getDrawingGroup() {
return drawingGroup;
}
Accessor for the drawing group |
public double getHeight() {
if (!initialized)
{
initialize();
}
return height;
}
Accessor for the height of this drawing |
public double getHeight(LengthUnit unit) {
double heightInPoints = getHeightInPoints();
return heightInPoints * LengthConverter.getConversionFactor
(LengthUnit.POINTS, unit);
}
Get the height of this image as rendered within Excel |
public double getHorizontalResolution(LengthUnit unit) {
int res = getPngReader().getHorizontalResolution();
return res / LengthConverter.getConversionFactor(LengthUnit.METRES, unit);
}
Gets the horizontal resolution of the image, if that information
is available. |
protected Drawing.ImageAnchorProperties getImageAnchor() {
if (!initialized)
{
initialize();
}
return imageAnchorProperties;
}
Accessor for the anchor properties |
public byte[] getImageBytes() throws IOException {
if (origin == Origin.READ || origin == Origin.READ_WRITE)
{
return getImageData();
}
Assert.verify(origin == Origin.WRITE);
if (imageFile == null)
{
Assert.verify(imageData != null);
return imageData;
}
byte[] data = new byte[(int) imageFile.length()];
FileInputStream fis = new FileInputStream(imageFile);
fis.read(data, 0, data.length);
fis.close();
return data;
}
Accessor for the image data |
public byte[] getImageData() {
Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE);
if (!initialized)
{
initialize();
}
return drawingGroup.getImageData(blipId);
}
Accessor for the image data |
public File getImageFile() {
return imageFile;
}
Accessor for the image file |
public String getImageFilePath() {
if (imageFile == null)
{
// return the blip id, if it exists
return blipId != 0 ? Integer.toString(blipId) : "__new__image__";
}
return imageFile.getPath();
}
Accessor for the image file path. Normally this is the absolute path
of a file on the directory system, but if this drawing was constructed
using an byte[] then the blip id is returned |
public int getImageHeight() {
return getPngReader().getHeight();
}
Gets the height of the image. Note that this is the height of the
underlying image, and does not take into account any size manipulations
that may have occurred when the image was added into Excel |
public int getImageWidth() {
return getPngReader().getWidth();
}
Gets the width of the image. Note that this is the width of the
underlying image, and does not take into account any size manipulations
that may have occurred when the image was added into Excel |
public MsoDrawingRecord getMsoDrawingRecord() {
return msoDrawingRecord;
}
Gets the drawing record which was read in |
public final int getObjectId() {
if (!initialized)
{
initialize();
}
return objectId;
}
Accessor for the object id |
public Origin getOrigin() {
return origin;
}
Gets the origin of this drawing |
public int getReferenceCount() {
return referenceCount;
}
Accessor for the reference count on this drawing |
public double getRow() {
return getY();
}
|
public int getShapeId() {
if (!initialized)
{
initialize();
}
return shapeId;
}
Accessor for the shape id |
public EscherContainer getSpContainer() {
if (!initialized)
{
initialize();
}
if (origin == Origin.READ)
{
return getReadSpContainer();
}
SpContainer spContainer = new SpContainer();
Sp sp = new Sp(type, shapeId, 2560);
spContainer.add(sp);
Opt opt = new Opt();
opt.addProperty(260, true, false, blipId);
if (type == ShapeType.PICTURE_FRAME)
{
String filePath = imageFile != null ? imageFile.getPath() : "";
opt.addProperty(261, true, true, filePath.length() * 2, filePath);
opt.addProperty(447, false, false, 65536);
opt.addProperty(959, false, false, 524288);
spContainer.add(opt);
}
ClientAnchor clientAnchor = new ClientAnchor
(x, y, x + width, y + height,
imageAnchorProperties.getValue());
spContainer.add(clientAnchor);
ClientData clientData = new ClientData();
spContainer.add(clientData);
return spContainer;
}
Creates the main Sp container for the drawing |
public ShapeType getType() {
return type;
}
|
public double getVerticalResolution(LengthUnit unit) {
int res = getPngReader().getVerticalResolution();
return res / LengthConverter.getConversionFactor(LengthUnit.METRES, unit);
}
Gets the vertical resolution of the image, if that information
is available. |
public double getWidth() {
if (!initialized)
{
initialize();
}
return width;
}
Accessor for the width of this drawing |
public double getWidth(LengthUnit unit) {
double widthInPoints = getWidthInPoints();
return widthInPoints * LengthConverter.getConversionFactor
(LengthUnit.POINTS, unit);
}
Get the width of this image as rendered within Excel |
public double getX() {
if (!initialized)
{
initialize();
}
return x;
}
Accessor for the column of this drawing |
public double getY() {
if (!initialized)
{
initialize();
}
return y;
}
Accessor for the row of this drawing |
public boolean isFirst() {
return msoDrawingRecord.isFirst();
}
Accessor for the first drawing on the sheet. This is used when
copying unmodified sheets to indicate that this drawing contains
the first time Escher gubbins |
public boolean isFormObject() {
return false;
}
Queries whether this object is a form object. Form objects have their
drawings records spread over TXO and CONTINUE records and
require special handling |
public void removeRow(int r) {
if (y > r)
{
setY(r);
}
}
|
public void setDrawingGroup(DrawingGroup dg) {
drawingGroup = dg;
}
Sets the drawing group for this drawing. Called by the drawing group
when this drawing is added to it |
public void setHeight(double h) {
if (origin == Origin.READ)
{
if (!initialized)
{
initialize();
}
origin = Origin.READ_WRITE;
}
height = h;
}
Accessor for the height of this drawing |
protected void setImageAnchor(Drawing.ImageAnchorProperties iap) {
imageAnchorProperties = iap;
if (origin == Origin.READ)
{
origin = Origin.READ_WRITE;
}
}
Accessor for the anchor properties |
public final void setObjectId(int objid,
int bip,
int sid) {
objectId = objid;
blipId = bip;
shapeId = sid;
if (origin == Origin.READ)
{
origin = Origin.READ_WRITE;
}
}
Sets the object id. Invoked by the drawing group when the object is
added to id |
public void setReferenceCount(int r) {
referenceCount = r;
}
Sets the new reference count on the drawing |
public void setWidth(double w) {
if (origin == Origin.READ)
{
if (!initialized)
{
initialize();
}
origin = Origin.READ_WRITE;
}
width = w;
}
|
public void setX(double x) {
if (origin == Origin.READ)
{
if (!initialized)
{
initialize();
}
origin = Origin.READ_WRITE;
}
this.x = x;
}
Sets the column position of this drawing |
public void setY(double y) {
if (origin == Origin.READ)
{
if (!initialized)
{
initialize();
}
origin = Origin.READ_WRITE;
}
this.y = y;
}
Accessor for the row of the drawing |
public void writeAdditionalRecords(File outputFile) throws IOException {
if (origin == Origin.READ)
{
outputFile.write(objRecord);
return;
}
// Create the obj record
ObjRecord objrec = new ObjRecord(objectId,
ObjRecord.PICTURE);
outputFile.write(objrec);
}
Writes any other records associated with this drawing group object |
public void writeTailRecords(File outputFile) throws IOException {
// does nothing
}
Writes any records that need to be written after all the drawing group
objects have been written
Does nothing here |