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

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


        for (int i = 0; i < views.size(); i++) {
            View view = (View) views.elementAt(i);

            if (showOutline()) {
                final Size requiredSize = view.getSize();
                final Location location = view.getLocation();

                final int width = requiredSize.getWidth();
                final int height = requiredSize.getHeight();
                final int baseline = location.getY() + view.getBaseline();
                final int left = location.getX() - 10;
                final int top = location.getY() - 10;
                final int right = left + 10 + width - 1 + 10;
                final int bottom = top + 10 + height - 1 + 10;
View Full Code Here


    }

    public void layout(final Size maximumSize) {
        for (int i = 0; i < views.size(); i++) {
            View view = (View) views.elementAt(i);
            view.layout(new Size());
        }

    }
View Full Code Here

        }

    }

    public Size getRequiredSize(final Size maximumSize) {
        return new Size(600, 400);
    }
View Full Code Here

        canvas.drawLine(width - 1, 0, 0, height - 1, Toolkit.getColor(0xff0000));
        canvas.drawText(label, 2, Toolkit.getText(ColorsAndFonts.TEXT_NORMAL).getAscent() + 2, Toolkit.getColor(0), Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
    }

    public Size getRequiredSize(final Size maximumSize) {
        return new Size(requiredWidth, requiredHeight);
    }
View Full Code Here

    @Override
    public void draw(final Canvas canvas) {
        final int baseline = getBaseline();

        final int width = axis.getHeaderOffset();
        final Size s = getSize();
        final Canvas subcanvas = canvas.createSubcanvas(0, 0, width, s.getHeight());
        int offset = ViewConstants.HPADDING;
        icon.draw(subcanvas, offset, baseline);
        offset += icon.getSize().getWidth() + ViewConstants.HPADDING + 0 + ViewConstants.HPADDING;
        title.draw(subcanvas, offset, baseline, getLeft() - offset);

        final int columns = axis.getColumnCount();
        int x = -1;
        x += axis.getHeaderOffset();
        final Color secondary1 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
        canvas.drawLine(x - 1, 0, x - 1, s.getHeight() - 1, secondary1);
        canvas.drawLine(x, 0, x, s.getHeight() - 1, secondary1);
        for (int i = 0; i < columns; i++) {
            x += axis.getColumnWidth(i);
            canvas.drawLine(x, 0, x, s.getHeight() - 1, secondary1);
        }
        canvas.drawLine(0, 0, 0, s.getHeight() - 1, secondary1);

        final int y = s.getHeight() - 1;
        final Color secondary2 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
        canvas.drawLine(0, y, s.getWidth(), y, secondary2);

        if (getState().isObjectIdentified()) {
            final int xExtent = width - 1;
            canvas.drawLine(xExtent - BORDER, top, xExtent - BORDER, top + s.getHeight() - 1, secondary2);
            canvas.drawSolidRectangle(xExtent - BORDER + 1, top, BORDER - 2, s.getHeight() - 2 * top - 1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
        }

        // components
        super.draw(canvas);
    }
View Full Code Here

        // this.focusManager = focusManager;
    }

    @Override
    public Size requiredSize(final Size availableSpace) {
        final Size workspace = getWorkspace().getSize();
        return new Size((int) (workspace.getWidth() * 0.8), (int) (workspace.getHeight() * 0.8));
    }
View Full Code Here

        location = null;
        this.position = position;
    }

    private Location center(final View workspace, final View view) {
        final Size rootSize = workspace.getSize();
        final Location location = new Location(rootSize.getWidth() / 2, rootSize.getHeight() / 2);
        final Size dialogSize = view.getRequiredSize(new Size(rootSize));
        location.subtract(dialogSize.getWidth() / 2, dialogSize.getHeight() / 2);
        return location;
    }
View Full Code Here

            if (st.countTokens() == 2) {
                int width = 0;
                int height = 0;
                width = Integer.valueOf(st.nextToken().trim()).intValue();
                height = Integer.valueOf(st.nextToken().trim()).intValue();
                return new Size(width, height);
            } else {
                throw new IsisConfigurationException("Size not specified correctly in " + name + ": " + initialSize);
            }
        }
        return defaultSize;
View Full Code Here

        bounds.contract(0, statusBarHeight);
        return bounds;
    }

    private Size createSize(final Dimension size) {
        return new Size(size.width, size.height);
    }
View Full Code Here

            // (Bug 1)
            throw new IsisException("Drawing with wrong thread: " + Thread.currentThread());
        }
        // overlayView.layout(new Size(rootView.getSize()));
        // rootView.layout(new Size(rootView.getSize()));
        final Size rootViewSize = rootView.getSize();
        overlayView.layout();
        rootView.layout();
        synchronized (redrawArea) {
            if (!redrawArea.equals(NO_REDRAW)) {
                final Rectangle r2 = new Rectangle(redrawArea.getX(), redrawArea.getY(), redrawArea.getWidth(), redrawArea.getHeight());
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.