Package org.jfree.xmlns.common

Examples of org.jfree.xmlns.common.AttributeList


      throws IOException
  {
    buildStyle(box, builder);


    final AttributeList attList = new AttributeList();
    attList.setAttribute(Namespaces.XHTML_NAMESPACE, "cellspacing", "0");
    attList.setAttribute(Namespaces.XHTML_NAMESPACE, "cellpadding", "0");

    if (builder.isEmpty() == false)
    {
      attList.setAttribute(Namespaces.XHTML_NAMESPACE, "style", builder.toString());
    }
    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE,
        "table", attList, XmlWriter.OPEN);

    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "colgroup", XmlWriter.OPEN);
View Full Code Here


            // Write image reference; return the name of the reference ..
            final String name = writeRaw(source);
            if (name != null)
            {
              // Write image reference ..
              final AttributeList attrList = new AttributeList();
              attrList.setAttribute(Namespaces.XHTML_NAMESPACE, "src", name);
              // width and height and scaling and so on ..
              xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "img", attrList, XmlWriter.CLOSE);

              knownResources.put(source, name);
              return;
            }
          }
        }
        // Fallback: (At the moment, we only support drawables and images.)
        final Object rawObject = rc.getRawObject();
        if (rawObject instanceof Image)
        {
          // Make it a PNG file ..
          xmlWriter.writeComment("Image content:" + source);
          final String name = writeImage((Image) rawObject);
          if (name != null)
          {
            // Write image reference ..
            final AttributeList attrList = new AttributeList();
            attrList.setAttribute(Namespaces.XHTML_NAMESPACE, "src", name);
            // width and height and scaling and so on ..
            xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "img", attrList, XmlWriter.CLOSE);
          }
        }
        else if (rawObject instanceof Drawable)
        {
          // render it into an Buffered image and make it a PNG file.
          xmlWriter.writeComment("Drawable content:" + source);
          final Image image = generateImage(node, (Drawable) rawObject);
          final String name = writeImage(image);
          if (name != null)
          {
            // Write image reference ..
            final AttributeList attrList = new AttributeList();
            attrList.setAttribute(Namespaces.XHTML_NAMESPACE, "src", name);
            // width and height and scaling and so on ..
            xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "img", attrList, XmlWriter.CLOSE);
          }
        }
      }
View Full Code Here

    final String elementType =
        ReportTargetUtil.getElemenTypeFromAttribute(attrs);

    try
    {
      final AttributeList attrList = buildAttributeList(attrs);
      validateNamespace(namespace, attrList);
      writer.writeTag(namespace, elementType, attrList,
          XmlWriterSupport.OPEN);
    }
    catch (IOException e)
View Full Code Here

    return "raw/text+xml";
  }

  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 (isInternalNamespace(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());
        validateNamespace(attrNamespace, attrList);
        attrList.setAttribute(attrNamespace, key,
            String.valueOf(entry.getValue()));
      }
    }
    return attrList;
  }
View Full Code Here

    final OutputStreamWriter writer = new OutputStreamWriter(manifestOutputStream, "UTF-8");
    final XmlWriter xmlWriter = new XmlWriter(writer, tagDescription);
    xmlWriter.setAlwaysAddNamespace(true);
    xmlWriter.writeXmlDeclaration("UTF-8");

    final AttributeList rootAttributes = new AttributeList();
    rootAttributes.addNamespaceDeclaration("manifest", MANIFEST_NS);
    xmlWriter.writeTag(MANIFEST_NS, "manifest", rootAttributes, XmlWriterSupport.OPEN);

    final Iterator iterator = entries.entrySet().iterator();
    while (iterator.hasNext())
    {
      final Map.Entry entry = (Map.Entry) iterator.next();
      final AttributeList entryAttrs = new AttributeList();
      entryAttrs.setAttribute(MANIFEST_NS, "media-type", (String) entry.getValue());
      entryAttrs.setAttribute(MANIFEST_NS, "full-path", (String) entry.getKey());
      xmlWriter.writeTag(MANIFEST_NS, "file-entry", entryAttrs, XmlWriterSupport.CLOSE);
    }

    xmlWriter.writeCloseTag();
    xmlWriter.close();
View Full Code Here

      for (int i = 0; i < XHTML_HEADER.length; i++)
      {
        xmlWriter.writeText(XHTML_HEADER[i]);
        xmlWriter.writeNewLine();
      }
      final AttributeList htmlAttList = new AttributeList();
      htmlAttList.addNamespaceDeclaration("", Namespaces.XHTML_NAMESPACE);

      xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "html",  XmlWriter.OPEN);
      xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "head", XmlWriter.OPEN);
      xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "title", XmlWriter.OPEN);
      xmlWriter.writeText("Yeah, sure, I *should* grab a sensible title from somewhere");
View Full Code Here

      final ContextElement context = new ContextElement(builder);
      contexts.push(context);

      buildStyle(box, builder);

      final AttributeList attList = new AttributeList();
      if (builder.isEmpty() == false)
      {
        attList.setAttribute(Namespaces.XHTML_NAMESPACE, "style", builder.toString());
      }

      if (attList.isEmpty() == false)
      {
        xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "span", attList, false);
      }
      else
      {
View Full Code Here

  {
    // This box is somewhat special ..
    buildStyle(box, builder);
    builder.append("white-space", false, "nowrap");

    final AttributeList attList = new AttributeList();
    if (builder.isEmpty() == false)
    {
      attList.setAttribute(Namespaces.XHTML_NAMESPACE, "style", builder.toString());
    }
    xmlWriter.writeComment("Marker-Box");
    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE,
        "span", attList, XmlWriter.OPEN);
View Full Code Here

                                 final StyleBuilder builder) throws IOException
  {
    buildStyle(box, builder);
    builder.append(BoxStyleKeys.WIDTH, toPointString(box.getWidth()), "pt");

    final AttributeList attList = new AttributeList();
    attList.setAttribute(Namespaces.XHTML_NAMESPACE, "style", builder.toString());
    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE,
        "div", attList, XmlWriter.OPEN);
    return true;
  }
View Full Code Here

  protected boolean startOtherBlockBox(final BlockRenderBox box,
                                       final StyleBuilder builder)
      throws IOException
  {
    buildStyle(box, builder);
    final AttributeList attList = new AttributeList();
    if (builder.isEmpty() == false)
    {
      attList.setAttribute(Namespaces.XHTML_NAMESPACE, "style", builder.toString());
    }
    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE,
        "div", attList, XmlWriter.OPEN);
    return true;
  }
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.