Package org.odftoolkit.simple.style

Examples of org.odftoolkit.simple.style.TableCellProperties


   *
   * @return the background color
   */
  public Color getBackgroundColor() {
    Color tempColor = null;
    TableCellProperties properties = getTableCellPropertiesForRead();
    if (properties != null)
      tempColor = properties.getBackgroundColor();
    if (tempColor != null)
      return tempColor;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempColor = parentStyleSetting.getBackgroundColor();
      if (tempColor != null)
        return tempColor;

      if (parentStyle instanceof OdfDefaultStyle)
        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    // find in default style definition
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
      tempColor = defaultStyleSetting.getBackgroundColor();
    }
    // use default
    if (tempColor == null)
      return Color.WHITE;
    return tempColor;
View Full Code Here


   * @return the border setting
   */
  public Border getBorder(CellBordersType type) {

    Border tempBorder = null;
    TableCellProperties properties = getTableCellPropertiesForRead();
    if (properties != null) {
      tempBorder = getNullableBorder(properties, type);
    }
    if (tempBorder != null)
      return tempBorder;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempBorder = getNullableBorder(parentStyleSetting, type);
      ;
      if (tempBorder != null)
        return tempBorder;

      if (parentStyle instanceof OdfDefaultStyle)
        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    // find in default style definition
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
      tempBorder = getNullableBorder(defaultStyleSetting, type);
    }
    // use default
    if (tempBorder == null) {
      return Border.NONE;
View Full Code Here

   *
   * @return the vertical alignment
   */
  public VerticalAlignmentType getVerticalAlignment() {
    VerticalAlignmentType tempAlign = null;
    TableCellProperties properties = getTableCellPropertiesForRead();
    if (properties != null) {
      tempAlign = properties.getVerticalAlignment();
    }
    if (tempAlign != null)
      return tempAlign;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempAlign = parentStyleSetting.getVerticalAlignment();
      if (tempAlign != null)
        return tempAlign;

      if (parentStyle instanceof OdfDefaultStyle)
        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    // find in default style definition
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
      tempAlign = defaultStyleSetting.getVerticalAlignment();
    }
    // use default
    if (tempAlign == null) {
      return VerticalAlignmentType.DEFAULT;
    }
View Full Code Here

   *         <p>
   *         <code>false</code> if the cell content cannot be wrapped.
   */
  public boolean isTextWrapped() {
    Boolean tempBool = null;
    TableCellProperties properties = getTableCellPropertiesForRead();
    if (properties != null)
      tempBool = properties.isWrapped();
    if (tempBool != null)
      return tempBool.booleanValue();

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempBool = parentStyleSetting.isWrapped();
      if (tempBool != null)
        return tempBool;

      if (parentStyle instanceof OdfDefaultStyle)
        isDefault = true;
      else
        parentStyle = getParentStyle((OdfStyle) parentStyle);
    }
    // find in default style definition
    if (!isDefault) {
      OdfDefaultStyle defaultStyle = getCellDefaultStyle();
      TableCellProperties defaultStyleSetting = TableCellProperties.getTableCellProperties(defaultStyle);
      tempBool = defaultStyleSetting.isWrapped();
    }
    // use default
    if (tempBool == null)
      return false;
    return tempBool.booleanValue();
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.style.TableCellProperties

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.