Examples of StrictDimension


Examples of org.jfree.layouting.util.geom.StrictDimension

    if (node instanceof RenderableReplacedContent)
    {
      final RenderableReplacedContent rpc = (RenderableReplacedContent) node;
      final RenderLength requestedWidth = rpc.getRequestedWidth();
      final StrictDimension contentSize = rpc.getContentSize();

      if (requestedWidth == RenderLength.AUTO)
      {
        node.setMaximumBoxWidth(contentSize.getWidth());
      }
      else
      {
        node.setMaximumBoxWidth(requestedWidth.resolve(contentSize.getWidth()));
      }

      node.setMinimumChunkWidth(0);
      // replaced content cannot have any childs anymore, so it is safe to
      // set this flag to an unconditional true.
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

    if (node instanceof RenderableReplacedContent)
    {
      final RenderableReplacedContent rpc = (RenderableReplacedContent) node;
      final RenderLength requestedWidth = rpc.getRequestedWidth();
      final StrictDimension contentSize = rpc.getContentSize();

      if (requestedWidth == RenderLength.AUTO)
      {
        node.setMaximumBoxWidth(contentSize.getWidth());
      }
      else
      {
        node.setMaximumBoxWidth(requestedWidth.resolve(contentSize.getWidth()));
      }

      node.setMinimumChunkWidth(0);
      // replaced content cannot have any childs anymore, so it is safe to
      // set this flag to an unconditional true.
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

  private long height;

  public ReplacedContentAlignContext(final RenderableReplacedContent node)
  {
    super(node);
    final StrictDimension contentSize = node.getContentSize();
    // we better compute the height of the content or we will run into
    // trouble ..

    if (RenderLength.AUTO.equals(node.getRequestedWidth()))
    {
      // if width is auto, and height is auto,
      if (RenderLength.AUTO.equals(node.getRequestedHeight()))
      {
        // use the intrinsic height ..
        height = contentSize.getHeight();
      }
      // if height is not auto, but the width is, then use the declared height.
      else
      {
        // A percentage is now relative to the intrinsinc size.
        // And yes, I'm aware that this is not what the standard says ..
        final RenderLength blockContextWidth =
            node.getComputedLayoutProperties().getBlockContextWidth();
        height = node.getRequestedHeight().resolve(blockContextWidth.resolve(0));
      }
    }
    else
    {
      // width is not auto.
      // If the height is auto, we have to preserve the aspect ratio ..
      if (RenderLength.AUTO.equals(node.getRequestedHeight()))
      {
        if (contentSize.getWidth() > 0)
        {
          final RenderLength blockContextWidth =
              node.getComputedLayoutProperties().getBlockContextWidth();
          final long computedWidth =
              node.getRequestedWidth().resolve(blockContextWidth.resolve(0));
          // Requested height must be computed to preserve the aspect ratio.
          height = computedWidth * contentSize.getHeight()/contentSize.getWidth();
        }
        else
        {
          height = 0;
        }
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

  private long width;

  public ReplacedContentSequenceElement(final RenderableReplacedContent node)
  {
    this.node = node;
    final StrictDimension contentSize = node.getContentSize();

    if (RenderLength.AUTO.equals(node.getRequestedWidth()))
    {
      // if width is auto, and height is auto,
      if (RenderLength.AUTO.equals(node.getRequestedHeight()))
      {
        // use the intrinsic width ..
        width = contentSize.getWidth();
      }
      // if height is not auto, but the width is, then compute a width that
      // preserves the aspect ratio.
      else if (contentSize.getHeight() > 0)
      {
        final RenderLength blockContextWidth =
            node.getComputedLayoutProperties().getBlockContextWidth();
        final long height =
            node.getRequestedHeight().resolve(blockContextWidth.resolve(0));
        width = height * contentSize.getWidth() / contentSize.getHeight();
      }
      else
      {
        width = 0;
      }
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

  public StrictDimension getBackgroundSize(final int i)
  {
    if (backgroundSizes == null)
    {
      return new StrictDimension();
    }
    final StrictDimension retval = (StrictDimension)
            backgroundSizes.get(i % backgroundSizes.size());
    if (retval == null)
    {
      return new StrictDimension();
    }
    return (StrictDimension) retval.clone();
  }
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

        (widthVal, context, layoutProcess.getOutputMetaData(), true, false);

    final CSSValue heightVal = context.getValue(BoxStyleKeys.HEIGHT);
    final RenderLength height = DefaultBoxDefinitionFactory.computeWidth
        (heightVal, context, layoutProcess.getOutputMetaData(), true, false);
    final StrictDimension dims = StrictGeomUtility.createDimension
        (image.getWidth(null), image.getHeight(null));
    final CSSValue valign =
        context.getValue(LineStyleKeys.VERTICAL_ALIGN);
    return new RenderableReplacedContent(image, source, dims, width, height, valign);
  }
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

  private RenderableReplacedContent createDrawable(final DrawableWrapper image,
                                                   final ResourceKey source,
                                                   final LayoutContext context)
  {
    final StrictDimension dims = new StrictDimension();

    final Dimension preferredSize = image.getPreferredSize();
    if (preferredSize != null)
    {
      dims.setWidth(StrictGeomUtility.toInternalValue(preferredSize.getWidth()));
      dims.setHeight(StrictGeomUtility.toInternalValue(preferredSize.getHeight()));
    }

    final CSSValue widthVal = context.getValue(BoxStyleKeys.WIDTH);
    final RenderLength width = DefaultBoxDefinitionFactory.computeWidth
        (widthVal, context, layoutProcess.getOutputMetaData(), true, false);
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

  public StrictDimension getBackgroundSize(final int i)
  {
    if (backgroundSizes == null)
    {
      return new StrictDimension();
    }
    final StrictDimension retval = (StrictDimension)
            backgroundSizes.get(i % backgroundSizes.size());
    if (retval == null)
    {
      return new StrictDimension();
    }
    return (StrictDimension) retval.clone();
  }
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

        (widthVal, context, layoutProcess.getOutputMetaData(), true, false);

    final CSSValue heightVal = context.getValue(BoxStyleKeys.HEIGHT);
    final RenderLength height = DefaultBoxDefinitionFactory.computeWidth
        (heightVal, context, layoutProcess.getOutputMetaData(), true, false);
    final StrictDimension dims = StrictGeomUtility.createDimension
        (image.getWidth(null), image.getHeight(null));
    final CSSValue valign =
        context.getValue(LineStyleKeys.VERTICAL_ALIGN);
    return new RenderableReplacedContent(image, source, dims, width, height, valign);
  }
View Full Code Here

Examples of org.jfree.layouting.util.geom.StrictDimension

  private RenderableReplacedContent createDrawable(final Drawable image,
                                                   final ResourceKey source,
                                                   final LayoutContext context)
  {
    final StrictDimension dims = new StrictDimension();

    if (image instanceof ExtendedDrawable)
    {
      final ExtendedDrawable ext = (ExtendedDrawable) image;
      final Dimension preferredSize = ext.getPreferredSize();
      dims.setWidth(StrictGeomUtility.toInternalValue(preferredSize.getWidth()));
      dims.setHeight(StrictGeomUtility.toInternalValue(preferredSize.getHeight()));
    }

    final CSSValue widthVal = context.getValue(BoxStyleKeys.WIDTH);
    final RenderLength width = DefaultBoxDefinitionFactory.computeWidth
        (widthVal, context, layoutProcess.getOutputMetaData(), true, false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.