Package org.odftoolkit.odfdom.dom.element

Examples of org.odftoolkit.odfdom.dom.element.OdfStyleBase


  public String getCurrencySymbol() {
    if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) {
      throw new IllegalArgumentException();
    }

    OdfStyleBase style = getStyleHandler().getStyleElementForRead();
    if (style != null) {
      String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE,
          "data-style-name"));
      OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName);
      if (dataStyle == null) {
        dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName);
      }
View Full Code Here


   *             <code>getCellBackgroundColor()</code>
   */
  @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;
      }
    }
    return color;
View Full Code Here

      Logger.getLogger(Cell.class.getName()).log(Level.WARNING,
          "Parameter is invalid for datatype Color, default background color #FFFFFF will be set.");
      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

   * Get the style name of this cell.
   *
   * @return the name of the style
   */
  public String getStyleName() {
    OdfStyleBase style = getStyleHandler().getStyleElementForRead();
    if (style == null) {
      return "";
    }
    if (style instanceof OdfStyle)
      return ((OdfStyle) style).getStyleNameAttribute();
View Full Code Here

      throw new IllegalArgumentException("This function doesn't support " + typeValue + " cell.");
    }
  }

  private void setDataDisplayStyleName(String name) {
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForWrite();
    if (styleElement != null) {
      styleElement.setOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name"), name);
    }
  }
View Full Code Here

    }
  }

  private String getDataDisplayStyleName() {
    String datadisplayStylename = null;
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      datadisplayStylename = styleElement.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE,
          "data-style-name"));
    }

    return datadisplayStylename;
  }
View Full Code Here

    FontMetrics fm = txtField.getFontMetrics(txtField.getFont());
    // content width in pixels.
    int widthPixels = fm.stringWidth(content);
    // content height in pixels.
    // int heightPixels = fm.getHeight();
    OdfStyleBase properties = getStyleHandler().getStyleElementForRead();
    double millimeterPadding = 0.0;
    if(properties!=null){
      String padding = properties.getProperty(StyleTableCellPropertiesElement.Padding);
      if(padding!=null){
        millimeterPadding = Length.parseDouble(padding, Unit.MILLIMETER);
      }
    }
    // convert width pixels to mm
View Full Code Here

      country = textProperties.getCountry(type);
    if (country != null && country.length() > 0)
      return country;

    boolean isDefault = isUseDefaultStyle;
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TextProperties parentStyleSetting = TextProperties.getTextProperties(parentStyle);
      country = parentStyleSetting.getCountry(type);
View Full Code Here

    if (font != null && font.getFamilyName() != null && font.getColor() != null && font.getSize() != 0
        && font.getFontStyle() != null && font.getTextLinePosition() != null)
      return font;

    boolean isDefault = isUseDefaultStyle;
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TextProperties parentStyleSetting = TextProperties.getTextProperties(parentStyle);
      Font tempFont = parentStyleSetting.getFont(type);
View Full Code Here

      language = textProperties.getLanguage(type);
    if (language != null && language.length() > 0)
      return language;

    boolean isDefault = isUseDefaultStyle;
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TextProperties parentStyleSetting = TextProperties.getTextProperties(parentStyle);
      language = parentStyleSetting.getLanguage(type);
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.OdfStyleBase

Copyright © 2018 www.massapicom. 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.