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

Examples of org.apache.isis.viewer.dnd.drawing.Size


        overlayView = view;
        // TODO ensure that the view is laid out properly; hence is the right
        // size to begin with.
        // view.limitSize(rootView.getSize());

        final Size size = view.getRequiredSize(rootView.getSize());
        // size.ensureWidth(getSize().getWidth());
        view.setSize(size);
        view.layout();

        view.limitBoundsWithin(getOverlaySize());
View Full Code Here


    @Override
    public void showInOverlay(final Content content, final Location location) {
        View view;
        view = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.OPEN));
        view = new LineBorder(2, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2), new BackgroundBorder(Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3), view));
        final Size size = view.getRequiredSize(Size.createMax());
        location.subtract(size.getWidth() / 2, size.getHeight() / 2);
        view.setLocation(location);
        setOverlayView(view);
    }
View Full Code Here

        insets = renderingArea.getInsets();
        LOG.debug("  insets " + insets);
        internalDisplaySize.contract(insets.left + insets.right, insets.top + insets.bottom);
        LOG.debug("  internal " + internalDisplaySize);

        final Size rootViewSize = new Size(internalDisplaySize);
        final Text text = Toolkit.getText(ColorsAndFonts.TEXT_STATUS);
        statusBarHeight = text.getLineHeight() + text.getDescent();
        rootViewSize.contractHeight(statusBarHeight);
        statusBarArea = new Bounds(insets.left, insets.top + rootViewSize.getHeight(), rootViewSize.getWidth(), statusBarHeight);
        rootView.setSize(rootViewSize);
    }
View Full Code Here

            } else {
                final View[] subviews = getSubviews();
                int max = 0;
                for (final View row : subviews) {
                    final View cell = row.getSubviews()[column];
                    max = Math.max(max, cell.getRequiredSize(new Size()).getWidth());
                }
                axis.setWidth(column, max);
            }
            axis.invalidateLayout();
        } else {
View Full Code Here

    protected void doLayout(final Size maximumSize) {
        int x = ViewConstants.HPADDING;
        int y = 0;
        int lineHeight = 0;
        for (final View button : getSubviews()) {
            final Size buttonSize = button.getRequiredSize(Size.createMax());
            if (x + buttonSize.getWidth() >= maximumSize.getWidth()) {
                x = ViewConstants.HPADDING;
                y += lineHeight + ViewConstants.VPADDING;
                lineHeight = 0;
            }
            button.setSize(buttonSize);
            button.setLocation(new Location(x, y));
            x += buttonSize.getWidth() + ViewConstants.HPADDING;
            lineHeight = Math.max(lineHeight, buttonSize.getHeight());
        }
    }
View Full Code Here

    @Override
    public Size requiredSize(final Size availableSpace) {
        int lineHeight = 0;
        int lineWidth = ViewConstants.HPADDING;
        final Size requiredSize = new Size();
        for (final View button : getSubviews()) {
            final Size buttonSize = button.getRequiredSize(availableSpace);
            lineWidth += buttonSize.getWidth() + ViewConstants.HPADDING;
            if (lineWidth >= availableSpace.getWidth()) {
                lineWidth = ViewConstants.HPADDING;
                requiredSize.extendHeight(lineHeight + ViewConstants.VPADDING);
                lineHeight = 0;
            }
            lineHeight = Math.max(lineHeight, buttonSize.getHeight());
            requiredSize.ensureWidth(lineWidth);
        }
        requiredSize.extendHeight(lineHeight + ViewConstants.VPADDING);
        return requiredSize;
    }
View Full Code Here

        debug.append("InternalCollectionBorder ");
    }

    @Override
    public Size getRequiredSize(final Size maximumSize) {
        final Size size = super.getRequiredSize(maximumSize);
        size.ensureWidth(left + 45 + right);
        size.ensureHeight(24);
        return size;
    }
View Full Code Here

        final int noBars = axis.getNoBars();
        final int height = barHeight * noBars;
        final View[] subviews = view.getSubviews();
        int y = ViewConstants.VPADDING;
        for (final View bar : subviews) {
            bar.setSize(new Size(width, height));
            bar.setLocation(new Location(ViewConstants.HPADDING, y));
            y += height;
        }
    }
View Full Code Here

    public Size getRequiredSize(final View view) {
        final HistogramAxis axis = view.getViewAxes().getAxis(HistogramAxis.class);
        final int noBars = axis.getNoBars();
        final View[] subviews = view.getSubviews();
        final int graphHeight = subviews.length * barHeight * noBars + ViewConstants.VPADDING * 2;
        return new Size(width + ViewConstants.HPADDING * 2, graphHeight);
    }
View Full Code Here

     * @see org.nakedobjects.plugins.dnd.field.DatePicker#getRequiredSize(org.
     * nakedobjects.plugins.dnd.drawing.Size)
     */
    @Override
    public Size getRequiredSize(final Size availableSpace) {
        return new Size(labelWidth + COLUMNS * cellWidth + 2, headerHeight + calendarHeight + controlHeight + 2);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.drawing.Size

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.