Examples of OdfStyleProperty


Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

      cellBackgroundColor = DEFAULT_BACKGROUND_COLOR;
    }
    splitRepeatedCells();
    OdfStyleBase styleElement = getCellStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "background-color"));
      styleElement.setProperty(bkColorProperty, cellBackgroundColor);
    }
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

   */
  @Deprecated
  public String getHorizontalAlignment() {
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.ParagraphProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "text-align"));
      return styleElement.getProperty(property);
    }
    return null;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

      horizontalAlignment = FoTextAlignAttribute.Value.END.toString();
    }
    splitRepeatedCells();
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.ParagraphProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "text-align"));
      if (horizontalAlignment != null) {
        styleElement.setProperty(property, horizontalAlignment);
      } else {
        styleElement.removeProperty(property);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

   */
  @Deprecated
  public String getVerticalAlignment() {
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName
          .newName(OdfDocumentNamespace.STYLE, "vertical-align"));
      return styleElement.getProperty(property);
    }
    return null;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

  @Deprecated
  public void setVerticalAlignment(String verticalAlignment) {
    splitRepeatedCells();
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName
          .newName(OdfDocumentNamespace.STYLE, "vertical-align"));
      if (verticalAlignment != null) {
        styleElement.setProperty(property, verticalAlignment);
      } else {
        styleElement.removeProperty(property);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

  @Deprecated
  public String getCellBackgroundColorString() {
    String color = DEFAULT_BACKGROUND_COLOR;
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "background-color"));
      String property = styleElement.getProperty(bkColorProperty);
      if (Color.isValid(property)) {
        color = property;
      }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

      cellBackgroundColor = DEFAULT_BACKGROUND_COLOR;
    }
    splitRepeatedCells();
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "background-color"));
      styleElement.setProperty(bkColorProperty, cellBackgroundColor);
    }
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

        //check if properties include all search properties and value equal
        Iterator<OdfStyleProperty> pIter = mProps.keySet().iterator();
        boolean isStyle = false;
        while (pIter.hasNext()) {
          isStyle = false;
          OdfStyleProperty p = pIter.next();
          if (map.containsKey(p)) {
            if (map.get(p).equals(mProps.get(p))) {
              isStyle = true;
            } else {
              break;
            }
          } else {
            break;
          }
        }
        //put all match style names
        if (isStyle) {
          sname = sStyle.getStyleNameAttribute();
          //if(sname.contains("default"))sname="defaultstyle";
          styleNames.add(sname);
        }
      }
      //get all automatic styles
      Iterator<OdfStyle> cStyles = mTextDocument.getContentDom().getAutomaticStyles().getAllStyles().iterator();
      while (cStyles.hasNext()) {
        OdfStyle cStyle = cStyles.next();
        //get default properties and style properties
        Map<OdfStyleProperty, String> map = cStyle.getStylePropertiesDeep();

        if (cStyle.getParentStyle() == null) {
          if (cStyle.getFamilyName().equals("text")) {
            if (defaultStyles.containsKey("text")) {
              getTextDefaultProperties("text", defaultStyles, map);
            } else {
              getTextDefaultProperties("paragraph", defaultStyles, map);
            }
          }
        }

        //check if the search properties is in properties
        Iterator<OdfStyleProperty> pIter = mProps.keySet().iterator();
        boolean isStyle = false;
        while (pIter.hasNext()) {
          isStyle = false;
          OdfStyleProperty p = pIter.next();
          if (map.containsKey(p)) {
            if (map.get(p).equals(mProps.get(p))) {
              isStyle = true;
            } else {
              break;
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

   *            if it is true, the row can fit the height to the text, vice
   *            versa.
   */
  public void setHeight(double height, boolean isMinHeight) {
    double roundingFactor = 10000.0;
    OdfStyleProperty rowHeightProp = isMinHeight ? OdfTableRowProperties.MinRowHeight : OdfTableRowProperties.RowHeight;
    // TODO:need refactor to PositiveLength.
    double inValue = Math.round(roundingFactor * height / Unit.INCH.unitInMillimiter()) / roundingFactor;
    String sHeightIN = String.valueOf(inValue) + Unit.INCH.abbr();
    splitRepeatedRows();
    maRowElement.removeAttributeNS(OdfDocumentNamespace.TABLE.getUri(), "style-name");
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.style.props.OdfStyleProperty

   */
  @Deprecated
  public String getHorizontalAlignment() {
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.ParagraphProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "text-align"));
      return styleElement.getProperty(property);
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.