Package org.apache.isis.viewer.dnd.drawing

Examples of org.apache.isis.viewer.dnd.drawing.Size.extend()


    protected abstract void draw(final Canvas canvas, final int x, final int y);

    public Size getRequiredSize(final Size maximumSize) {
        Size s = new Size(requiredSize);
        s.extend(20, 20);
        return s;
    }

    public void setMaximumSize(final Size size) {
        this.requiredSize = size;
View Full Code Here


    }

    @Override
    public Size requiredSize(final Size availableSpace) {
        final Size size = layout.getRequiredSize(this);
        size.extend(getPadding());
        size.ensureHeight(1);
        return size;
    }

    @Override
View Full Code Here

    @Override
    public Size getRequiredSize(final Size availableSpace) {
        availableSpace.contract(getLeft() + getRight(), getTop() + getBottom());
        final Size size = wrappedView.getRequiredSize(availableSpace);
        size.extend(getLeft() + getRight(), getTop() + getBottom());
        return size;
    }

    protected int getRight() {
        return right;
View Full Code Here

    }

    @Override
    public Size getSize() {
        final Size size = wrappedView.getSize();
        size.extend(getLeft() + getRight(), getTop() + getBottom());

        return size;
    }

    protected int getTop() {
View Full Code Here

        }
        if (height > 0 && maximumSize.getHeight() > height) {
            maximumSize.setHeight(height);
        }
        final Size size = wrappedView.getRequiredSize(maximumSize);
        size.extend(getLeft() + getRight(), getTop() + getBottom());
        if (width > 0) {
            size.setWidth(width);
        }
        if (height > 0) {
            size.setHeight(height);
View Full Code Here

                l.translate(location);
            }

            @Override
            public void setSize(final Size size) {
                z.extend(size);
            }
        };

        view.setBounds(new Bounds(20, 30, 40, 50));
        assertEquals(new Location(20, 30), l);
View Full Code Here

            final Text text = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
            size.ensureWidth((line.startsWith("\t") ? 20 : 0) + text.stringWidth(line));
            size.extendHeight(text.getTextHeight());
        }

        size.extend(40, 20);
        return size;
    }

    @Override
    public void draw(final Canvas canvas) {
View Full Code Here

            size.extendHeight(SCROLLBAR_WIDTH);
        }
        if (size.getHeight() > maximumSize.getHeight()) {
            size.extendWidth(SCROLLBAR_WIDTH);
        }
        size.extend(left, top);
        size.limitSize(maximumSize);
        return size;
    }

    @Override
View Full Code Here

            final int itemWidth = item.isBlank ? 0 : style().stringWidth(item.name);
            size.ensureWidth(itemWidth);
            size.extendHeight(style().getLineHeight() + ViewConstants.VPADDING);
        }

        size.extend(getPadding());
        size.extendWidth(ViewConstants.HPADDING * 2);
        return size;
    }

    public int getOption() {
View Full Code Here

        size.ensureWidth(titleText.stringWidth(heading));

        size.extendWidth(errorIcon.getWidth());
        size.extendWidth(PADDING);

        size.extend(LEFT + RIGHT, TOP * 2);
        return size;
    }

    @Override
    public void draw(final Canvas canvas) {
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.