Package org.jfree.layouting.renderer.text

Examples of org.jfree.layouting.renderer.text.RenderableTextFactory


  }

  public void startedInline(final LayoutContext context)
      throws NormalizationException
  {
    RenderableTextFactory textFactory = getCurrentTextFactory();
    getInsertationPoint().addChilds(textFactory.finishText());

    this.pageContext = pageContext.update(context);

    final BoxDefinition definition =
        boxDefinitionFactory.createInlineBoxDefinition
View Full Code Here


  public void addContent(final LayoutContext context,
                         final ContentToken content)
      throws NormalizationException
  {
    final RenderableTextFactory textFactory = getCurrentTextFactory();
    if (content instanceof GenericType)
    {
      GenericType generic = (GenericType) content;
      ResourceKey source = null;
      if (content instanceof ResourceType)
      {
        ResourceType resourceType = (ResourceType) content;
        source = resourceType.getContent().getSource();
      }

      final Object raw = generic.getRaw();
      if (raw instanceof Image)
      {
        RenderableReplacedContent replacedContent =
            createImage((Image) raw, source, context);
        if (replacedContent != null)
        {
          replacedContent.appyStyle(context, layoutProcess.getOutputMetaData());

          getInsertationPoint().addChilds(textFactory.finishText());
          getInsertationPoint().addChild(replacedContent);
          tryValidateOutput(null);
          return;
        }
      }
      else if (raw instanceof Drawable)
      {
        RenderableReplacedContent replacedContent =
            createDrawable((Drawable) raw, source, context);
        if (replacedContent != null)
        {
          replacedContent.appyStyle(context, layoutProcess.getOutputMetaData());

          getInsertationPoint().addChilds(textFactory.finishText());
          getInsertationPoint().addChild(replacedContent);
          tryValidateOutput(null);
          return;
        }
      }
    }


    if (content instanceof ResolvedCounterToken)
    {
      final ResolvedCounterToken resolvedToken = (ResolvedCounterToken) content;
      if (isProcessingNormalFlow() == false)
      {
        getInsertationPoint().addChilds(textFactory.finishText());
        try
        {
          final RenderableTextBox token = new RenderableTextBox
              (textFactory.saveState(), resolvedToken, context);
          token.appyStyle(context, getLayoutProcess().getOutputMetaData());
          getInsertationPoint().addChild(token);
          token.close();
          tryValidateOutput(null);
          return;
        }
        catch (StateException se)
        {
          // Should not happen ..
          throw new NormalizationException("State failed.", se);
        }
      }
    }

    if (context instanceof ResolvedStringToken)
    {
      final ResolvedStringToken resolvedToken = (ResolvedStringToken) context;
      final ComputedToken parent = resolvedToken.getParent();
      // todo: The test should be: isProcessingPageFlow()
      if (parent instanceof VariableToken && isProcessingNormalFlow() == false)
      {
        getInsertationPoint().addChilds(textFactory.finishText());
        try
        {
          final RenderableTextBox token = new RenderableTextBox
              (textFactory.saveState(), resolvedToken, context);
          token.appyStyle(context, getLayoutProcess().getOutputMetaData());
          getInsertationPoint().addChild(token);
          token.close();
          tryValidateOutput(null);
          return;
View Full Code Here

      buffer.setCursor(0);
    }
    buffer = Utf16LE.getInstance().decodeString(str, buffer);
    final int[] data = buffer.getBuffer();

    final RenderableTextFactory textFactory = getCurrentTextFactory();
    return textFactory.createText(data, 0, buffer.getLength(), context);
  }
View Full Code Here

  }

  public void finishedInline() throws NormalizationException
  {
    final RenderBox insertationPoint = getInsertationPoint();
    RenderableTextFactory textFactory = getCurrentTextFactory();
    final RenderNode[] nodes = textFactory.finishText();
    insertationPoint.addChilds(nodes);
    insertationPoint.close();
    // currentBox = (RenderBox) currentBox.getParent();
    tryValidateOutput(insertationPoint.getInstanceId());
  }
View Full Code Here

      getInsertationPoint();
      throw new IllegalStateException
          ("Assertation: A rootInline must call close on a pool box");
    }

    RenderableTextFactory textFactory = getCurrentTextFactory();
    final RenderNode[] nodes = textFactory.finishText();
    insertationPoint.addChilds(nodes);
    insertationPoint.close();

    tryValidateOutput(insertationPoint.getInstanceId());
  }
View Full Code Here

  }

  public void finishedMarker() throws NormalizationException
  {
    final RenderBox insertationPoint = getInsertationPoint();
    RenderableTextFactory textFactory = getCurrentTextFactory();
    final RenderNode[] nodes = textFactory.finishText();
    insertationPoint.addChilds(nodes);

    insertationPoint.close();
    tryValidateOutput(insertationPoint.getInstanceId());
  }
View Full Code Here

  }

  public void finishedBlock() throws NormalizationException
  {
    final RenderBox insertationPoint = getInsertationPoint();
    RenderableTextFactory textFactory = getCurrentTextFactory();
    insertationPoint.addChilds(textFactory.finishText());
    insertationPoint.close();
    tryValidateOutput(insertationPoint.getInstanceId());
  }
View Full Code Here

  }

  public void finishedTableCell() throws NormalizationException
  {
    final RenderBox insertationPoint = getInsertationPoint();
    RenderableTextFactory textFactory = getCurrentTextFactory();
    insertationPoint.addChilds(textFactory.finishText());
    insertationPoint.close();

    // A table cell is always inside a table row - and that one must be closed
    // before the layouting can continue ..
View Full Code Here

  }

  public void finishedTableRow() throws NormalizationException
  {
    final RenderBox insertationPoint = getInsertationPoint();
    RenderableTextFactory textFactory = getCurrentTextFactory();
    insertationPoint.addChilds(textFactory.finishText());
    insertationPoint.close();
    tryValidateOutput(insertationPoint.getInstanceId());
  }
View Full Code Here

  }

  public void finishedTableSection() throws NormalizationException
  {
    final RenderBox insertationPoint = getInsertationPoint();
    RenderableTextFactory textFactory = getCurrentTextFactory();
    insertationPoint.addChilds(textFactory.finishText());
    insertationPoint.close();
    tryValidateOutput(insertationPoint.getInstanceId());
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.renderer.text.RenderableTextFactory

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.