use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method setLineTailWidth.
public void setLineTailWidth(DecorationSize decoSize) {
AbstractEscherOptRecord opt = getEscherOptRecord();
setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWWIDTH, decoSize == null ? -1 : decoSize.nativeId);
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class TestBugs method bug46441.
@Test
public void bug46441() throws IOException {
HSLFSlideShow ppt = open("bug46441.ppt");
HSLFAutoShape as = (HSLFAutoShape) ppt.getSlides().get(0).getShapes().get(0);
AbstractEscherOptRecord opt = as.getEscherOptRecord();
EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__SHADECOLORS);
double[][] exp = { // r, g, b, position
{ 94, 158, 255, 0 }, { 133, 194, 255, 0.399994 }, { 196, 214, 235, 0.699997 }, { 255, 235, 250, 1 } };
int i = 0;
for (byte[] data : ep) {
EscherColorRef ecr = new EscherColorRef(data, 0, 4);
int[] rgb = ecr.getRGB();
double pos = Units.fixedPointToDouble(LittleEndian.getInt(data, 4));
assertEquals((int) exp[i][0], rgb[0]);
assertEquals((int) exp[i][1], rgb[1]);
assertEquals((int) exp[i][2], rgb[2]);
assertEquals(exp[i][3], pos, 0.01);
i++;
}
ppt.close();
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFFill method setPictureData.
/**
* Assign picture used to fill the underlying shape.
*
* @param data the picture data added to this ppt by {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} method.
*/
public void setPictureData(HSLFPictureData data) {
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
HSLFShape.setEscherProperty(opt, (short) (EscherProperties.FILL__PATTERNTEXTURE + 0x4000), (data == null ? 0 : data.getIndex()));
if (data != null && shape.getSheet() != null) {
EscherBSERecord bse = getEscherBSERecord(data.getIndex());
if (bse != null) {
bse.setRef(bse.getRef() + 1);
}
}
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFFill method setFillType.
/**
* Sets fill type.
* Must be one of the <code>FILL_*</code> constants defined in this class.
*
* @param type type of the fill
*/
public void setFillType(int type) {
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
HSLFShape.setEscherProperty(opt, EscherProperties.FILL__FILLTYPE, type);
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFFill method afterInsert.
/**
*/
protected void afterInsert(HSLFSheet sh) {
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
if (p != null) {
int idx = p.getPropertyValue();
EscherBSERecord bse = getEscherBSERecord(idx);
if (bse != null) {
bse.setRef(bse.getRef() + 1);
}
}
}
Aggregations