Package org.apache.isis.viewer.dnd

Examples of org.apache.isis.viewer.dnd.View


    }

    protected void views(final Workspace workspace) {
        // AbstractView.debug = true;

        View view = new HelpView("Name", "Description summerising the named feature", "A very log help text");
        view.setLocation(new Location(50, 60));
        view.setSize(view.getMaximumSize());
        workspace.addView(view);
        /*
         * view = new TestCanvasView(); view.setLocation(new Location(300, 60)); view.setSize(new Size(216,
         * 300)); workspace.addView(view);
         *
 
View Full Code Here


            public String getHelp(final View view) {
                return null;
            }
        };

        View view = new Button(action, workspace);
        view.setLocation(new Location(100, 100));
        view.setSize(view.getRequiredSize(new Size()));
        workspace.addView(view);

        ButtonAction action2 = new ButtonAction() {

            public Consent disabled(final View view) {
                return Veto.DEFAULT;
            }

            public void execute(final Workspace workspace, final View view, final Location at) {
                view.getFeedbackManager().setViewDetail("Button 1 pressed");
            }

            public String getDescription(final View view) {
                return "Button that can't be pressed";
            }

            public ObjectActionType getType() {
                return USER;
            }

            public String getName(final View view) {
                return "Press Me Now!";
            }

            public boolean isDefault() {
                return false;
            }

            public String getHelp(final View view) {
                return null;
            }

        };

        View view2 = new Button(action2, workspace);
        view2.setLocation(new Location(200, 100));
        view2.setSize(view2.getRequiredSize(new Size()));
        workspace.addView(view2);
    }
View Full Code Here

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

        View view = new ButtonBorder(actions, new TestObjectView(content, specification, axis, 200, 80, "VIEW in border"));

        view.setLocation(new Location(100, 100));
        view.setSize(view.getRequiredSize(new Size()));
        workspace.addView(view);

    }
View Full Code Here

        ObjectAdapter object = createExampleObjectForView();
        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

    public static void main(final String[] args) {
        new PasswordFieldExample();
    }

    protected void views(final Workspace workspace) {
        View parent = new ParentView();

        Content content = new DummyTextParseableField("password");
        ViewSpecification specification = new ExampleViewSpecification();
        ViewAxis axis = null;
View Full Code Here

        int maxHeight = size.getHeight();

        View[] views = view.getSubviews();

        for (int i = 0; i < views.length; i++) {
            View v = views[i];
            ObjectAdapter object = ((ObjectContent) v.getContent()).getObject();

            if (field == null) {
                ObjectSpecification nc = object.getSpecification();
                ObjectField[] fields = nc.getFields();

                for (int j = 0; j < fields.length; j++) {
                    field = fields[j];

                    if (field.getType().isOfType(Isis.getSpecificationLoader().loadSpecification(TimePeriod.class))) {
                        break;
                    }
                }
            }

            TimePeriod tp = (TimePeriod) object.getField(field);
      int y = (int) (((tp.getStart().longValue() - from) * maxHeight) / to);
            int height = (int) (((tp.getEnd().longValue() - tp.getStart().longValue()) * maxHeight) / to);

            v.setLocation(new Location(x, y));
            v.setSize(new Size(width, height));
        }
    }
View Full Code Here

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

        View v = new TestObjectView(content, specification, axis, 300, 120, "normal");

        View objectBorder = new ObjectBorder(1, v);

        View scrollBorder = new ScrollBorder(objectBorder);
        scrollBorder.setSize(new Size(200, 200));

        View view = new WindowBorder(scrollBorder, false);
        view.setLocation(new Location(50, 60));
        view.setSize(view.getRequiredSize(new Size()));
        workspace.addView(view);

        view = new WindowBorder(new TestObjectView(content, specification, axis, 100, 30, "active"), false);
        view.setLocation(new Location(200, 300));
        view.setSize(view.getRequiredSize(new Size()));
        workspace.addView(view);

        view.getState().setActive();

        view = new WindowBorder(new TestObjectView(content, specification, axis, 100, 30, "view identified"), false);
        view.setLocation(new Location(200, 400));
        view.setSize(view.getRequiredSize(new Size()));
        workspace.addView(view);

        view.getState().setInactive();
        view.getState().setRootViewIdentified();

    }
View Full Code Here

        Bounds bounds = getBounds();
        canvas.drawRectangle(0, 0, bounds.getWidth(), bounds.getHeight(), Toolkit.getColor(0x0000ff));
        canvas.drawText("Test Workspace", 10, 20, Toolkit.getColor(0x0000ff), Toolkit.getText(ColorsAndFonts.TEXT_TITLE));

        for (int i = 0; i < views.size(); i++) {
            View view = (View) views.elementAt(i);

            if (showOutline()) {
                final Size requiredSize = view.getSize();
                final Location location = view.getLocation();

                final int width = requiredSize.getWidth();
                final int height = requiredSize.getHeight();
                final int baseline = location.getY() + view.getBaseline();
                final int left = location.getX() - 10;
                final int top = location.getY() - 10;
                final int right = left + 10 + width - 1 + 10;
                final int bottom = top + 10 + height - 1 + 10;

                // horizontal lines
                canvas.drawLine(left, top + 10, right, top + 10, markerDark);
                canvas.drawLine(left, bottom - 10, right, bottom - 10, markerDark);

                // vertical lines
                canvas.drawLine(left + 10, top, left + 10, bottom, markerDark);
                canvas.drawLine(right - 10, top, right - 10, bottom, markerDark);

                canvas.drawRectangle(left + 10, top + 10, width - 1, height - 1, markerLight);

                canvas.drawLine(left, baseline, left + 10, baseline, markerDark);
                canvas.drawLine(right - 10, baseline, right, baseline, markerDark);
                canvas.drawLine(left + 10, baseline, right - 10, baseline, markerLight);
            }
            Canvas subcanvas = canvas.createSubcanvas(view.getBounds());
            view.draw(subcanvas);
        }

    }
View Full Code Here

        this.showOutline = showOutline;
    }

    public View subviewFor(final Location location) {
        for (int i = 0; i < views.size(); i++) {
            View view = (View) views.elementAt(i);
            if (view.getBounds().contains(location)) {
                return view;
            }
        }

        return null;
View Full Code Here

        return null;
    }

    public void layout(final Size maximumSize) {
        for (int i = 0; i < views.size(); i++) {
            View view = (View) views.elementAt(i);
            view.layout(new Size());
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.View

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.