本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextShape.getSheet()
方法的一些代码示例,展示了XSLFTextShape.getSheet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFTextShape.getSheet()
方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFTextShape
类名称:XSLFTextShape
方法名:getSheet
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public XSLFHyperlink getHyperlink(){
CTTextCharacterProperties rPr = getRPr(false);
if (rPr == null) {
return null;
}
CTHyperlink hl = rPr.getHlinkClick();
if (hl == null) {
return null;
}
return new XSLFHyperlink(hl, _p.getParentShape().getSheet());
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public XSLFHyperlink createHyperlink(){
XSLFHyperlink hl = getHyperlink();
if (hl != null) {
return hl;
}
CTTextCharacterProperties rPr = getRPr(true);
return new XSLFHyperlink(rPr.addNewHlinkClick(), _p.getParentShape().getSheet());
}
代码示例来源:origin: org.apache.poi/poi-ooxml
boolean fetchThemeProperty(final ParagraphPropertyFetcher<?> visitor) {
final XSLFTextShape shape = getParentShape();
if (shape.isPlaceholder()) {
return false;
}
// if it is a plain text box then take defaults from presentation.xml
@SuppressWarnings("resource")
final XMLSlideShow ppt = shape.getSheet().getSlideShow();
final CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getIndentLevel());
return themeProps != null && visitor.fetch(themeProps);
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public void clearTabStops() {
final XSLFSheet sheet = getParentShape().getSheet();
CTTextParagraphProperties tpp = (sheet instanceof XSLFSlideMaster) ? getDefaultMasterStyle() : getXmlObject().getPPr();
if (tpp != null && tpp.isSetTabLst()) {
tpp.unsetTabLst();
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
*
* @return the color of bullet characters within a given paragraph.
* A <code>null</code> value means to use the text font color.
*/
@SuppressWarnings("WeakerAccess")
public PaintStyle getBulletFontColor(){
final XSLFTheme theme = getParentShape().getSheet().getTheme();
ParagraphPropertyFetcher<Color> fetcher = new ParagraphPropertyFetcher<Color>(getIndentLevel()){
public boolean fetch(CTTextParagraphProperties props){
if(props.isSetBuClr()){
XSLFColor c = new XSLFColor(props.getBuClr(), theme, null);
setValue(c.getColor());
return true;
}
return false;
}
};
fetchParagraphProperty(fetcher);
Color col = fetcher.getValue();
return (col == null) ? null : DrawPaint.createSolidPaint(col);
}
代码示例来源:origin: org.apache.poi/poi-ooxml
private void fetchParagraphProperty(final ParagraphPropertyFetcher<?> visitor){
final XSLFTextShape shape = getParentShape();
final XSLFSheet sheet = shape.getSheet();
if (!(sheet instanceof XSLFSlideMaster)) {
if (_p.isSetPPr() && visitor.fetch(_p.getPPr())) {
return;
}
if (shape.fetchShapeProperty(visitor)) {
return;
}
if (fetchThemeProperty(visitor)) {
return;
}
}
fetchMasterProperty(visitor);
}
代码示例来源:origin: org.apache.poi/poi-ooxml
if (typeface.startsWith("+mj-") || typeface.startsWith("+mn-")) {
final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
CTFontScheme fontTheme = theme.getXmlObject().getThemeElements().getFontScheme();
CTFontCollection coll = typeface.startsWith("+mj-")
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public void setFontColor(PaintStyle color) {
if (!(color instanceof SolidPaint)) {
LOG.log(POILogger.WARN, "Currently only SolidPaint is supported!");
return;
}
SolidPaint sp = (SolidPaint)color;
Color c = DrawPaint.applyColorTransform(sp.getSolidColor());
CTTextCharacterProperties rPr = getRPr(true);
CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill();
XSLFColor col = new XSLFColor(fill, getParentParagraph().getParentShape().getSheet().getTheme(), fill.getSchemeClr());
col.setColor(c);
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public void addTabStops(double positionInPoints, TabStopType tabStopType) {
final XSLFSheet sheet = getParentShape().getSheet();
final CTTextParagraphProperties tpp;
if (sheet instanceof XSLFSlideMaster) {
tpp = getDefaultMasterStyle();
} else {
final CTTextParagraph xo = getXmlObject();
tpp = (xo.isSetPPr()) ? xo.getPPr() : xo.addNewPPr();
}
if (tpp == null) {
return;
}
final CTTextTabStopList stl = (tpp.isSetTabLst()) ? tpp.getTabLst() : tpp.addNewTabLst();
XSLFTabStop tab = new XSLFTabStop(stl.addNewTab());
tab.setPositionInPoints(positionInPoints);
tab.setType(tabStopType);
}
代码示例来源:origin: org.apache.poi/poi-ooxml
XSLFSheet masterSheet = _shape.getSheet();
for (XSLFSheet m = masterSheet; m != null; m = (XSLFSheet)m.getMasterSheet()) {
masterSheet = m;
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public XSLFHyperlink getHyperlink(){
CTTextCharacterProperties rPr = getRPr(false);
if (rPr == null) {
return null;
}
CTHyperlink hl = rPr.getHlinkClick();
if (hl == null) {
return null;
}
return new XSLFHyperlink(hl, _p.getParentShape().getSheet());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public XSLFHyperlink createHyperlink(){
XSLFHyperlink hl = getHyperlink();
if (hl != null) {
return hl;
}
CTTextCharacterProperties rPr = getRPr(true);
return new XSLFHyperlink(rPr.addNewHlinkClick(), _p.getParentShape().getSheet());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
boolean fetchThemeProperty(final ParagraphPropertyFetcher<?> visitor) {
final XSLFTextShape shape = getParentShape();
if (shape.isPlaceholder()) {
return false;
}
// if it is a plain text box then take defaults from presentation.xml
@SuppressWarnings("resource")
final XMLSlideShow ppt = shape.getSheet().getSlideShow();
final CTTextParagraphProperties themeProps = ppt.getDefaultParagraphStyle(getIndentLevel());
return themeProps != null && visitor.fetch(themeProps);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public void clearTabStops() {
final XSLFSheet sheet = getParentShape().getSheet();
CTTextParagraphProperties tpp = (sheet instanceof XSLFSlideMaster) ? getDefaultMasterStyle() : getXmlObject().getPPr();
if (tpp != null && tpp.isSetTabLst()) {
tpp.unsetTabLst();
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public byte getPitchAndFamily(){
final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
CharacterPropertyFetcher<Byte> visitor = new CharacterPropertyFetcher<Byte>(_p.getLevel()){
public boolean fetch(CTTextCharacterProperties props){
CTTextFont font = props.getLatin();
if(font != null){
setValue(font.getPitchFamily());
return true;
}
return false;
}
};
fetchCharacterProperty(visitor);
return visitor.getValue() == null ? 0 : visitor.getValue();
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public void setAddress(String address){
XSLFSheet sheet = _r.getParentParagraph().getParentShape().getSheet();
PackageRelationship rel =
sheet.getPackagePart().
addExternalRelationship(address, XSLFRelation.HYPERLINK.getRelation());
_link.setId(rel.getId());
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
@Internal
public URI getTargetURI(){
XSLFSheet sheet = _r.getParentParagraph().getParentShape().getSheet();
String id = _link.getId();
return sheet.getPackagePart().getRelationship(id).getTargetURI();
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public void setAddress(XSLFSlide slide){
XSLFSheet sheet = _r.getParentParagraph().getParentShape().getSheet();
PackageRelationship rel =
sheet.getPackagePart().
addRelationship(slide.getPackagePart().getPartName(),
TargetMode.INTERNAL,
XSLFRelation.SLIDE.getRelation());
_link.setId(rel.getId());
_link.setAction("ppaction://hlinksldjump");
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public void setFontColor(PaintStyle color) {
if (!(color instanceof SolidPaint)) {
LOG.log(POILogger.WARN, "Currently only SolidPaint is supported!");
return;
}
SolidPaint sp = (SolidPaint)color;
Color c = DrawPaint.applyColorTransform(sp.getSolidColor());
CTTextCharacterProperties rPr = getRPr(true);
CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill();
XSLFColor col = new XSLFColor(fill, getParentParagraph().getParentShape().getSheet().getTheme(), fill.getSchemeClr());
col.setColor(c);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public void addTabStops(double positionInPoints, TabStopType tabStopType) {
final XSLFSheet sheet = getParentShape().getSheet();
final CTTextParagraphProperties tpp;
if (sheet instanceof XSLFSlideMaster) {
tpp = getDefaultMasterStyle();
} else {
final CTTextParagraph xo = getXmlObject();
tpp = (xo.isSetPPr()) ? xo.getPPr() : xo.addNewPPr();
}
if (tpp == null) {
return;
}
final CTTextTabStopList stl = (tpp.isSetTabLst()) ? tpp.getTabLst() : tpp.addNewTabLst();
XSLFTabStop tab = new XSLFTabStop(stl.addNewTab());
tab.setPositionInPoints(positionInPoints);
tab.setType(tabStopType);
}
内容来源于网络,如有侵权,请联系作者删除!