use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.
the class ActiveXShape method createSpContainer.
/**
* Create a new Placeholder and initialize internal structures
*
* @return the created <code>EscherContainerRecord</code> which holds shape data
*/
@Override
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) {
EscherContainerRecord ecr = super.createSpContainer(idx, isChild);
EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
spRecord.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE | EscherSpRecord.FLAG_OLESHAPE);
setShapeType(ShapeType.HOST_CONTROL);
setEscherProperty(EscherProperties.BLIP__PICTUREID, idx);
setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001);
setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008);
setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, -1);
HSLFEscherClientDataRecord cldata = getClientData(true);
cldata.addChild(new ExObjRefAtom());
return ecr;
}
use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.
the class MovieShape method createSpContainer.
/**
* Create a new Placeholder and initialize internal structures
*
* @return the created <code>EscherContainerRecord</code> which holds shape data
*/
@Override
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) {
EscherContainerRecord ecr = super.createSpContainer(idx, isChild);
setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x1000100);
setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x10001);
ExObjRefAtom oe = new ExObjRefAtom();
InteractiveInfo info = new InteractiveInfo();
InteractiveInfoAtom infoAtom = info.getInteractiveInfoAtom();
infoAtom.setAction(InteractiveInfoAtom.ACTION_MEDIA);
infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_NULL);
AnimationInfo an = new AnimationInfo();
AnimationInfoAtom anAtom = an.getAnimationInfoAtom();
anAtom.setFlag(AnimationInfoAtom.Automatic, true);
HSLFEscherClientDataRecord cldata = getClientData(true);
cldata.addChild(oe);
cldata.addChild(an);
cldata.addChild(info);
return ecr;
}
use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.
the class OLEShape method setObjectID.
/**
* Set the unique identifier for the OLE object and
* register it in the necessary structures
*
* @param objectId the unique identifier for the OLE object
*/
public void setObjectID(int objectId) {
setEscherProperty(EscherProperties.BLIP__PICTUREID, objectId);
EscherContainerRecord ecr = getSpContainer();
EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
spRecord.setFlags(spRecord.getFlags() | EscherSpRecord.FLAG_OLESHAPE);
HSLFEscherClientDataRecord cldata = getClientData(true);
ExObjRefAtom uer = null;
for (Record r : cldata.getHSLFChildRecords()) {
if (r.getRecordType() == RecordTypes.ExObjRefAtom.typeID) {
uer = (ExObjRefAtom) r;
break;
}
}
if (uer == null) {
uer = new ExObjRefAtom();
cldata.addChild(uer);
}
uer.setExObjIdRef(objectId);
}
use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.
the class HSLFShape method getClientData.
/**
* Create a new HSLF-specific EscherClientDataRecord
*
* @param create if true, create the missing record
* @return the client record or null if it was missing and create wasn't activated
*/
protected HSLFEscherClientDataRecord getClientData(boolean create) {
HSLFEscherClientDataRecord clientData = getEscherChild(EscherClientDataRecord.RECORD_ID);
if (clientData == null && create) {
clientData = new HSLFEscherClientDataRecord();
clientData.setOptions((short) 15);
clientData.setRecordId(EscherClientDataRecord.RECORD_ID);
getSpContainer().addChildBefore(clientData, EscherTextboxRecord.RECORD_ID);
}
return clientData;
}
use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.
the class HSLFHyperlink method createHyperlink.
/**
* Creates a new Hyperlink and assign it to a shape
* This is only a helper method - use {@link HSLFSimpleShape#createHyperlink()} instead!
*
* @param shape the shape which receives the hyperlink
* @return the new hyperlink
*
* @see HSLFSimpleShape#createHyperlink()
*/
/* package */
static HSLFHyperlink createHyperlink(HSLFSimpleShape shape) {
// TODO: check if a hyperlink already exists
ExHyperlink exHyper = new ExHyperlink();
int linkId = shape.getSheet().getSlideShow().addToObjListAtom(exHyper);
ExHyperlinkAtom obj = exHyper.getExHyperlinkAtom();
obj.setNumber(linkId);
InteractiveInfo info = new InteractiveInfo();
info.getInteractiveInfoAtom().setHyperlinkID(linkId);
HSLFEscherClientDataRecord cldata = shape.getClientData(true);
cldata.addChild(info);
HSLFHyperlink hyper = new HSLFHyperlink(exHyper, info);
hyper.linkToNextSlide();
shape.setHyperlink(hyper);
return hyper;
}
Aggregations