Demo is not working as expected for me! Java 1.8, Chrome browser, GWT 2.7, Win10

26 views
Skip to first unread message

Muhammad Zbeedat

unread,
Oct 21, 2017, 3:47:52 AM10/21/17
to gwt-connectors
Hi,
I'm trying to follow your example (found some changes that I had to align with -gwt-connectors-2.4.0-):
// Create boundary panel
AbsolutePanel boundaryPanel = new AbsolutePanel();
boundaryPanel.setSize("800px", "400px");

RootPanel.get().add(boundaryPanel, 10, 10);

Diagram diagram = new Diagram(boundaryPanel);
boundaryPanel.add(new Label("Connectors example"), 10, 2);

// Add connectors
Connector connector1 = new Connector(50, 80, 100, 100);
connector1.showOnDiagram(diagram);
Connector connector2 = new Connector(350, 200, 270, 80);
connector2.showOnDiagram(diagram);
Connector connector3 = new Connector(450, 120, 500, 80);
connector3.showOnDiagram(diagram);

// Add some elements that can be connected
Label label = new Label("LABEL");
image.setSize("100px", "100px");

HTML html = new HTML("<b>HTML<br>ELEMENT</b>");

boundaryPanel.add(label, 50, 270);
boundaryPanel.add(image, 180, 250);
boundaryPanel.add(html, 450, 250);


Shape shapeForLabel = new Shape(label);
shapeForLabel.showOnDiagram(diagram);

Shape shapeForImage = new Shape(image);
shapeForImage.showOnDiagram(diagram);


Shape shapeForHtml = new Shape(html);
shapeForHtml.showOnDiagram(diagram);


// If you want to have some elements already connected
//ConnectionPoint imageConnectionPoint = shapeForLabel.connectionPoints[Shape.E];
//ConnectionPoint labelConnectionPoint = shapeForImage.connectionPoints[Shape.W];
ConnectionPoint imageConnectionPoint = shapeForLabel.connectionPoints.get(1);
ConnectionPoint labelConnectionPoint = shapeForImage.connectionPoints.get(1); 

Connector image2label = new Connector(imageConnectionPoint.getAbsoluteLeft(),
imageConnectionPoint.getAbsoluteTop(),
labelConnectionPoint.getAbsoluteLeft(),
labelConnectionPoint.getAbsoluteTop());


image2label.startEndPoint.glueToConnectionPoint(imageConnectionPoint);
image2label.endEndPoint.glueToConnectionPoint(labelConnectionPoint);
image2label.showOnDiagram(diagram);

 I have some questions:

1. What is Shape.E & Shape.W? They do not exist in the new Shape class any more!
2. In order to make this code compiles I had to include this jar as well: gwt-dnd-3.3.4
3. When loading my gwt app am getting 3 shapes (label, html element and image) and three links, but the link between label and image is not performed automatically!


4. Is there an option to make the links fixed? I mean the user can't disconnect them, he can drag and play with it for changing positions but without the option to edit it.
5. When the host page is loaded am getting a weird error:
GET /recompile/gwt_connectors_demo
   Job com.gwt.connector.demo.GWT_Connectors_Demo_1_0
      starting job: com.gwt.connector.demo.GWT_Connectors_Demo_1_0
      binding: user.agent=safari
      Compiling module com.gwt.connector.demo.GWT_Connectors_Demo
         Computing all possible rebind results for 'com.allen_sauer.gwt.dnd.client.util.DragClientBundle'
            Rebinding com.allen_sauer.gwt.dnd.client.util.DragClientBundle
               Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
                  Preparing method css
                     The following problems were detected
                        [WARN] Line 63 column 30: encountered "=". Was expecting one of: "+" "-" "," "/" ")" <STRING> <IDENT> <NUMBER> <URL> <PERCENTAGE> <PT> <MM> <CM> <PC> <IN> <PX> <EMS> <EXS> <DEG> <RAD> <GRAD> <MS> <SECOND> <HZ> <KHZ> <DIMEN> <HASH> <UNICODERANGE> <FUNCTION> 
         Unification traversed 18644 fields and methods and 1738 types. 1706 are considered part of the current module and 1706 had all of their fields and methods traversed.
         Compiling 1 permutation
            Compiling permutation 0...
            Linking per-type JS with 1690 new types.
               prelink JS size = 3018555
               prelink sourcemap = 3018555 bytes and 83179 lines
               postlink JS size = 2888358
               postlink sourcemap = 2888358 bytes and 79719 lines
            Source Maps Enabled
         Compile of permutations succeeded
         Compilation succeeded -- 8.958s


Please advice...

B.R.


Muhammad Zbeedat

unread,
Oct 21, 2017, 3:52:25 AM10/21/17
to gwt-connectors
Reg. item 5 there is an opened issue for gwt-dnd on it (without a response yet since 2015):
Reply all
Reply to author
Forward
0 new messages