gpt4 book ai didi

org.apache.poi.xslf.usermodel.XSLFTextParagraph.fetchParagraphProperty()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 09:19:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.poi.xslf.usermodel.XSLFTextParagraph.fetchParagraphProperty()方法的一些代码示例,展示了XSLFTextParagraph.fetchParagraphProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFTextParagraph.fetchParagraphProperty()方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFTextParagraph
类名称:XSLFTextParagraph
方法名:fetchParagraphProperty

XSLFTextParagraph.fetchParagraphProperty介绍

暂无

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

@Override
public Double getIndent() {
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetIndent()){
        setValue(Units.toPoints(props.getIndent()));
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

@Override
public Double getDefaultTabSize(){
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetDefTabSz()){
        double val = Units.toPoints(props.getDefTabSz());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

@Override
public TextAlign getTextAlign(){
  ParagraphPropertyFetcher<TextAlign> fetcher = new ParagraphPropertyFetcher<TextAlign>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetAlgn()){
        TextAlign val = TextAlign.values()[props.getAlgn().intValue() - 1];
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

@Override
public FontAlign getFontAlign(){
  ParagraphPropertyFetcher<FontAlign> fetcher = new ParagraphPropertyFetcher<FontAlign>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetFontAlgn()){
        FontAlign val = FontAlign.values()[props.getFontAlgn().intValue() - 1];
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * @return the character to be used in place of the standard bullet point
 */
@SuppressWarnings("WeakerAccess")
public String getBulletCharacter(){
  ParagraphPropertyFetcher<String> fetcher = new ParagraphPropertyFetcher<String>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetBuChar()){
        setValue(props.getBuChar().getChar());
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * @return the font to be used on bullet characters within a given paragraph
 */
@SuppressWarnings("WeakerAccess")
public String getBulletFont(){
  ParagraphPropertyFetcher<String> fetcher = new ParagraphPropertyFetcher<String>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetBuFont()){
        setValue(props.getBuFont().getTypeface());
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * @return the auto numbering starting number, or null if not defined
 */
@SuppressWarnings("WeakerAccess")
public Integer getAutoNumberingStartAt() {
  ParagraphPropertyFetcher<Integer> fetcher = new ParagraphPropertyFetcher<Integer>(getIndentLevel()) {
    public boolean fetch(CTTextParagraphProperties props) {
      if (props.isSetBuAutoNum()) {
        if (props.getBuAutoNum().isSetStartAt()) {
          setValue(props.getBuAutoNum().getStartAt());
          return true;
        }
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 *
 * @return the right margin of the paragraph, null if unset
 */
@Override
public Double getRightMargin(){
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetMarR()){
        double val = Units.toPoints(props.getMarR());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

private Double getSpacing(final Function<CTTextParagraphProperties,Supplier<CTTextSpacing>> getSpc) {
  final ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(final CTTextParagraphProperties props){
      final CTTextSpacing spc = getSpc.apply(props).get();
      if (spc == null) {
        return false;
      }
      if (spc.isSetSpcPct()) {
        setValue( spc.getSpcPct().getVal()*0.001 );
        return true;
      }
      if (spc.isSetSpcPts()) {
        setValue( -spc.getSpcPts().getVal()*0.01 );
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * @return the left margin (in points) of the paragraph, null if unset
 */
@Override
public Double getLeftMargin(){
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetMarL()){
        double val = Units.toPoints(props.getMarL());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  // if the marL attribute is omitted, then a value of 347663 is implied
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * @return the auto numbering scheme, or null if not defined
 */
@SuppressWarnings("WeakerAccess")
public AutoNumberingScheme getAutoNumberingScheme() {
  ParagraphPropertyFetcher<AutoNumberingScheme> fetcher = new ParagraphPropertyFetcher<AutoNumberingScheme>(getIndentLevel()) {
    public boolean fetch(CTTextParagraphProperties props) {
      if (props.isSetBuAutoNum()) {
        AutoNumberingScheme ans = AutoNumberingScheme.forOoxmlID(props.getBuAutoNum().getType().intValue());
        if (ans != null) {
          setValue(ans);
          return true;
        }
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

@Override
public List<XSLFTabStop> getTabStops() {
  ParagraphPropertyFetcher<List<XSLFTabStop>> fetcher = new ParagraphPropertyFetcher<List<XSLFTabStop>>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props) {
      if (props.isSetTabLst()) {
        final List<XSLFTabStop> list = new ArrayList<>();
        //noinspection deprecation
        for (final CTTextTabStop ta : props.getTabLst().getTabArray()) {
          list.add(new XSLFTabStop(ta));
        }
        setValue(list);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();        
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Returns the bullet size that is to be used within a paragraph.
 * This may be specified in two different ways, percentage spacing and font point spacing:
 * <p>
 * If bulletSize >= 0, then bulletSize is a percentage of the font size.
 * If bulletSize < 0, then it specifies the size in points
 * </p>
 *
 * @return the bullet size
 */
@SuppressWarnings("WeakerAccess")
public Double getBulletFontSize(){
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetBuSzPct()){
        setValue(props.getBuSzPct().getVal() * 0.001);
        return true;
      }
      if(props.isSetBuSzPts()){
        setValue( - props.getBuSzPts().getVal() * 0.01);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

@SuppressWarnings("WeakerAccess")
public double getTabStop(final int idx) {
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if (props.isSetTabLst()) {
        CTTextTabStopList tabStops = props.getTabLst();
        if(idx < tabStops.sizeOfTabArray() ) {
          CTTextTabStop ts = tabStops.getTabArray(idx);
          double val = Units.toPoints(ts.getPos());
          setValue(val);
          return true;
        }
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue() == null ? 0. : fetcher.getValue();
}

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Returns whether this paragraph has bullets
 */
public boolean isBullet() {
  ParagraphPropertyFetcher<Boolean> fetcher = new ParagraphPropertyFetcher<Boolean>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetBuNone()) {
        setValue(false);
        return true;
      }
      if(props.isSetBuFont() || props.isSetBuChar()){
        setValue(true);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue() == null ? false : fetcher.getValue();
}

代码示例来源: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.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
public Double getIndent() {
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetIndent()){
        setValue(Units.toPoints(props.getIndent()));
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
public TextAlign getTextAlign(){
  ParagraphPropertyFetcher<TextAlign> fetcher = new ParagraphPropertyFetcher<TextAlign>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetAlgn()){
        TextAlign val = TextAlign.values()[props.getAlgn().intValue() - 1];
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
public Double getDefaultTabSize(){
  ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetDefTabSz()){
        double val = Units.toPoints(props.getDefTabSz());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
public FontAlign getFontAlign(){
  ParagraphPropertyFetcher<FontAlign> fetcher = new ParagraphPropertyFetcher<FontAlign>(getIndentLevel()){
    public boolean fetch(CTTextParagraphProperties props){
      if(props.isSetFontAlgn()){
        FontAlign val = FontAlign.values()[props.getFontAlgn().intValue() - 1];
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchParagraphProperty(fetcher);
  return fetcher.getValue();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com