Package org.jfree.ui

Examples of org.jfree.ui.Size2D


     * @return The size following the arrangement.
     */
    protected Size2D arrangeRF(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {

        Size2D s = arrangeNF(container, g2, constraint);
        if (constraint.getWidthRange().contains(s.width)) {
            return s;
        }
        else {
            RectangleConstraint c = constraint.toFixedWidth(
                    constraint.getWidthRange().constrain(s.getWidth()));
            return arrangeFF(container, g2, c);
        }
    }
View Full Code Here


     */
    protected Size2D arrangeRN(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {
        // first arrange without constraints, then see if the width fits
        // within the required range...if not, call arrangeFN() at max width
        Size2D s1 = arrangeNN(container, g2);
        if (constraint.getWidthRange().contains(s1.width)) {
            return s1;
        }
        else {
            RectangleConstraint c = constraint.toFixedWidth(
View Full Code Here

     * @return The size after the arrangement.
     */
    protected Size2D arrangeNN(BlockContainer container, Graphics2D g2) {
        List blocks = container.getBlocks();
        Block b = (Block) blocks.get(0);
        Size2D s = b.arrange(g2, RectangleConstraint.NONE);
        b.setBounds(new Rectangle2D.Double(0.0, 0.0, s.width, s.height));
        return new Size2D(s.width, s.height);
    }
View Full Code Here

     * @return The size following the arrangement.
     */
    protected Size2D arrangeRF(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {

        Size2D s = arrangeNF(container, g2, constraint);
        if (constraint.getWidthRange().contains(s.width)) {
            return s;
        }
        else {
            RectangleConstraint c = constraint.toFixedWidth(
                constraint.getWidthRange().constrain(s.getWidth())
            );
            return arrangeFF(container, g2, c);
        }
    }
View Full Code Here

     */
    protected Size2D arrangeRN(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {
        // first arrange without constraints, then see if the width fits
        // within the required range...if not, call arrangeFN() at max width
        Size2D s1 = arrangeNN(container, g2);
        if (constraint.getWidthRange().contains(s1.width)) {
            return s1;
        }
        else {
            RectangleConstraint c = constraint.toFixedWidth(
View Full Code Here

                        //TODO: shift block down to bottom
                    }
                }
            }
        }
        return new Size2D(width, maxHeight);
    }
View Full Code Here

     * @param base  the base size.
     *
     * @return The constrained size.
     */
    public Size2D calculateConstrainedSize(Size2D base) {
        Size2D result = new Size2D();
        if (this.widthConstraintType == LengthConstraintType.NONE) {
            result.width = base.width;
            if (this.heightConstraintType == LengthConstraintType.NONE) {
               result.height = base.height;
            }
View Full Code Here

     */
    protected double calculateTextBlockWidth(TextBlock block,
            CategoryLabelPosition position, Graphics2D g2) {

        RectangleInsets insets = getTickLabelInsets();
        Size2D size = block.calculateDimensions(g2);
        Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),
                size.getHeight());
        Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
                0.0f, 0.0f);
        double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft()
                + insets.getRight();
        return w;
View Full Code Here

    protected double calculateTextBlockHeight(TextBlock block,
                                              CategoryLabelPosition position,
                                              Graphics2D g2) {

        RectangleInsets insets = getTickLabelInsets();
        Size2D size = block.calculateDimensions(g2);
        Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),
                size.getHeight());
        Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
                0.0f, 0.0f);
        double h = rotatedBox.getBounds2D().getHeight()
                   + insets.getTop() + insets.getBottom();
        return h;
View Full Code Here

            maxH = this.maxHeight;
        }
        RectangleConstraint rc = new RectangleConstraint(
                new Range(0, maxW), new Range(0, maxH));

        Size2D size = this.title.arrange(g2, rc);
        Rectangle2D titleRect = new Rectangle2D.Double(0, 0, size.width,
                size.height);
        Point2D anchorPoint = RectangleAnchor.coordinates(titleRect,
                this.anchor);
        xx = xx - (float) anchorPoint.getX();
View Full Code Here

TOP

Related Classes of org.jfree.ui.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.