Package org.jfree.xmlns.common

Examples of org.jfree.xmlns.common.AttributeList


  protected boolean startParagraph(final ParagraphRenderBox 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());
    }

    // We have to use divs here, as paragraphs have margins by default.
    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "div", attList, XmlWriter.OPEN);
    return true;
View Full Code Here


      throws IOException
  {
    final int colSpan = box.getColSpan();
    final int rowSpan = box.getRowSpan();

    final AttributeList attrList = new AttributeList();
    if (colSpan != 0)
    {
      attrList.setAttribute(Namespaces.XHTML_NAMESPACE, "colspan", String.valueOf(colSpan));
    }
    if (rowSpan != 0)
    {
      attrList.setAttribute(Namespaces.XHTML_NAMESPACE, "rowspan", String.valueOf(rowSpan));
    }

    buildStyle(box, builder);
    if (builder.isEmpty() == false)
    {
      attrList.setAttribute(Namespaces.XHTML_NAMESPACE, "style", builder.toString());
    }
    xmlWriter.writeTag(Namespaces.XHTML_NAMESPACE, "td", attrList, XmlWriter.OPEN);
    return true;

  }
View Full Code Here

  protected boolean startTableRow(final TableRowRenderBox 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,
        "tr", attList, XmlWriter.OPEN);
    return true;
  }
View Full Code Here

  protected boolean startTableHeader(final TableSectionRenderBox 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,
        "thead", attList, XmlWriter.OPEN);
    return true;
  }
View Full Code Here

  protected boolean startTableBody(final TableSectionRenderBox 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,
        "tbody", attList, XmlWriter.OPEN);
    return true;
  }
View Full Code Here

  protected boolean startTableFooter(final TableSectionRenderBox 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,
        "tfoot", attList, XmlWriter.OPEN);
    return true;
  }
View Full Code Here

      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

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.