Package org.jfree.layouting.util

Examples of org.jfree.layouting.util.AttributeMap


  public AttributeMap getAttributeExpressionMap()
  {
    if (this.attributeExpressions == null)
    {
      this.readOnlyAttributeExpressions = new AttributeMap();
      return readOnlyAttributeExpressions;
    }

    if (this.readOnlyAttributeExpressions == null)
    {
View Full Code Here


    if (params.length >= 3)
    {
      type = FunctionUtilities.resolveString(layoutProcess, element, params[2]);
    }

    final AttributeMap attributes = element.getLayoutContext().getAttributes();
    if (namespace == null || "".equals(namespace))
    {
      final Object value = attributes.getAttribute
              (element.getLayoutContext().getNamespace(), name);
      return convertValue(layoutProcess, value, type);

    }
    else if ("*".equals(namespace))
    {
      // this is a lot of work. Query all attributes in all namespaces...
      final Object value = attributes.getFirstAttribute(name);
      return convertValue(layoutProcess, value, type);
    }
    else
    {
      // thats easy.
      final Object value = attributes.getAttribute
              (namespace, name);
      return convertValue(layoutProcess, value, type);
    }
  }
View Full Code Here

    // Stage 1c: Add the contents of the style attribute, if there is one ..
    // the libLayout style is always added: This is a computed style and the hook
    // for a element neutral user defined tweaking ..

    final AttributeMap attributes = layoutContext.getAttributes();
    final Object libLayoutStyleValue = attributes.getAttribute
            (Namespaces.LIBLAYOUT_NAMESPACE, "style");
    // You cannot override element specific styles with that. So an HTML-style
    // attribute has move value than a LibLayout-style attribute.
    addStyleFromAttribute(element, libLayoutStyleValue);
View Full Code Here

    if (ndef == null)
    {
      return;
    }

    final AttributeMap attributes = layoutContext.getAttributes();
    final String[] styleAttrs = ndef.getStyleAttribute
            (layoutContext.getTagName());
    for (int i = 0; i < styleAttrs.length; i++)
    {
      final String attr = styleAttrs[i];
      final Object styleValue = attributes.getAttribute(namespace, attr);
      addStyleFromAttribute(node, styleValue);
    }
  }
View Full Code Here

  {
    final NamespaceCollection namespaces = getNamespaces();
    final String[] namespaceNames = namespaces.getNamespaces();

    final LayoutContext layoutContext = node.getLayoutContext();
    final AttributeMap attributes = layoutContext.getAttributes();

    for (int i = 0; i < namespaceNames.length; i++)
    {
      final String namespace = namespaceNames[i];
      final NamespaceDefinition ndef = namespaces.getDefinition(namespace);
      if (ndef == null)
      {
        continue;
      }

      final String[] styleAttrs = ndef.getStyleAttribute(layoutContext.getTagName());
      for (int x = 0; x < styleAttrs.length; x++)
      {
        final String attr = styleAttrs[x];
        final Object styleValue = attributes.getAttribute(namespace, attr);
        addStyleFromAttribute(node, styleValue);
      }
    }
  }
View Full Code Here

    {
        final ObjectOleElement element = (ObjectOleElement) getNode();
        final String url = element.getUrl();
        if (url != null)
        {
            final AttributeMap ole = new AttributeMap();
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.INTERNAL_NS);
            ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.OBJECT_OLE);
            ole.setAttribute(OfficeNamespaces.INTERNAL_NS, "href", url);
            ole.setAttribute(OfficeNamespaces.INTERNAL_NS, "class-id", element.getClassid());
            final List masterfields = element.getMasterfields();
            final List values = new ArrayList();
            final DataRow view = getFlowController().getMasterRow().getGlobalView();
            for (final Iterator iter = masterfields.iterator(); iter.hasNext();)
            {
                final String master = (String) iter.next();
                try
                {
                    final DataFlags flags = view.getFlags(master);
                    if (flags != null)
                    {
                        values.add(flags.getValue());
                    }
                }
                catch (DataSourceException e)
                {
                // ignore .. assume that the reference has not changed.
                }
            }
            ole.setAttribute(OfficeNamespaces.INTERNAL_NS, "master-columns", masterfields);
            ole.setAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.MASTER_VALUES, values);
            ole.setAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.DETAIL_COLUMNS, element.getDetailfields());

            target.startElement(ole);
            target.endElement(ole);
        }
View Full Code Here

    }

    protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
            throws DataSourceException
    {
        final AttributeMap attributeMap = super.computeAttributes(fc, element, target);
        final Section s = (Section) element;
        int rowCount = 0;
        final Node[] nodeArray = s.getNodeArray();
        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Element)
            {
                final Element child = (Element) node;
                if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) &&
                        OfficeToken.TABLE_ROW.equals(child.getType()))
                {
                    rowCount += 1;
                }
            }
        }
        attributeMap.setAttribute(OfficeNamespaces.INTERNAL_NS, "table-row-count", IntegerCache.getInteger(rowCount));
        return attributeMap;
    }
View Full Code Here

  }

  protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
      throws DataSourceException
  {
    final AttributeMap map = super.computeAttributes(fc, element, target);
    final String value = String.valueOf(repeatHeader || repeatFooter);
    map.setAttribute(OfficeNamespaces.INTERNAL_NS, "repeating-header-or-footer", value);
    return map;
  }
View Full Code Here

  }

  protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
      throws DataSourceException
  {
    final AttributeMap map = super.computeAttributes(fc, element, target);
    map.setAttribute(OfficeNamespaces.INTERNAL_NS, "iteration-count", new Integer(getIterationCount()));
    return map;
  }
View Full Code Here

        if (linkTarget == null)
        {
            return;
        }

        final AttributeMap image = new AttributeMap();
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.INTERNAL_NS);
        image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, OfficeToken.IMAGE);
        image.setAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.SCALE, String.valueOf(scale));
        image.setAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIri));
        image.setAttribute(OfficeNamespaces.INTERNAL_NS, "image-context", createContext());
        image.setAttribute(OfficeNamespaces.INTERNAL_NS, OfficeToken.IMAGE_DATA, linkTarget);
        target.startElement(image);
        target.endElement(image);
    }
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.