Package org.jfree.xmlns.common

Examples of org.jfree.xmlns.common.AttributeList


            "This may go awfully wrong.");
        imageAreaWidthVal = image.getWidth();
        imageAreaHeightVal = image.getHeight();
      }

      final AttributeList frameList = new AttributeList();
      frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "name", imageNames.generateName("Image"));
      if (styleName != null)
      {
        frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "style-name", styleName);
      }
      frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", "paragraph");
      frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0");
      frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", "0cm");
      frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", "0cm");

      Log.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal);

      if (imageAreaWidthVal != null)
      {
        frameList.setAttribute(OfficeNamespaces.SVG_NS,
            "width", String.valueOf(imageAreaWidthVal.getValue()) + imageAreaWidthVal.getType().getType());
      }

      if (imageAreaHeightVal != null)
      {
        frameList.setAttribute(OfficeNamespaces.SVG_NS,
            "height", String.valueOf(imageAreaHeightVal.getValue()) + imageAreaHeightVal.getType().getType());
      }


      final AttributeList imageList = new AttributeList();
      imageList.setAttribute(OfficeNamespaces.XLINK_NS, "href", image.getEmbeddableLink());
      imageList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
      imageList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
      imageList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");


      try
      {
        getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, "frame", frameList, XmlWriterSupport.OPEN);
View Full Code Here


      writer.writeTag(OfficeNamespaces.TEXT_NS, "variable-decls", XmlWriterSupport.OPEN);
      final Iterator mappingsIt = definedMappings.entrySet().iterator();
      while (mappingsIt.hasNext())
      {
        final Map.Entry entry = (Map.Entry) mappingsIt.next();
        final AttributeList entryList = new AttributeList();
        entryList.setAttribute(OfficeNamespaces.TEXT_NS, "name", (String) entry.getKey());
        entryList.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", (String) entry.getValue());
        writer.writeTag(OfficeNamespaces.TEXT_NS, "variable-decl", entryList, XmlWriterSupport.CLOSE);
      }
      writer.writeCloseTag();
    }
View Full Code Here

  private void writeElement (final Element element)
      throws IOException
  {
    final String type = element.getType();
    final String namespace = element.getNamespace();
    final AttributeList attrList = buildAttributeList(element.getAttributeMap());
    xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE);
  }
View Full Code Here

  private void writeSection (final Section section)
      throws IOException
  {
    final String type = section.getType();
    final String namespace = section.getNamespace();
    final AttributeList attrList = buildAttributeList(section.getAttributeMap());
    if (section.getNodeCount() == 0)
    {
      xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE);
      return;
    }
View Full Code Here

    }
  }

  protected AttributeList buildAttributeList(final AttributeMap attrs)
  {
    final AttributeList attrList = new AttributeList();
    final String[] namespaces = attrs.getNameSpaces();
    for (int i = 0; i < namespaces.length; i++)
    {
      final String attrNamespace = namespaces[i];
      if (isFilteredNamespace(attrNamespace))
      {
        continue;
      }

      final Map localAttributes = attrs.getAttributes(attrNamespace);
      final Iterator entries = localAttributes.entrySet().iterator();
      while (entries.hasNext())
      {
        final Map.Entry entry = (Map.Entry) entries.next();
        final String key = String.valueOf(entry.getKey());
        attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue()));
      }
    }
    return attrList;
  }
View Full Code Here

  }

  private void performWriteRootTag()
      throws IOException
  {
    final AttributeList rootAttributes = new AttributeList();
    rootAttributes.addNamespaceDeclaration("office",
          OfficeNamespaces.OFFICE_NS);
    rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS);
    rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS);
    rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS);
    rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS);
    rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS);
    rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS);
    rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS);
    rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS);
    rootAttributes.addNamespaceDeclaration("number",
          OfficeNamespaces.DATASTYLE_NS);
    rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS);
    rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS);
    rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS);
    rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS);
    rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS);
    rootAttributes.addNamespaceDeclaration("script",
          OfficeNamespaces.SCRIPT_NS);
    rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS);
    rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS);
    rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS);
    rootAttributes.addNamespaceDeclaration("dom",
          OfficeNamespaces.XML_EVENT_NS);
    rootAttributes.addNamespaceDeclaration("xforms",
          OfficeNamespaces.XFORMS_NS);
    rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS);
    rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS);
    rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0");

    this.xmlWriter.writeXmlDeclaration("UTF-8");
    this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS,
          "document-content", rootAttributes, XmlWriterSupport.OPEN);
  }
View Full Code Here

        return null;
    }

    protected AttributeList buildAttributeList(final AttributeMap attrs)
    {
        final AttributeList attrList = new AttributeList();
        final String[] namespaces = attrs.getNameSpaces();
        for (int i = 0; i < namespaces.length; i++)
        {
            final String attrNamespace = namespaces[i];
            if (isFilteredNamespace(attrNamespace))
            {
                continue;
            }

            final Map localAttributes = attrs.getAttributes(attrNamespace);
            final Iterator entries = localAttributes.entrySet().iterator();
            while (entries.hasNext())
            {
                final Map.Entry entry = (Map.Entry) entries.next();
                final String key = String.valueOf(entry.getKey());
                if (OfficeNamespaces.TABLE_NS.equals(attrNamespace) &&
                        "name".equals(key))
                {
                    final String tableName = String.valueOf(entry.getValue());
                    final String saneName = sanitizeName(tableName);
                    attrList.setAttribute(attrNamespace, key,
                            tableNameGenerator.generateName(saneName));
                }
                else if (OfficeNamespaces.DRAWING_NS.equals(attrNamespace) &&
                        "name".equals(key))
                {
                    final String objectName = String.valueOf(entry.getValue());
                    attrList.setAttribute(attrNamespace, key,
                            frameNameGenerator.generateName(objectName));
                }
                else
                {
                    attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue()));
                }
            }
        }
        return attrList;
    }
View Full Code Here

                        "This may go awfully wrong.");
                imageAreaWidthVal = image.getWidth();
                imageAreaHeightVal = image.getHeight();
            }

            final AttributeList frameList = new AttributeList();
            frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "name", imageNames.generateName("Image"));
            if (styleName != null)
            {
                frameList.setAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME, styleName);
            }
            frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", OfficeToken.PARAGRAPH);
            frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0");
            frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", ZERO_CM);
            frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", ZERO_CM);

            Log.debug("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal);

            if (imageAreaWidthVal != null)
            {
                frameList.setAttribute(OfficeNamespaces.SVG_NS,
                        "width", imageAreaWidthVal.getValue() + imageAreaWidthVal.getType().getType());
            }

            if (imageAreaHeightVal != null)
            {
                frameList.setAttribute(OfficeNamespaces.SVG_NS,
                        "height", imageAreaHeightVal.getValue() + imageAreaHeightVal.getType().getType());
            }


            final AttributeList imageList = new AttributeList();
            imageList.setAttribute(OfficeNamespaces.XLINK_NS, "href", image.getEmbeddableLink());
            imageList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
            imageList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
            imageList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");


            try
            {
                getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, "frame", frameList, XmlWriterSupport.OPEN);
View Full Code Here

        final ArrayList masterColumns = (ArrayList) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "master-columns");
        final ArrayList masterValues = (ArrayList) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.MASTER_VALUES);
        final ArrayList detailColumns = (ArrayList) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, SDBCReportDataFactory.DETAIL_COLUMNS);
        final String href = oleProducer.produceOle(chartUrl, masterColumns, masterValues, detailColumns);

        final AttributeList oleList = new AttributeList();
        oleList.setAttribute(OfficeNamespaces.DRAWING_NS, "class-id", classId);
        oleList.setAttribute(OfficeNamespaces.XLINK_NS, "href", "./" + href);
        oleList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
        oleList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
        oleList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");

        try
        {
            getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, OfficeToken.OBJECT_OLE, oleList, XmlWriterSupport.CLOSE);
        }
View Full Code Here

        // All styles have to be processed or you will loose the paragraph-styles and inline text-styles.
        // ..
        performStyleProcessing(attrs);

        final AttributeList attrList = buildAttributeList(attrs);
        final XmlWriter xmlWriter = getXmlWriter();
        xmlWriter.writeTag(namespace, elementType, attrList, XmlWriter.OPEN);
        ++closeTags;
    // System.out.println("elementType = " + elementType);
    }
View Full Code Here

TOP

Related Classes of org.jfree.xmlns.common.AttributeList

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.