How to tie Image and Label together so when I move Image the

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

How to tie Image and Label together so when I move Image the

Postby guazwk » Wed Nov 18, 2009 7:37 pm

I modify the AbstractConnectinExample so make the diagram have Image
and label.. but I dont know how to tie them up so that both of it can
move together.

Code: Select all
protected UIObjectConnector createConnector(String text, int left, int
top, Direction direction) {

           Image image3 = new Image("img/IBM-z800.jpg");
           image3.setPixelSize(65, 58);
           image3.setTitle("Testing");
           image3.addStyleName("demo-resize-html");
           CustomWidgetLib testing = new CustomWidgetLib("testing");
           //TextBox textbox = new TextBox();
           Label label = new Label(text);

           getArea().add(label, left,top+58);
           getArea().add(image3, left, top);
               dragController.makeDraggable(image3);
               dragController.makeDraggable(label);

               if(direction!=null){
                       return UIObjectConnector.wrap(image3, new Direction[]{direction});
               }
               return UIObjectConnector.wrap(image3);
       }
guazwk
 
Posts: 4
Joined: Wed Nov 18, 2009 7:34 pm

Re: How to tie Image and Label together so when I move Image the

Postby Eric Clayberg » Thu Nov 19, 2009 1:30 am

Put both into a Panel or Composite together and then move the container.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to GWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest