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

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


        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


    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

            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

            .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

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

            ((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 Location getAbsoluteLocation() {
        final Location location = super.getAbsoluteLocation();
        location.subtract(offset());
        return location;
    }

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

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.