Package com.sun.star.report.pentaho.model

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


    }

    private String generateInitialTableStyle() throws ReportProcessingException
    {
        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final OfficeStyles commonStyles = predefStyles.getAutomaticStyles();
        if (!commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table"))
        {
            final String masterPageName = createMasterPage();

            final OfficeStyle tableStyle = new OfficeStyle();
            tableStyle.setStyleFamily(OfficeToken.TABLE);
            tableStyle.setStyleName("Initial_Table");
            tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
            final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties");
            tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
            commonStyles.addStyle(tableStyle);
        }
        return "Initial_Table";
    }
View Full Code Here


    }

    private String generateInitialTableStyle() throws ReportProcessingException
    {
        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final OfficeStyles commonStyles = predefStyles.getAutomaticStyles();
        if (!commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table"))
        {
            final String masterPageName = createMasterPage();

            final OfficeStyle tableStyle = new OfficeStyle();
            tableStyle.setStyleFamily(OfficeToken.TABLE);
            tableStyle.setStyleName("Initial_Table");
            tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
            final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties");
            tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, TRANSPARENT);
            commonStyles.addStyle(tableStyle);
        }
        return "Initial_Table";
    }
View Full Code Here

                predefCollection.getCommonStyles().getStyle(styleFamily, styleName);
        if (predefCommonStyle != null)
        {
            // so we have an style from the predefined collection.
            // copy it an add it to the current stylescollection
            final OfficeStyles commonStyles = commonCollection.getCommonStyles();

            copyStyleInternal(predefCommonStyle, commonStyles, stylesCollection,
                    commonCollection, predefCollection, styleFamily, inheritanceTracker);
            return;
        }

        final OfficeStyle predefAutoStyle =
                predefCollection.getAutomaticStyles().getStyle(styleFamily, styleName);
        if (predefAutoStyle != null)
        {
            // so we have an style from the predefined collection.
            // copy it an add it to the current stylescollection
            final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
            copyStyleInternal(predefAutoStyle, autoStyles, stylesCollection,
                    commonCollection, predefCollection, styleFamily, inheritanceTracker);
            return;
        }

        // There is no automatic style either. Now this means that someone
        // messed up the fileformat. Lets create a new empty style for this.
        final OfficeStyle autostyle = new OfficeStyle();
        autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
        autostyle.setType(STYLE);
        autostyle.setStyleFamily(styleFamily);
        autostyle.setStyleName(styleName);

        final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
        autoStyles.addStyle(autostyle);
    }
View Full Code Here

            if (!stylesCollection.getAutomaticStyles().containsDataStyle(styleName) &&
                    !stylesCollection.getCommonStyles().containsDataStyle(styleName))
            {
                try
                {
                    final OfficeStyles automaticStyles = predefCollection.getAutomaticStyles();
                    final DataStyle autoDataStyle = automaticStyles.getDataStyle(styleName);
                    if (autoDataStyle != null)
                    {
                        derivedStyle = (DataStyle) autoDataStyle.clone();
                        stylesCollection.getAutomaticStyles().addDataStyle(derivedStyle);
                    }
                    else
                    {
                        final OfficeStyles commonStyles = predefCollection.getCommonStyles();
                        final DataStyle commonDataStyle = commonStyles.getDataStyle(styleName);
                        if (commonDataStyle != null)
                        {
                            derivedStyle = (DataStyle) commonDataStyle.clone();
                            stylesCollection.getCommonStyles().addDataStyle(derivedStyle);
                        }
View Full Code Here

        else
        {
            autostyle.setStyleName(generator.generateName("derived_anonymous"));
        }

        final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
        autoStyles.addStyle(autostyle);
        return autostyle;
    }
View Full Code Here

        autostyle.setStyleFamily(styleFamily);
        autostyle.setStyleName(nameGenerator.generateName("derived_" + styleName));
        autostyle.setStyleParent(styleName);

        // now copy the common style ..
        final OfficeStyles commonStyles = commonCollection.getCommonStyles();
        if (!commonStyles.containsStyle(styleFamily, styleName))
        {
            copyStyleInternal(commonStyle, commonStyles,
                    commonCollection, commonCollection, predefCollection,
                    styleFamily, new HashSet());
        }
View Full Code Here

  }

  private String generateInitialTableStyle () throws ReportProcessingException
  {
    final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
    final OfficeStyles commonStyles = predefStyles.getAutomaticStyles();
    if (commonStyles.containsStyle("table", "Initial_Table") == false)
    {
      final String masterPageName = createMasterPage();

      final OfficeStyle tableStyle = new OfficeStyle();
      tableStyle.setStyleFamily("table");
      tableStyle.setStyleName("Initial_Table");
      tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
      final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties");
      tableProperties.setAttribute(OfficeNamespaces.FO_NS, "background-color", "transparent");
      commonStyles.addStyle(tableStyle);
    }
    return "Initial_Table";
  }
View Full Code Here

        (OfficeNamespaces.OFFICE_NS, "styles", XmlWriterSupport.OPEN);

    for (int sci = 0; sci < osc.length; sci++)
    {
      final OfficeStylesCollection collection = osc[sci];
      final OfficeStyles officeStyles = collection.getCommonStyles();
      writeStyles(officeStyles);
    }

    xmlWriter.writeCloseTag();
  }
View Full Code Here

    xmlWriter.writeTag
        (OfficeNamespaces.OFFICE_NS, "automatic-styles", XmlWriterSupport.OPEN);
    for (int sci = 0; sci < osc.length; sci++)
    {
      final OfficeStylesCollection collection = osc[sci];
      final OfficeStyles officeStyles = collection.getAutomaticStyles();
      writeStyles(officeStyles);
    }

    xmlWriter.writeCloseTag();
  }
View Full Code Here

            frameNameGenerator.reset();

            final OfficeDocument reportDoc = (OfficeDocument) report;
            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");
                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "number-wrapped-paragraphs", "no-limit");
                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap-contour", OfficeToken.FALSE);
                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, VERTICAL_POS, "from-top"); // changed for chart

                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-rel", OfficeToken.PARAGRAPH);
                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, HORIZONTAL_POS, "from-left"); // changed for chart

                graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "horizontal-rel", OfficeToken.PARAGRAPH);
                commonStyles.addStyle(graphicsDefaultStyle);
            }

            // Make sure that later generated styles do not overwrite existing styles.
            fillStyleNameGenerator(predefinedStylesCollection);
View Full Code Here

TOP

Related Classes of com.sun.star.report.pentaho.model.OfficeStyles

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.