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

Examples of org.apache.isis.viewer.dnd.drawing.Location.subtract()


    @Override
    public View subviewFor(final Location location) {
        final Location l = new Location(location);
        final Padding padding = getPadding();
        l.subtract(padding.getLeft(), padding.getTop());
        final View views[] = getSubviews();
        for (int i = views.length - 1; i >= 0; i--) {
            if (views[i].getBounds().contains(l)) {
                return views[i];
            }
View Full Code Here


        if (rootViewLocation.getX() + rootViewSize.getWidth() + PADDING + requiredSize.getWidth() < workspaceSize.getWidth()) {
            newLocation.add(rootViewSize.getWidth() + PADDING, 0);
        } else if (rootViewLocation.getY() + rootViewSize.getHeight() + PADDING + requiredSize.getHeight() < workspaceSize.getHeight()) {
            newLocation.add(0, rootViewSize.getHeight() + PADDING);
        } else if (requiredSize.getWidth() + PADDING < rootViewLocation.getX()) {
            newLocation.subtract(requiredSize.getWidth() + PADDING, 0);
        } else if (requiredSize.getHeight() + PADDING < rootViewLocation.getY()) {
            newLocation.subtract(0, requiredSize.getHeight() + PADDING);
        } else {
            newLocation.add(PADDING * 6, PADDING * 6);
        }
View Full Code Here

        } else if (rootViewLocation.getY() + rootViewSize.getHeight() + PADDING + requiredSize.getHeight() < workspaceSize.getHeight()) {
            newLocation.add(0, rootViewSize.getHeight() + PADDING);
        } else if (requiredSize.getWidth() + PADDING < rootViewLocation.getX()) {
            newLocation.subtract(requiredSize.getWidth() + PADDING, 0);
        } else if (requiredSize.getHeight() + PADDING < rootViewLocation.getY()) {
            newLocation.subtract(0, requiredSize.getHeight() + PADDING);
        } else {
            newLocation.add(PADDING * 6, PADDING * 6);
        }

        final int maxSpaceToLeft = workspaceSize.getWidth() - requiredSize.getWidth();
View Full Code Here

            ((PopupMenuContainer) getParent()).openSubmenu(menuOptions);
        } else {
            final Workspace workspace = getWorkspace();

            final Location location = new Location(getAbsoluteLocation());
            location.subtract(workspace.getView().getAbsoluteLocation());
            final Padding padding = workspace.getView().getPadding();
            location.move(-padding.getLeft(), -padding.getTop());

            final int itemHeight = style().getLineHeight() + VPADDING;
            final int baseLine = itemHeight * option;
 
View Full Code Here

     */
    @Override
    public void firstClick(final Click click) {
        if (canChangeValue().isAllowed()) {
            final Location at = click.getLocation();
            at.subtract(HPADDING, VPADDING);
            cursor.cursorAt(at);
            resetSelection();

            // testing
            if (cursor.getLine() > textContent.getNoLinesOfContent()) {
View Full Code Here

    @Override
    public View subviewFor(final Location location) {
        final Location l = new Location(location);
        final Padding padding = getPadding();
        l.subtract(padding.getLeft(), padding.getTop());
        final View views[] = getSubviews();
        for (int i = views.length - 1; i >= 0; i--) {
            if (views[i].getBounds().contains(l)) {
                return views[i];
            }
View Full Code Here

        View newView;
        if (source.getSpecification().isService()) {
            return;
        } else {
            final Location dropLocation = drag.getTargetLocation();
            dropLocation.subtract(drag.getOffset());

            if (drag.isShift()) {
                newView = Toolkit.getViewFactory().createView(new ViewRequirement(getContent(), ViewRequirement.OPEN | ViewRequirement.SUBVIEW));
                drag.getTargetView().addView(newView);
                newView.setLocation(dropLocation);
View Full Code Here

    private void moveDragView() {
        if (dragView != null) {
            dragView.markDamaged();
            final Location newLocation = new Location(this.location);
            newLocation.subtract(offset);
            dragView.setLocation(newLocation);
            dragView.limitBoundsWithin(workspace.getSize());
            dragView.markDamaged();
        }
    }
View Full Code Here

    }

    @Override
    public Location getTargetLocation() {
        final Location location = new Location(this.location);
        location.subtract(target.getAbsoluteLocation());
        // location.add(-getOffset().getX(), -getOffset().getY());
        // location.add(-getOffset().getX(), -getOffset().getY());

        return location;
    }
View Full Code Here

    }

    @Override
    public Location getViewDropLocation() {
        final Location viewLocation = new Location(location);
        viewLocation.subtract(overlayOffset);
        return viewLocation;
    }

    public void subtract(final Location location) {
        location.subtract(location);
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.