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

x33g5p2x  于2022-02-03 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(120)

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

XSLFTextShape.fetchShapeProperty介绍

暂无

代码示例

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

@Override
public boolean isHorizontalCentered() {
  PropertyFetcher<Boolean> fetcher = new TextBodyPropertyFetcher<Boolean>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetAnchorCtr()) {
        setValue(props.getAnchorCtr());
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? false : fetcher.getValue();
}

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

@Override
public VerticalAlignment getVerticalAlignment() {
  PropertyFetcher<VerticalAlignment> fetcher = new TextBodyPropertyFetcher<VerticalAlignment>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetAnchor()) {
        int val = props.getAnchor().intValue();
        setValue(VerticalAlignment.values()[val - 1]);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? VerticalAlignment.TOP : fetcher.getValue();
}

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

@Override
public boolean getWordWrap() {
  PropertyFetcher<Boolean> fetcher = new TextBodyPropertyFetcher<Boolean>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetWrap()) {
        setValue(props.getWrap() == STTextWrappingType.SQUARE);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? true : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the bottom of the text frame and
 * the bottom of the inscribed rectangle of the shape that contains the
 * text.
 *
 * @return the bottom inset in points
 */
public double getBottomInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetBIns()) {
        double val = Units.toPoints(props.getBIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.05 inches is implied
  return fetcher.getValue() == null ? 3.6 : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the top of the text frame and
 * the top of the inscribed rectangle of the shape that contains the text.
 *
 * @return the top inset in points
 */
public double getTopInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetTIns()) {
        double val = Units.toPoints(props.getTIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.05 inches is implied
  return fetcher.getValue() == null ? 3.6 : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the left edge of the text frame
 * and the left edge of the inscribed rectangle of the shape that contains
 * the text.
 *
 * @return the left inset in points
 */
public double getLeftInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetLIns()) {
        double val = Units.toPoints(props.getLIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.1 inches is implied
  return fetcher.getValue() == null ? 7.2 : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the right edge of the text frame
 * and the right edge of the inscribed rectangle of the shape that contains
 * the text.
 *
 * @return the right inset in points
 */
public double getRightInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetRIns()) {
        double val = Units.toPoints(props.getRIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.1 inches is implied
  return fetcher.getValue() == null ? 7.2 : fetcher.getValue();
}

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

private void fetchCharacterProperty(final CharacterPropertyFetcher<?> visitor){
  XSLFTextShape shape = _p.getParentShape();
  CTTextCharacterProperties rPr = getRPr(false);
  if (rPr != null && visitor.fetch(rPr)) {
    return;
  }
  if (shape.fetchShapeProperty(visitor)) {
    return;
  }
  if (_p.fetchThemeProperty(visitor)) {
    return;
  }
  _p.fetchMasterProperty(visitor);
}

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

@Override
public boolean isHorizontalCentered() {
  PropertyFetcher<Boolean> fetcher = new TextBodyPropertyFetcher<Boolean>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetAnchorCtr()) {
        setValue(props.getAnchorCtr());
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? false : fetcher.getValue();
}

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

@Override
public boolean getWordWrap() {
  PropertyFetcher<Boolean> fetcher = new TextBodyPropertyFetcher<Boolean>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetWrap()) {
        setValue(props.getWrap() == STTextWrappingType.SQUARE);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? true : fetcher.getValue();
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * @return whether to wrap words within the bounding rectangle
 */
public boolean getWordWrap(){
  PropertyFetcher<Boolean> fetcher = new TextBodyPropertyFetcher<Boolean>(){
    public boolean fetch(CTTextBodyProperties props){
      if(props.isSetWrap()){
        setValue(props.getWrap() == STTextWrappingType.SQUARE);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? true : fetcher.getValue();
}

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

@Override
public VerticalAlignment getVerticalAlignment() {
  PropertyFetcher<VerticalAlignment> fetcher = new TextBodyPropertyFetcher<VerticalAlignment>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetAnchor()) {
        int val = props.getAnchor().intValue();
        setValue(VerticalAlignment.values()[val - 1]);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  return fetcher.getValue() == null ? VerticalAlignment.TOP : fetcher.getValue();
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 *  Returns the distance (in points) between the top of the text frame
 *  and the top of the inscribed rectangle of the shape that contains the text.
 *
 * @return the top inset in points
 */
public double getTopInset(){
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>(){
    public boolean fetch(CTTextBodyProperties props){
      if(props.isSetTIns()){
        double val = Units.toPoints(props.getTIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.05 inches is implied
  return fetcher.getValue() == null ? 3.6 : fetcher.getValue();
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Returns the distance (in points) between the bottom of the text frame
 * and the bottom of the inscribed rectangle of the shape that contains the text.
 *
 * @return the bottom inset in points
 */
public double getBottomInset(){
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>(){
    public boolean fetch(CTTextBodyProperties props){
      if(props.isSetBIns()){
        double val = Units.toPoints(props.getBIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.05 inches is implied
  return fetcher.getValue() == null ? 3.6 : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the left edge of the text frame
 * and the left edge of the inscribed rectangle of the shape that contains
 * the text.
 *
 * @return the left inset in points
 */
public double getLeftInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetLIns()) {
        double val = Units.toPoints(props.getLIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.1 inches is implied
  return fetcher.getValue() == null ? 7.2 : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the top of the text frame and
 * the top of the inscribed rectangle of the shape that contains the text.
 *
 * @return the top inset in points
 */
public double getTopInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetTIns()) {
        double val = Units.toPoints(props.getTIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.05 inches is implied
  return fetcher.getValue() == null ? 3.6 : fetcher.getValue();
}

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

/**
 * Returns the distance (in points) between the bottom of the text frame and
 * the bottom of the inscribed rectangle of the shape that contains the
 * text.
 *
 * @return the bottom inset in points
 */
public double getBottomInset() {
  PropertyFetcher<Double> fetcher = new TextBodyPropertyFetcher<Double>() {
    @Override
    public boolean fetch(CTTextBodyProperties props) {
      if (props.isSetBIns()) {
        double val = Units.toPoints(props.getBIns());
        setValue(val);
        return true;
      }
      return false;
    }
  };
  fetchShapeProperty(fetcher);
  // If this attribute is omitted, then a value of 0.05 inches is implied
  return fetcher.getValue() == null ? 3.6 : fetcher.getValue();
}

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

private void fetchCharacterProperty(final CharacterPropertyFetcher<?> visitor){
  XSLFTextShape shape = _p.getParentShape();
  CTTextCharacterProperties rPr = getRPr(false);
  if (rPr != null && visitor.fetch(rPr)) {
    return;
  }
  if (shape.fetchShapeProperty(visitor)) {
    return;
  }
  if (_p.fetchThemeProperty(visitor)) {
    return;
  }
  _p.fetchMasterProperty(visitor);
}

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

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);
}

相关文章