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

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


    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

        return "ViewDrag [" + super.toString() + "]";
    }

    private void updateDraggingLocation() {
        final Location viewLocation = new Location(location);
        viewLocation.subtract(overlayOffset);
        overlayView.setLocation(viewLocation);
        overlayView.limitBoundsWithin(viewsWorkspace.getSize());
    }

    @Override
View Full Code Here

    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;
    }

    public void position(final Workspace workspace, final View view) {
        switch (position) {
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

            ((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() + ViewConstants.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(ViewConstants.HPADDING, ViewConstants.VPADDING);
            cursor.cursorAt(at);
            resetSelection();

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

    public void drop(final ViewDrag drag) {
        if (drag.getSourceView() == getView() || !contains(drag.getSourceView())) {
            super.drop(drag);
        } else {
            final Location dropAt = drag.getLocation();
            dropAt.subtract(getLocation());
            final int x = dropAt.getX();
            final int y = dropAt.getY();
            final int borderWdth = 45;
            final int left = getSize().getWidth() - borderWdth;
            final int bottom = getSize().getHeight() - borderWdth;
View Full Code Here

    }

    @Override
    public Location getAbsoluteLocation() {
        final Location location = super.getAbsoluteLocation();
        location.subtract(offset());
        return location;
    }

    @Override
    public Bounds getBounds() {
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.