qasta / gwt-diagrams

Automatically exported from code.google.com/p/gwt-diagrams
0 stars 0 forks source link

Connector lines not connected to widgets using gwt-mosaic WindowPanel #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use WindowPanel of gwt-mosaic 0.1.7. 
2. In the WindowPanel, use gwt-mosaic LayoutPanel as the container for 
Widgets to connect.
3. Use multi connect to connect Widget #1 to Widget #2 and Widget #2 to 
Widget #3.

What is the expected output? What do you see instead?
Expected output is that Connector lines are drawn connecting edges of 
Widgets. What I see instead is that the Connector lines for Widget #2 is 
drawn far away from the edge of Widget #2. This is the same case for 
Connector lines for the other two Widgets.

What version of the product are you using? On what operating system?
Using gwt-diagrams-0.2-RC00.jar on Windows XP.

Please provide any additional information below.
If I use only GWT 1.5.3's AbsolutePanel, rendering of Connector lines are 
correct.

Original issue reported on code.google.com by lloyd.bo...@oracle.com on 6 Feb 2009 at 1:48

GoogleCodeExporter commented 9 years ago
Sample code follows:

import org.gwt.mosaic.ui.client.WindowPanel;
import org.gwt.mosaic.ui.client.layout.LayoutPanel;

...

WindowPanel windowPanel = new WindowPanel("GWT-Diagrams in a GWT Mosaic 
WindowPanel");

LayoutPanel container= new LayoutPanel(new BorderLayout());

LayoutPanel toolBox = new LayoutPanel(new BoxLayout(Orientation.VERTICAL));
container.add(toolBox, new BorderLayoutData(Region.NORTH));

LayoutPanel canvasPanel = new LayoutPanel();
canvasPanel.setSize("100%", "100%");
content.add(canvasPanel, new BorderLayoutData(Region.CENTER));

PickupDragController dragController  = new AbsolutePositionDropController
(canvasPanel);
AbsolutePositionDropController dropController = new PickupDragController
(canvasPanel, true);

dragController.registerDropController(dropController);

dragController.addDragHandler(new DragHandlerAdapter() {
    public void onPreviewDragEnd(DragEndEvent event) throws VetoDragException {
        Widget node = (Widget) event.getSource();
        Widget draggable = event.getContext().draggable;
        UIObjectConnector connector = UIObjectConnector.getWrapper(draggable);
        if (connector != null) {
            connector.update();
        }
    }
});        

Label label = new Label("AAAA");
this.dragController.makeDraggable(label);
this.canvasPanel.add(label, 10, 10);
Label label2 = new Label("BBBB");
this.dragController.makeDraggable(label2);
this.canvasPanel.add(label2, 10, 50);

Label label3 = new Label("CCC");
this.dragController.makeDraggable(label3);
canvasPanel.add(label3, 10, 100);

Connector c1 = UIObjectConnector.wrap(label);
Connector c2 = UIObjectConnector.wrap(label2);
Connector c3 = UIObjectConnector.wrap(label3);

AbstractConnection connection1 = 
    new StraightTwoEndedConnection(c1, c2);     

AbstractConnection connection2 = 
    new StraightTwoEndedConnection(c2, c3);     

connection1.appendTo(canvasPanel);
connection2.appendTo(canvasPanel);

connection1.update();
connection2.update();

Original comment by lloyd.bo...@oracle.com on 6 Feb 2009 at 2:35

GoogleCodeExporter commented 9 years ago

Original comment by lloyd.bo...@oracle.com on 6 Feb 2009 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by lloyd.bo...@oracle.com on 6 Feb 2009 at 2:42

Attachments:

GoogleCodeExporter commented 9 years ago
Hello!

I'm having the same problem. But I'm not using gwt-mosaic. Only GWT 1.5.3 for 
windows
and GWT-DND 2.5.6.

Thanks in advance for any help.

Original comment by fabrici...@gmail.com on 16 Feb 2009 at 2:48

GoogleCodeExporter commented 9 years ago
Hi!

I have the same problem. My environment is: GWT 1.6.4, gwt-dnd 2.6.4 and gwt-ext
2.0.2, Linux Ubuntu, Firefox 3.0.13

Thanks

Original comment by weissha...@gmail.com on 21 Aug 2009 at 8:16

Attachments:

GoogleCodeExporter commented 9 years ago
Lloyd, just noticed your code and you have the following two declarations the 
wrong way round:
PickupDragController dragController  = new 
AbsolutePositionDropController(canvasPanel);
AbsolutePositionDropController dropController = new 
PickupDragController(canvasPanel, true);

Your initialising your dragController with a DropController and vice versa.

Original comment by nikcol...@gmail.com on 4 Mar 2010 at 4:31