use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFFill method getForegroundColor.
/**
* Foreground color
*/
public Color getForegroundColor() {
AbstractEscherOptRecord opt = shape.getEscherOptRecord();
EscherSimpleProperty p = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST);
int propVal = (p == null) ? 0 : p.getPropertyValue();
return (FILL_USE_FILLED.isSet(propVal) && !FILL_FILLED.isSet(propVal)) ? null : shape.getColor(EscherProperties.FILL__FILLCOLOR, EscherProperties.FILL__FILLOPACITY, -1);
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFLine method createSpContainer.
@Override
protected EscherContainerRecord createSpContainer(boolean isChild) {
EscherContainerRecord ecr = super.createSpContainer(isChild);
setShapeType(ShapeType.LINE);
EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
short type = (short) ((ShapeType.LINE.nativeId << 4) | 0x2);
spRecord.setOptions(type);
//set default properties for a line
AbstractEscherOptRecord opt = getEscherOptRecord();
//default line properties
setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4);
setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, 0x10000);
setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x100000);
setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, 0x8000001);
setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0xA0008);
setEscherProperty(opt, EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
return ecr;
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFPictureShape method createSpContainer.
/**
* Create a new Picture and populate the inital structure of the <code>EscherSp</code> record which holds information about this picture.
* @param idx the index of the picture which refers to <code>EscherBSE</code> container.
* @return the create Picture object
*/
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) {
EscherContainerRecord ecr = super.createSpContainer(isChild);
EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
spRecord.setOptions((short) ((ShapeType.FRAME.nativeId << 4) | 0x2));
//set default properties for a picture
AbstractEscherOptRecord opt = getEscherOptRecord();
setEscherProperty(opt, EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x800080);
//another weird feature of powerpoint: for picture id we must add 0x4000.
setEscherProperty(opt, (short) (EscherProperties.BLIP__BLIPTODISPLAY + 0x4000), idx);
return ecr;
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFSimpleShape method setLineTailDecoration.
public void setLineTailDecoration(DecorationShape decoShape) {
AbstractEscherOptRecord opt = getEscherOptRecord();
setEscherProperty(opt, EscherProperties.LINESTYLE__LINEENDARROWHEAD, decoShape == null ? -1 : decoShape.nativeId);
}
use of org.apache.poi.ddf.AbstractEscherOptRecord in project poi by apache.
the class HSLFTextShape method getWordWrapEx.
/**
* Returns the value indicating word wrap.
*
* @return the value indicating word wrap.
* Must be one of the <code>Wrap*</code> constants defined in this class.
*
* @see <a href="https://msdn.microsoft.com/en-us/library/dd948168(v=office.12).aspx">MSOWRAPMODE</a>
*/
public int getWordWrapEx() {
AbstractEscherOptRecord opt = getEscherOptRecord();
EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.TEXT__WRAPTEXT);
return prop == null ? WrapSquare : prop.getPropertyValue();
}
Aggregations