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

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


        ;
        if (x < left - BORDER) {
            return Toolkit.getViewFactory().createDragContentOutline(this, drag.getLocation());
        } else if (x < left) {
            final View dragOverlay = new DragViewOutline(getView());
            return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
        } else {
            return super.dragStart(drag);
        }
    }
View Full Code Here


    @Override
    public DragEvent dragStart(final DragStart drag) {
        if (overBorder(drag.getLocation())) {
            final Location location = drag.getLocation();
            final DragViewOutline dragOverlay = new DragViewOutline(getView());
            return new ViewDragImpl(this, new Offset(location.getX(), location.getY()), dragOverlay);
        } else {
            return super.dragStart(drag);
        }
    }
View Full Code Here

            drag.subtract(subview.getLocation());
            return subview.dragStart(drag);
        } else {
            if (drag.isCtrl()) {
                final View dragOverlay = new DragViewOutline(getView());
                return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
            } else {
                return Toolkit.getViewFactory().createDragContentOutline(this, drag.getLocation());
            }
        }
    }
View Full Code Here

        if (drag.getLocation().getX() > getSize().getWidth() - right) {
            if (getContent().getAdapter() == null) {
                return null;
            }
            final View dragOverlay = new DragViewOutline(getView());
            return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
        } else {
            return super.dragStart(drag);
        }
    }
View Full Code Here

        return adjust(drag.getTargetLocation());
    }

    private int adjust(final Location location) {
        final Bounds contentArea = viewportArea();
        final Offset offset = offset();
        final int yOffset = offset.getDeltaY();
        final int xOffset = offset.getDeltaX();
        if (contentArea.contains(location)) {
            location.subtract(left, top);
            location.add(xOffset, yOffset);
            return CENTER;
        } else {
View Full Code Here

        final int y = location.getY();
        if (verticalScrollBar.isOnThumb(y)) {
            // offset is the distance from the left/top of the thumb to the
            // pointer
            offsetToThumbEdge = y - verticalScrollBar.getPosition();
            return new SimpleInternalDrag(this, new Offset(super.getAbsoluteLocation()));
        } else {
            return null;
        }
    }
View Full Code Here

    private DragEvent dragStartSouth(final DragStart drag) {
        final Location location = drag.getLocation();
        final int x = location.getX();
        if (horizontalScrollBar.isOnThumb(x)) {
            offsetToThumbEdge = x - horizontalScrollBar.getPosition();
            return new SimpleInternalDrag(this, new Offset(super.getAbsoluteLocation()));
        } else {
            return null;
        }
    }
View Full Code Here

    }

    @Override
    public void draw(final Canvas canvas) {
        final Bounds contents = viewportArea();
        final Offset offset = offset();
        final int x = offset.getDeltaX();
        final int y = offset.getDeltaY();

        final int contentWidth = contents.getWidth();
        final int contentHeight = contents.getHeight();

        final Canvas headerCanvasLeft = canvas.createSubcanvas(0, top, left, contentHeight);
View Full Code Here

    public void markDamaged(final Bounds bounds) {
        /*
         * TODO this only works for the main content area, not for the headers.
         * how do we figure out which area to adjust for?
         */
        final Offset offset = offset();
        bounds.translate(-offset.getDeltaX(), -offset.getDeltaY());
        bounds.translate(left, top);
        super.markDamaged(bounds);
    }
View Full Code Here

        final Bounds contents = viewportArea();
        final int width = contents.getWidth();
        final int x = width == 0 ? 0 : horizontalScrollBar.getPosition() * wrappedView.getRequiredSize(Size.createMax()).getWidth() / width;
        final int height = contents.getHeight();
        final int y = height == 0 ? 0 : verticalScrollBar.getPosition() * wrappedView.getRequiredSize(Size.createMax()).getHeight() / height;
        return new Offset(x, y);
    }
View Full Code Here

TOP

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

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.