Package org.jfree.layouting.util

Examples of org.jfree.layouting.util.AttributeMap


    protected void writeNullDate() throws IOException
    {
        // write NULL DATE
        final XmlWriter xmlWriter = getXmlWriter();
        xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "calculation-settings", null, XmlWriterSupport.OPEN);
        final AttributeMap nullDateAttributes = new AttributeMap();
        nullDateAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "date-value", "1900-01-01");
        xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "null-date", buildAttributeList(nullDateAttributes), XmlWriterSupport.CLOSE);
        xmlWriter.writeCloseTag();
    }
View Full Code Here


  private static AttributeMap collectAttributes(final Element node,
                                                final ExpressionRuntime runtime)
      throws DataSourceException
  {

    AttributeMap attributes = node.getAttributeMap();
    final AttributeMap attributeExpressions = node.getAttributeExpressionMap();
    if (attributeExpressions.isEmpty())
    {
      return attributes;
    }
   
    final String[] namespaces = attributeExpressions.getNameSpaces();
    for (int i = 0; i < namespaces.length; i++)
    {
      final String namespace = namespaces[i];
      final Map attrEx = attributeExpressions.getAttributes(namespace);

      final Iterator attributeExIt = attrEx.entrySet().iterator();
      while (attributeExIt.hasNext())
      {
        final Map.Entry entry = (Map.Entry) attributeExIt.next();
        final String name = (String) entry.getKey();
        final Expression expression = (Expression) entry.getValue();
        try
        {
          expression.setRuntime(runtime);
          final Object value = expression.computeValue();
          if (attributes.isReadOnly())
          {
            attributes = new AttributeMap(attributes);
          }
          attributes.setAttribute(namespace, name, value);
        }
        finally
        {
View Full Code Here

  public static AttributeMap processAttributes(final Element node,
                                               final ReportTarget target,
                                               final ExpressionRuntime runtime)
      throws DataSourceException
  {
    final AttributeMap attributes = collectAttributes(node, runtime);
    CSSDeclarationRule rule = null;


    final String[] attrNamespaces = attributes.getNameSpaces();
    for (int i = 0; i < attrNamespaces.length; i++)
    {
      final String namespace = attrNamespaces[i];
      final Map attributeMap = attributes.getAttributes(namespace);
      if (attributeMap == null || attributeMap.isEmpty())
      {
        continue;
      }

      final NamespaceDefinition nsDef = target.getNamespaceByUri(namespace);
      final Iterator attributeIt = attributeMap.entrySet().iterator();
      while (attributeIt.hasNext())
      {
        final Map.Entry entry = (Map.Entry) attributeIt.next();
        final String key = (String) entry.getKey();
        if (isStyleAttribute(nsDef, node.getType(), key))
        {
          final Object styleAttributeValue = entry.getValue();
          rule = processStyleAttribute(styleAttributeValue, node, runtime, rule);
        }
      }
    }

    // Just in case there was no style-attribute but there are style-expressions
    if (rule == null)
    {
      rule = processStyleAttribute(null, node, runtime, rule);
    }

    if (rule != null && rule.isEmpty() == false)
    {
      final AttributeMap retval = new AttributeMap(attributes);
      retval.setAttribute(Namespaces.LIBLAYOUT_NAMESPACE, "style", rule);
      retval.makeReadOnly();
      return retval;
    }

    return attributes;
  }
View Full Code Here

  }

  public static AttributeMap createEmptyMap(final String namespace,
                                            final String tagName)
  {
    final AttributeMap map = new AttributeMap();
    map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
        Element.NAMESPACE_ATTRIBUTE, namespace);
    map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
        Element.TYPE_ATTRIBUTE, tagName);
    return map;
  }
View Full Code Here

    }

    if (currentColumn == 0)
    {
      // Start a new table-header section ..
      final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
          (AutoTableModule.AUTOTABLE_NAMESPACE, "data-row");
      target.startElement(elementMap);
    }

    if (currentColumn < columnCount)
    {
      // now delegate the processing to the section handler for the header ..
      final FlowController flowController = getFlowController();
      final ReportContext reportContext = flowController.getReportContext();
      final LayoutControllerFactory layoutControllerFactory =
          reportContext.getLayoutControllerFactory();

      final int idx = currentColumn % node.getContentCount();
      final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
      return layoutControllerFactory.create
          (flowController, node.getContentCell(idx), derived);
    }

    // close the table-header section ..
    final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
        (AutoTableModule.AUTOTABLE_NAMESPACE, "data-row");
    target.endElement(elementMap);

    final FlowController flowController =
        getFlowController().performOperation(FlowControlOperation.ADVANCE);
View Full Code Here

    }

    if (currentColumn == 0)
    {
      // Start a new table-header section ..
      final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
          (AutoTableModule.AUTOTABLE_NAMESPACE, "footer-row");
      target.startElement(elementMap);
    }

    if (currentColumn < columnCount)
    {
      // now delegate the processing to the section handler for the header ..
      final FlowController flowController = getFlowController();
      final ReportContext reportContext = flowController.getReportContext();
      final LayoutControllerFactory layoutControllerFactory =
          reportContext.getLayoutControllerFactory();

      final int idx = currentColumn % node.getFooterCount();
      final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
      return layoutControllerFactory.create
          (flowController, node.getFooterCell(idx), derived);
    }

    // close the table-header section ..
    final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
        (AutoTableModule.AUTOTABLE_NAMESPACE, "footer-row");
    target.endElement(elementMap);

    final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
    derived.currentColumn = 0;
View Full Code Here

    }

    if (currentColumn == 0)
    {
      // Start a new table-header section ..
      final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
          (AutoTableModule.AUTOTABLE_NAMESPACE, "header-row");
      target.startElement(elementMap);
    }

    if (currentColumn < columnCount)
    {
      // now delegate the processing to the section handler for the header ..
      final FlowController flowController = getFlowController();
      final ReportContext reportContext = flowController.getReportContext();
      final LayoutControllerFactory layoutControllerFactory =
          reportContext.getLayoutControllerFactory();

      final int idx = currentColumn % node.getHeaderCount();
      final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
      return layoutControllerFactory.create
          (flowController, node.getHeaderCell(idx), derived);
    }

    // close the table-header section ..
    final AttributeMap elementMap = LayoutControllerUtil.createEmptyMap
        (AutoTableModule.AUTOTABLE_NAMESPACE, "header-row");
    target.endElement(elementMap);

    final AutoTableLayoutController derived = (AutoTableLayoutController) clone();
    derived.currentColumn = 0;
View Full Code Here

                xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.SHAPES, null, XmlWriterSupport.OPEN);


                for ( int i = 0; i < shapes.size(); i++ )
                {
                    final AttributeMap attrs = (AttributeMap) shapes.get(i);
                    final AttributeList attrList = buildAttributeList(attrs);
                    attrList.removeAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME);
                    xmlWriter.writeTag(OfficeNamespaces.DRAWING_NS, OfficeToken.FRAME, attrList, XmlWriterSupport.OPEN);
                    startChartProcessing((AttributeMap) ole.get(i));
View Full Code Here

            final XmlWriter xmlWriter = getXmlWriter();
            xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, getStartContent(), null, XmlWriterSupport.OPEN);

            writeNullDate();

            final AttributeMap tableAttributes = new AttributeMap();
            tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TABLE_NS);
            tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.TABLE);
            tableAttributes.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, generateInitialTableStyle());
            tableAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "name", "Report");

            performStyleProcessing(tableAttributes);

            xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, buildAttributeList(tableAttributes), XmlWriterSupport.OPEN);
            createTableShapes();
View Full Code Here

  protected AttributeMap computeAttributes(final FlowController fc,
                                           final Element element,
                                           final ReportTarget target)
      throws DataSourceException
  {
    final AttributeMap attrs = super.computeAttributes(fc, element, target);
    final LayoutController controller = getParent();
    if (!(controller instanceof OfficeGroupLayoutController))
    {
      return attrs;
    }
    final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller;
    if (oglc.isNormalFlowProcessing())
    {
      return attrs;
    }

    final AttributeMap retval = new AttributeMap(attrs);
    retval.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section", OfficeToken.TRUE);
    retval.makeReadOnly();
    return retval;
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.util.AttributeMap

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.