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

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


        int[] size = new int[] { 12, 20, 40, 60, 85, 100 };
        int x = 160;
        for (int i = 0; i < size.length; i++) {
            View view = new ExampleIconView(content, size[i]);
            view.setLocation(new Location(x, 80));
            x += view.getRequiredSize(new Size()).getWidth() + 15;
            view.setSize(view.getRequiredSize(new Size()));
            workspace.addView(view);
        }

        x = 160;
        for (int i = 0; i < size.length; i++) {
            View view = new ExampleClassIconView(content, size[i]);
            view.setLocation(new Location(x, 230));
            x += view.getRequiredSize(new Size()).getWidth() + 15;
            view.setSize(view.getRequiredSize(new Size()));
            workspace.addView(view);
        }

        size = new int[] { 10, 12, 14, 16, 18, 20, 24, 36, 60 };
        int y = 80;
        for (int i = 0; i < size.length; i++) {
            View view = new ExampleIconViewWithText(content, new ExampleText("Arial-plain-" + size[i]), true);
            view.setLocation(new Location(10, y));
            y += view.getRequiredSize(new Size()).getHeight() + 10;
            view.setSize(view.getRequiredSize(new Size()));
            workspace.addView(view);
        }

        y = 80;
        for (int i = 0; i < size.length; i++) {
            View view = new ExampleIconViewWithText(content, new ExampleText("Arial-plain-" + size[i]), false);
            view.setLocation(new Location(600, y));
            y += view.getRequiredSize(new Size()).getHeight() + 10;
            view.setSize(view.getRequiredSize(new Size()));
            workspace.addView(view);
        }
    }
View Full Code Here


                }
                viewer.clearAction();
            } else if (ke.getKeyCode() == KeyEvent.VK_F5) {
                draggedView = identifiedView;
            } else if (draggedView != null && ke.getKeyCode() == KeyEvent.VK_F6) {
                final ContentDrag content = new ContentDragImpl(draggedView, new Location(), new AbstractView(new NullContent()) {
                });
                if (identifiedView != null) {
                    identifiedView.drop(content);
                }
View Full Code Here

    private void fireMenuPopup(final Click click) {
        if (identifiedView != null) {
            spy.addAction(" popup " + downAt + " over " + identifiedView);

            boolean forView = viewer.viewAreaType(new Location(click.getLocation())) == ViewAreaType.VIEW;
            forView = click.isAlt() ^ forView;
            final boolean includeExploration = click.isCtrl();
            final boolean includeDebug = click.isShift();
            final Location at = click.getLocation();
            at.move(-14, -10);
            viewer.popupMenu(identifiedView, at, forView, includeExploration, includeDebug);
        }
    }
View Full Code Here

        }

        try {
            viewer.translate(me);

            final Location location = createLocation(me.getPoint());
            spy.setLocationInViewer(location);

            if (canDrag) {
                // checked to ensure that dragging over a view doesn't start a
                // drag - it should only start when already over a view.
View Full Code Here

    public void mouseMoved(final MouseEvent me) {
        try {
            if (drag == null) {
                spy.reset();
                viewer.translate(me);
                final Location location = createLocation(me.getPoint());
                spy.setLocationInViewer(location);

                final View overView = viewer.identifyView(new Location(location), true);
                spy.setOver(overView);

                spy.addAction("moved " + location);

                if (overView != null) {
View Full Code Here

            viewer.translate(me);

            downAt = createLocation(me.getPoint());
            spy.setDownAt(downAt);

            final Location location = createLocation(me.getPoint());
            spy.setLocationInViewer(location);

            final View overView = viewer.identifyView(new Location(location), true);
            spy.setOver(overView);
            spy.addAction("Mouse pressed " + location);
            drag = null;

            final Click click = new ClickImpl(downAt, me.getModifiers());
View Full Code Here

        try {
            if (drag != null) {
                mouseDragged(me);

                final Location location = createLocation(me.getPoint());
                final View target = viewer.identifyView(new Location(location), false);
                drag.drag(target, location, me.getModifiers());
                // viewer.clearStatus();
                drag.end(viewer);
                redraw();
View Full Code Here

        final Size defaultWindowSize = new Size(width, height);
        defaultWindowSize.limitWidth(800);
        defaultWindowSize.limitHeight(600);

        final Size size = Properties.getSize(Properties.PROPERTY_BASE + "initial.size", defaultWindowSize);
        final Location location = Properties.getLocation(Properties.PROPERTY_BASE + "initial.location", new Location(x, y));
        return new Bounds(location, size);
    }
View Full Code Here

        final View[] cells = getSubviews();
        int i = 0;
        final int top = CalendarConstants.style.getLineHeight() + ViewConstants.VPADDING;
        CalendarConstants.style.getLineSpacing();
        final Location location = new Location(leftInset, topInset + top);
        final Size size = new Size(columnWidth, rowHeight - top);
        for (int row = 0; row < rows; row++) {
            for (int column = 0; column < columns; column++) {
                final View cell = cells[i++];
                cell.setSize(size);
                cell.setLocation(location);
                location.add(columnWidth, 0);
            }
            location.setX(leftInset);
            location.add(0, rowHeight);
        }
    }
View Full Code Here

        Content content = new RootObject(object);
        ViewSpecification specification = new ExampleViewSpecification();
        ViewAxis axis = null;

        View view = new ScrollBorder(new TestObjectViewWithDragging(content, specification, axis, 800, 800, "both"));
        view.setLocation(new Location(50, 60));
        view.setSize(new Size(216, 216));
        workspace.addView(view);

        view = new ScrollBorder(new TestObjectViewWithDragging(content, specification, axis, 200, 800, "vertical"));
        view.setLocation(new Location(300, 60));
        view.setSize(new Size(216, 216));
        workspace.addView(view);

        view = new ScrollBorder(new TestObjectViewWithDragging(content, specification, axis, 800, 200, "horizontal"));
        view.setLocation(new Location(550, 60));
        view.setSize(new Size(216, 216));
        workspace.addView(view);

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