Examples of OfficeStyle


Examples of com.sun.star.report.pentaho.model.OfficeStyle

  {
    final OfficeStyles commonStyles = stylesCollection.getCommonStyles();
    final OfficeStyle[] allCommonStyles = commonStyles.getAllStyles();
    for (int i = 0; i < allCommonStyles.length; i++)
    {
      final OfficeStyle style = allCommonStyles[i];
      autoStyleNameGenerator.generateName(style.getStyleName());
    }

    final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
    final OfficeStyle[] allAutoStyles = autoStyles.getAllStyles();
    for (int i = 0; i < allAutoStyles.length; i++)
    {
      final OfficeStyle style = allAutoStyles[i];
      autoStyleNameGenerator.generateName(style.getStyleName());
    }
  }
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

  protected OfficeStyle deriveStyle(final String styleFamily, final String styleName)
      throws ReportProcessingException
  {
    // autogenerate a style. The style has already been added to the current
    // auto-collection.
    final OfficeStyle style = StyleUtilities.deriveStyle(styleFamily, styleName,
        getStylesCollection(), getGlobalStylesCollection(),
        getPredefinedStylesCollection(), getAutoStyleNameGenerator());
    return style;
  }
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

          {
            final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
            final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
            if (clipWidth > 0 && clipHeight > 0)
            {
              final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
              final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
              final StringBuffer buffer = new StringBuffer();
              buffer.append("rect(");
              buffer.append(clipHeight / 2);
              buffer.append(imageAreaHeightVal.getType().getType());
              buffer.append(" ");
              buffer.append(clipWidth / 2);
              buffer.append(imageAreaWidthVal.getType().getType());
              buffer.append(" ");
              buffer.append(clipHeight / 2);
              buffer.append(imageAreaHeightVal.getType().getType());
              buffer.append(" ");
              buffer.append(clipWidth / 2);
              buffer.append(imageAreaWidthVal.getType().getType());
              buffer.append(")");
              graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

              styleName = imageStyle.getStyleName();
              getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
            }
            else if (clipWidth > 0)
            {
              final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
              final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
              final StringBuffer buffer = new StringBuffer();
              buffer.append("rect(0cm ");
              buffer.append(clipWidth / 2);
              buffer.append(imageAreaWidthVal.getType().getType());
              buffer.append(" 0cm ");
              buffer.append(clipWidth / 2);
              buffer.append(imageAreaWidthVal.getType().getType());
              buffer.append(")");
              graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

              styleName = imageStyle.getStyleName();
              getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
              imageAreaHeightVal = normalizedImageHeight;
            }
            else if (clipHeight > 0)
            {
              final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
              final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
              final StringBuffer buffer = new StringBuffer();
              buffer.append("rect(");
              buffer.append(clipHeight / 2);
              buffer.append(imageAreaHeightVal.getType().getType());
              buffer.append(" 0cm ");
              buffer.append(clipHeight / 2);
              buffer.append(imageAreaHeightVal.getType().getType());
              buffer.append(" 0cm)");
              graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

              styleName = imageStyle.getStyleName();
              getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
              imageAreaWidthVal = normalizedImageWidth;
            }
            else
            {
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle


  protected CSSNumericValue computeRowHeight(final String rowStyle)
  {
    final OfficeStylesCollection contentStyles = getContentStylesCollection();
    final OfficeStyle style = contentStyles.getStyle("table-row", rowStyle);
    if (style != null)
    {
      final Element element = style.getTableRowProperties();
      if (element != null)
      {
        final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
        if (height != null)
        {
          return parseLength(height);
        }
      }

      final String styleParent = style.getStyleParent();
      if (styleParent != null)
      {
        return computeRowHeight(styleParent);
      }
    }

    final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
    final OfficeStyle globalStyle = globalStyles.getStyle("table-row", rowStyle);
    if (globalStyle != null)
    {
      final Element element = globalStyle.getTableRowProperties();
      if (element != null)
      {
        final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
        if (height != null)
        {
          return parseLength(height);
        }
      }
      final String styleParent = globalStyle.getStyleParent();
      if (styleParent != null)
      {
        return computeRowHeight(styleParent);
      }
    }

    final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
    final OfficeStyle predefStyle = predefStyles.getStyle("table-row", rowStyle);
    if (predefStyle != null)
    {
      final Element element = predefStyle.getTableRowProperties();
      if (element != null)
      {
        final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
        if (height != null)
        {
          return parseLength(height);
        }
      }
      final String styleParent = predefStyle.getStyleParent();
      if (styleParent != null)
      {
        return computeRowHeight(styleParent);
      }
    }
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle


  protected CSSNumericValue computeColumnWidth(final String colStyle)
  {
    final OfficeStylesCollection contentStyles = getContentStylesCollection();
    final OfficeStyle style = contentStyles.getStyle("table-column", colStyle);
    if (style != null)
    {
      final Element element = style.getTableColumnProperties();
      if (element != null)
      {
        final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
        if (height != null)
        {
          return parseLength(height);
        }
      }

      final String styleParent = style.getStyleParent();
      if (styleParent != null)
      {
        return computeRowHeight(styleParent);
      }
    }

    final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
    final OfficeStyle globalStyle = globalStyles.getStyle("table-column", colStyle);
    if (globalStyle != null)
    {
      final Element element = globalStyle.getTableColumnProperties();
      if (element != null)
      {
        final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
        if (height != null)
        {
          return parseLength(height);
        }
      }
      final String styleParent = globalStyle.getStyleParent();
      if (styleParent != null)
      {
        return computeRowHeight(styleParent);
      }
    }

    final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
    final OfficeStyle predefStyle = predefStyles.getStyle("table-column", colStyle);
    if (predefStyle != null)
    {
      final Element element = predefStyle.getTableColumnProperties();
      if (element != null)
      {
        final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
        if (height != null)
        {
          return parseLength(height);
        }
      }
      final String styleParent = predefStyle.getStyleParent();
      if (styleParent != null)
      {
        return computeRowHeight(styleParent);
      }
    }
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

            predefinedStylesCollection = reportDoc.getStylesCollection();

            final OfficeStyles commonStyles = predefinedStylesCollection.getCommonStyles();
            if (!commonStyles.containsStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS))
            {
                final OfficeStyle graphicsDefaultStyle = new OfficeStyle();
                graphicsDefaultStyle.setStyleFamily(OfficeToken.GRAPHIC);
                graphicsDefaultStyle.setStyleName(OfficeToken.GRAPHICS);
                final Element graphicProperties = produceFirstChild(graphicsDefaultStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                graphicProperties.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", OfficeToken.PARAGRAPH);
                graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "x", ZERO_CM);
                graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "y", ZERO_CM);
                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap", "dynamic");
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

    {
        final OfficeStyles commonStyles = stylesCollection.getCommonStyles();
        final OfficeStyle[] allCommonStyles = commonStyles.getAllStyles();
        for (int i = 0; i < allCommonStyles.length; i++)
        {
            final OfficeStyle style = allCommonStyles[i];
            autoStyleNameGenerator.generateName(style.getStyleName());
        }

        final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
        final OfficeStyle[] allAutoStyles = autoStyles.getAllStyles();
        for (int i = 0; i < allAutoStyles.length; i++)
        {
            final OfficeStyle style = allAutoStyles[i];
            autoStyleNameGenerator.generateName(style.getStyleName());
        }
    }
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

    protected OfficeStyle deriveStyle(final String styleFamily, final String styleName)
            throws ReportProcessingException
    {
        // autogenerate a style. The style has already been added to the current
        // auto-collection.
        final OfficeStyle style = StyleUtilities.deriveStyle(styleFamily, styleName,
                getStylesCollection(), getGlobalStylesCollection(),
                getPredefinedStylesCollection(), getAutoStyleNameGenerator());
        return style;
    }
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

                    {
                        final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
                        final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
                        if (clipWidth > 0 && clipHeight > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
                            buffer.append("rect(");
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(' ');
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(' ');
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(' ');
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(')');
                            graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

                            styleName = imageStyle.getStyleName();
                            getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
                        }
                        else if (clipWidth > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
                            buffer.append("rect(0cm ");
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(" 0cm ");
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(')');
                            graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

                            styleName = imageStyle.getStyleName();
                            getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
                            imageAreaHeightVal = normalizedImageHeight;
                        }
                        else if (clipHeight > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
                            buffer.append("rect(");
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(" 0cm ");
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(" 0cm)");
                            graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

                            styleName = imageStyle.getStyleName();
                            getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
                            imageAreaWidthVal = normalizedImageWidth;
                        }
                        else
                        {
View Full Code Here

Examples of com.sun.star.report.pentaho.model.OfficeStyle

    }

    protected CSSNumericValue computeRowHeight(final String rowStyle)
    {
        final OfficeStylesCollection contentStyles = getContentStylesCollection();
        final OfficeStyle style = contentStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
        if (style != null)
        {
            final Element element = style.getTableRowProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
                if (height != null)
                {
                    return parseLength(height);
                }
            }

            final String styleParent = style.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }

        final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
        final OfficeStyle globalStyle = globalStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
        if (globalStyle != null)
        {
            final Element element = globalStyle.getTableRowProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
                if (height != null)
                {
                    return parseLength(height);
                }
            }
            final String styleParent = globalStyle.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }

        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final OfficeStyle predefStyle = predefStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
        if (predefStyle != null)
        {
            final Element element = predefStyle.getTableRowProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
                if (height != null)
                {
                    return parseLength(height);
                }
            }
            final String styleParent = predefStyle.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }
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.