Package com.positive.charts.util

Examples of com.positive.charts.util.Size2D


        throw new RuntimeException("Not yet implemented.");
      } else if (h == LengthConstraintType.RANGE) {
        throw new RuntimeException("Not yet implemented.");
      }
    }
    return new Size2D(); // TODO: complete this
  }
View Full Code Here


        final Block b = (Block) blocks.get(index);
        b.setBounds(RectUtils.doubleRect(c * width, r * height, width,
            height));
      }
    }
    return new Size2D(this.columns * width, this.rows * height);
  }
 
View Full Code Here

        final int index = r * this.columns + c;
        if (index == blocks.size()) {
          break;
        }
        final Block b = (Block) blocks.get(index);
        final Size2D s = b.arrange(g2, constraint2);
        maxH = Math.max(maxH, s.getHeight());
      }
    }
    final RectangleConstraint constraint3 = constraint.toFixedHeight(maxH
        * this.rows);
    return this.arrange(container, g2, constraint3);
View Full Code Here

   */
  protected Size2D arrangeFR(final BlockContainer container, final GC g2,
      final RectangleConstraint constraint) {

    final RectangleConstraint c1 = constraint.toUnconstrainedHeight();
    final Size2D size1 = this.arrange(container, g2, c1);

    if (constraint.getHeightRange().contains(size1.getHeight())) {
      return size1;
    } else {
      final double h = constraint.getHeightRange().constrain(
          size1.getHeight());
      final RectangleConstraint c2 = constraint.toFixedHeight(h);
      return this.arrange(container, g2, c2);
    }
  }
View Full Code Here

   * @param anchor
   *            the anchor point.
   */
  public void draw(final GC g2, final float x, final float y,
      final RectangleAnchor anchor) {
    final Size2D d1 = this.textBlock.calculateDimensions(g2);
    final double w = this.interiorGap.extendWidth((int) d1.width);
    final double h = this.interiorGap.extendHeight((int) d1.height);
    final Size2D d2 = new Size2D(w, h);
    final Rectangle bounds = RectangleAnchor.createRectangle(new Rectangle(
        0, 0, (int) d2.width, (int) d2.height), x, y, anchor);
    final double xx = bounds.x;
    final double yy = bounds.y;

View Full Code Here

   *            the graphics device.
   *
   * @return The height (in Java2D units).
   */
  public double getHeight(final GC g2) {
    final Size2D d = this.textBlock.calculateDimensions(g2);
    return this.interiorGap.extendHeight((int) d.getHeight());
  }
View Full Code Here

            0.0, hh), LengthConstraintType.RANGE);
    Object retValue = null;
    final BlockParams p = new BlockParams();
    p.setGenerateEntities(entities);
    if (position == RectangleEdge.TOP) {
      final Size2D size = t.arrange(g2, constraint);
      titleArea = this.createAlignedRectangle2D(size, area, t
          .getHorizontalAlignment(), VerticalAlignment.TOP);
      retValue = t.draw(g2, titleArea, p);
      RectangleUtil.setRect(area, area.x, (int) Math.min(area.y
          + size.height, RectangleUtil.getMaxY(area)), area.width,
          (int) Math.max(area.height - size.height, 0));
    } else if (position == RectangleEdge.BOTTOM) {
      final Size2D size = t.arrange(g2, constraint);
      titleArea = this.createAlignedRectangle2D(size, area, t
          .getHorizontalAlignment(), VerticalAlignment.BOTTOM);
      retValue = t.draw(g2, titleArea, p);
      RectangleUtil.setRect(area, area.x, area.y, area.width,
          (int) (area.height - size.height));
    } else if (position == RectangleEdge.RIGHT) {
      final Size2D size = t.arrange(g2, constraint);
      titleArea = this.createAlignedRectangle2D(size, area,
          HorizontalAlignment.RIGHT, t.getVerticalAlignment());
      retValue = t.draw(g2, titleArea, p);
      RectangleUtil.setRect(area, area.x, area.y,
          area.width - size.width, area.height);
    }

    else if (position == RectangleEdge.LEFT) {
      final Size2D size = t.arrange(g2, constraint);
      titleArea = this.createAlignedRectangle2D(size, area,
          HorizontalAlignment.LEFT, t.getVerticalAlignment());
      retValue = t.draw(g2, titleArea, p);
      RectangleUtil.setRect(area, area.x + size.width, area.y, area.width
          - size.width, area.height);
View Full Code Here

    double maxH = 0.0;
    final List blocks = container.getBlocks();
    final Iterator iterator = blocks.iterator();
    while (iterator.hasNext()) {
      final Block b = (Block) iterator.next();
      final Size2D s = b.arrange(g2, RectangleConstraint.NONE);
      maxW = Math.max(maxW, s.width);
      maxH = Math.max(maxH, s.height);
    }
    final double width = this.columns * maxW;
    final double height = this.rows * maxH;
 
View Full Code Here

   *            the constraint (<code>null</code> not permitted).
   *
   * @return The block size (in Java2D units, never <code>null</code>).
   */
  public Size2D arrange(final GC g2, final RectangleConstraint constraint) {
    final Size2D base = new Size2D(this.getWidth(), this.getHeight());
    return constraint.calculateConstrainedSize(base);
  }
View Full Code Here

   */
  public Size2D arrange(final GC g2, final RectangleConstraint constraint) {
    final RectangleConstraint cc = this.toContentConstraint(constraint);
    final LengthConstraintType w = cc.getWidthConstraintType();
    final LengthConstraintType h = cc.getHeightConstraintType();
    Size2D contentSize = null;
    if (w == LengthConstraintType.NONE) {
      if (h == LengthConstraintType.NONE) {
        contentSize = this.arrangeNN(g2);
      } else if (h == LengthConstraintType.RANGE) {
        throw new RuntimeException("Not yet implemented.");
      } else if (h == LengthConstraintType.FIXED) {
        throw new RuntimeException("Not yet implemented.");
      }
    } else if (w == LengthConstraintType.RANGE) {
      if (h == LengthConstraintType.NONE) {
        contentSize = this.arrangeRN(g2, cc.getWidthRange());
      } else if (h == LengthConstraintType.RANGE) {
        contentSize = this.arrangeRR(g2, cc.getWidthRange(),
            cc.getHeightRange());
      } else if (h == LengthConstraintType.FIXED) {
        throw new RuntimeException("Not yet implemented.");
      }
    } else if (w == LengthConstraintType.FIXED) {
      if (h == LengthConstraintType.NONE) {
        contentSize = this.arrangeFN(g2, cc.getWidth());
      } else if (h == LengthConstraintType.RANGE) {
        throw new RuntimeException("Not yet implemented.");
      } else if (h == LengthConstraintType.FIXED) {
        throw new RuntimeException("Not yet implemented.");
      }
    }
    return new Size2D(this.calculateTotalWidth(contentSize.getWidth()),
        this.calculateTotalHeight(contentSize.getHeight()));
  }
View Full Code Here

TOP

Related Classes of com.positive.charts.util.Size2D

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.