Reply to comment

Neat Gwittir Demo

A Flickr Browser. Mindnumbingly easy! Code below the fold.
// Create a Vertical stack
 VerticalPanel vp = new VerticalPanel();
 vp.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );

// Create the FlickrSearch bean
FlickrSearch search = new FlickrSearch();

// Create the thumbnail image group:
ReflectedImageGroup group = new ReflectedImageGroup( 100, 75, .2, .5);
// Add a Renderer to extract the thumnail url from the Flickr results:
group.setRenderer( new Renderer(){
            public Object render(Object o) {
                return ((FlickrPhoto) o).getThumbnail();
            }
});

// Bind the group to the Flickr bean
Binding images = new Binding(group, "value", search, "photos");
images.setLeft();
images.bind();

// Create a SoftScrollArea around the thumnails:
SoftScrollArea mmsa =  new SoftScrollArea();
// Add the mouse move scroller to the area
mmsa.addMouseListener( mmsa.MOUSE_MOVE_SCROLL_LISTENER );
 mmsa.setHeight( "190px" );
mmsa.setWidth( "800px" );
// Add the group to the scroll area
mmsa.setWidget( group);
vp.add( mmsa );

// Create the larger image
Image larger = new Image();
// Add a renderer to get the normal URL
 larger.setRenderer( new Renderer(){
       public Object render(Object o) {
          return ((FlickrPhoto) o).getNormal();
     }
});

// Bind the larger image to the "Selected" property of the group
Binding bigBinding = new Binding( larger, "value", group, "selected" );
bigBinding.bind();
vp.add( larger );
        
//Show the whole thing.
RootPanel.get().add( vp );

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <hr> <li> <dl> <dt> <dd> <pre> <b> <h1> <h2> <h3> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 8 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.