Package org.jfree.layouting.layouter.feed

Examples of org.jfree.layouting.layouter.feed.InputFeed


  public void startReport (ReportStructureRoot report)
          throws DataSourceException, ReportProcessingException
  {
    try
    {
      final InputFeed feed = getInputFeed();
      feed.startDocument();
      feed.startMetaInfo();

      feed.addDocumentAttribute(DocumentContext.BASE_RESOURCE_ATTR, report.getBaseResource());
      feed.addDocumentAttribute(DocumentContext.RESOURCE_MANAGER_ATTR, report.getResourceManager());

      String strictStyleMode = "false";
      if ("true".equals(strictStyleMode))
      {
        feed.addDocumentAttribute(DocumentContext.STRICT_STYLE_MODE, Boolean.TRUE);
      }

      final NamespaceDefinition[] namespaces = createDefaultNameSpaces();
      for (int i = 0; i < namespaces.length; i++)
      {
        final NamespaceDefinition definition = namespaces[i];
        feed.startMetaNode();
        feed.setMetaNodeAttribute("type", "namespace");
        feed.setMetaNodeAttribute("definition", definition);
        feed.endMetaNode();
      }

      if (report instanceof JFreeReport)
      {
        final JFreeReport realReport = (JFreeReport) report;
        final int size = realReport.getStyleSheetCount();
        for (int i = 0; i < size; i++)
        {
          final StyleSheet styleSheet = realReport.getStyleSheet(i);
          feed.startMetaNode();
          feed.setMetaNodeAttribute("type", "style");
          feed.setMetaNodeAttribute("#content", styleSheet);
          feed.endMetaNode();
        }
      }

      feed.endMetaInfo();
      this.namespaces = feed.getNamespaceCollection();
    }
    catch (InputFeedException dse)
    {
      dse.printStackTrace();
      throw new ReportProcessingException("Failed to process inputfeed", dse);
View Full Code Here


  {
    try
    {
      final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
      final String type = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
      final InputFeed feed = getInputFeed();
      feed.startElement(namespace, type);
      handleAttributes(attrs);
    }
    catch (InputFeedException e)
    {
      throw new ReportProcessingException("Failed to process inputfeed", e);
View Full Code Here

  public void processText(String text)
      throws DataSourceException, ReportProcessingException
  {
    try
    {
      final InputFeed feed = getInputFeed();
      feed.addContent(text);
    }
    catch (InputFeedException e)
    {
      throw new ReportProcessingException("Failed to process inputfeed", e);
    }
View Full Code Here

  }

  public void processContent (final DataFlags value)
          throws DataSourceException, ReportProcessingException
  {
    final InputFeed feed = getInputFeed();
    try
    {
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "content", value.getValue());
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isChanged", String.valueOf(value.isChanged()));
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isDate", String.valueOf(value.isDate()));
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isNegative", String.valueOf(value.isNegative()));
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isNull", String.valueOf(value.isNull()));
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isNumber", String.valueOf(value.isNumeric()));
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isPositive", String.valueOf(value.isPositive()));
      feed.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "isZero", String.valueOf(value.isZero()));
    }
    catch (InputFeedException e)
    {
      throw new ReportProcessingException("Failed to process inputfeed", e);
    }
View Full Code Here

  protected void handleAttributes(AttributeMap map)
          throws ReportProcessingException
  {
    try
    {
      final InputFeed feed = getInputFeed();
      final String[] namespaces = map.getNameSpaces();
      for (int i = 0; i < namespaces.length; i++)
      {
        final String namespace = namespaces[i];
        final Map localAttrs = map.getAttributes(namespace);
        final Iterator it = localAttrs.entrySet().iterator();
        while (it.hasNext())
        {
          Map.Entry entry = (Map.Entry) it.next();
          feed.setAttribute(namespace, (String) entry.getKey(), entry.getValue());
        }
      }
    }
    catch (InputFeedException e)
    {
View Full Code Here

  }

  public void endElement (final AttributeMap attrs)
          throws DataSourceException, ReportProcessingException
  {
    final InputFeed feed = getInputFeed();
    try
    {
      feed.endElement();
    }
    catch (InputFeedException e)
    {
      throw new ReportProcessingException("Failed to process inputfeed", e);
    }
View Full Code Here

  }

  public LayoutProcessState execute(LayoutProcess lp)
      throws StateException, InputFeedException
  {
    final InputFeed inputFeed = lp.getInputFeed();

    if ("startDocument".equals(method))
    {
      inputFeed.startDocument();
    }
    else if ("startElement".equals(method))
    {
      inputFeed.startElement(namespace, name);
    }
    else if ("startMetaInfo".equals(method))
    {
      inputFeed.startMetaInfo();
    }
    else if ("startMetaNode".equals(method))
    {
      inputFeed.startMetaNode();
    }
    else if ("addContent".equals(method))
    {
      inputFeed.addContent(attr.toString());
    }
    else if ("addDocumentAttribute".equals(method))
    {
      inputFeed.addDocumentAttribute(name, attr);
    }
    else if ("endDocument".equals(method))
    {
      inputFeed.endDocument();
    }
    else if ("endElement".equals(method))
    {
      inputFeed.endElement();
    }
    else if ("endMetaInfo".equals(method))
    {
      inputFeed.endMetaInfo();
    }
    else if ("endMetaNode".equals(method))
    {
      inputFeed.endMetaNode();
    }
    else if ("setAttribute".equals(method))
    {
      inputFeed.setAttribute(namespace, name, attr);
    }
    else if ("setMetaNodeAttribute".equals(method))
    {
      inputFeed.setMetaNodeAttribute(name, attr);
    }
    else
    {
      throw new IllegalStateException();
    }
View Full Code Here

  {
    final LibLayoutBoot instance = LibLayoutBoot.getInstance();
    instance.start();
    final GraphicsOutputProcessor op = new GraphicsOutputProcessor(instance.getGlobalConfig());
    final DefaultLayoutProcess dlp = new DefaultLayoutProcess(op);
    final InputFeed inputFeed = dlp.getInputFeed();
    inputFeed.startDocument();
      inputFeed.startElement(NAMESPACE, "body");
      inputFeed.addContent(" ");
        inputFeed.startElement(NAMESPACE, "span");
        inputFeed.addContent(" ");
          inputFeed.startElement(NAMESPACE, "div");
          inputFeed.addContent("Invalid");
          inputFeed.endElement();
        inputFeed.addContent("x");
        inputFeed.endElement();
      inputFeed.addContent("y");
      inputFeed.endElement();
    inputFeed.endDocument();

//
//    dlp = new DefaultLayoutProcess(op);
//    inputFeed.startDocument();
//    inputFeed.startElement(NAMESPACE, "body");
View Full Code Here

  {
    final LibLayoutBoot instance = LibLayoutBoot.getInstance();
    instance.start();
    final GraphicsOutputProcessor op = new GraphicsOutputProcessor(instance.getGlobalConfig());
    final DefaultLayoutProcess dlp = new DefaultLayoutProcess(op);
    final InputFeed inputFeed = dlp.getInputFeed();
    inputFeed.startDocument();
      inputFeed.startElement(NAMESPACE, "body");
      inputFeed.addContent(" ");
        inputFeed.startElement(NAMESPACE, "span");
        inputFeed.addContent(" ");
          inputFeed.startElement(NAMESPACE, "div");
          inputFeed.addContent("Invalid");
          inputFeed.endElement();
        inputFeed.addContent("x");
        inputFeed.endElement();
      inputFeed.addContent("y");
      inputFeed.endElement();
    inputFeed.endDocument();

//
//    dlp = new DefaultLayoutProcess(op);
//    inputFeed.startDocument();
//    inputFeed.startElement(NAMESPACE, "body");
View Full Code Here

  public void startReport (ReportStructureRoot report)
          throws DataSourceException, ReportProcessingException
  {
    try
    {
      final InputFeed feed = getInputFeed();
      feed.startDocument();
      feed.startMetaInfo();

      feed.addDocumentAttribute(DocumentContext.BASE_RESOURCE_ATTR, report.getBaseResource());
      feed.addDocumentAttribute(DocumentContext.RESOURCE_MANAGER_ATTR, report.getResourceManager());

      String strictStyleMode = "false";
      if ("true".equals(strictStyleMode))
      {
        feed.addDocumentAttribute(DocumentContext.STRICT_STYLE_MODE, Boolean.TRUE);
      }

      final NamespaceDefinition[] namespaces = createDefaultNameSpaces();
      for (int i = 0; i < namespaces.length; i++)
      {
        final NamespaceDefinition definition = namespaces[i];
        feed.startMetaNode();
        feed.setMetaNodeAttribute("type", "namespace");
        feed.setMetaNodeAttribute("definition", definition);
        feed.endMetaNode();
      }

      if (report instanceof JFreeReport)
      {
        final JFreeReport realReport = (JFreeReport) report;
        final int size = realReport.getStyleSheetCount();
        for (int i = 0; i < size; i++)
        {
          final StyleSheet styleSheet = realReport.getStyleSheet(i);
          feed.startMetaNode();
          feed.setMetaNodeAttribute("type", "style");
          feed.setMetaNodeAttribute("#content", styleSheet);
          feed.endMetaNode();
        }
      }

      feed.endMetaInfo();
      this.namespaces = feed.getNamespaceCollection();
    }
    catch (InputFeedException dse)
    {
      dse.printStackTrace();
      throw new ReportProcessingException("Failed to process inputfeed", dse);
View Full Code Here

TOP

Related Classes of org.jfree.layouting.layouter.feed.InputFeed

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.