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

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


    }

    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


        return sourceContent;
    }

    @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

        return sourceView;
    }

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

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

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

        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

     *            TODO combine the two constructors
     */
    public SimpleInternalDrag(final View view, final Location location) {
        this.view = view;

        this.location = new Location(location);
        offset = view.getAbsoluteLocation();

        final Padding targetPadding = view.getPadding();
        final Padding containerPadding = view.getView().getPadding();
        offset.add(containerPadding.getLeft() - targetPadding.getLeft(), containerPadding.getTop() - targetPadding.getTop());
View Full Code Here

    }

    public SimpleInternalDrag(final View view, final Offset off) {
        this.view = view;

        location = new Location();

        offset = new Location(off.getDeltaX(), off.getDeltaY());

        final Padding targetPadding = view.getPadding();
        final Padding containerPadding = view.getView().getPadding();
        offset.add(containerPadding.getLeft() - targetPadding.getLeft(), containerPadding.getTop() - targetPadding.getTop());
View Full Code Here

    /**
     * Gets the location of the pointer relative to the view.
     */
    @Override
    public Location getLocation() {
        return new Location(location);
    }
View Full Code Here

     *            java.awt.event.MouseEvent)
     */
    public ClickImpl(final Location mouseLocation, final int modifiers) {
        super(modifiers);

        this.location = new Location(mouseLocation);
        this.locationWithinViewer = new Location(mouseLocation);
    }
View Full Code Here

            if (st.countTokens() == 2) {
                int x = 0;
                int y = 0;
                x = Integer.valueOf(st.nextToken().trim()).intValue();
                y = Integer.valueOf(st.nextToken().trim()).intValue();
                return new Location(x, y);
            } else {
                throw new IsisConfigurationException("Location not specified correctly in " + name + ": " + initialLocation);
            }
        }
        return defaultLocation;
View Full Code Here

TOP

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

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.