Package com.reveregroup.carousel.client.events

Examples of com.reveregroup.carousel.client.events.PhotoFocusEvent


    handlerManager = new HandlerManager(this);
   
    carousel.addPhotoClickHandler(new PhotoClickHandler() {
      public void photoClicked(PhotoClickEvent event) {
        if (event.getPhotoIndex() == target.getCurrentPhotoIndex()) {
          PhotoFocusEvent evt = new PhotoFocusEvent();
          evt.setPhoto(event.getPhoto());
          evt.setPhotoIndex(event.getPhotoIndex());
          lastFocusEvent = evt;
          handlerManager.fireEvent(evt);
        }
      }
    });
   
    addPhotoFocusHandler(new PhotoFocusHandler() {
      public void photoFocused(PhotoFocusEvent event) {
         
        if (popup == null) {
          lightbox = DOM.createDiv();
            lightbox.setClassName("lightbox");
            if (getUserAgent().contains("msie")) {
              lightbox.setClassName("lightbox lightboxIE");
            }
            lightbox.getStyle().setProperty("zIndex", "100");
            RootPanel.getBodyElement().appendChild(lightbox);
            popup = new PopupPanel(true,true);
          popupImage = new Image();
          dockPanel.add(popupImage, DockPanel.CENTER);
            popup.add(dockPanel);
            popup.getElement().getStyle().setProperty("zIndex", "150");
          popup.addCloseHandler(new CloseHandler<PopupPanel>(){
            public void onClose(CloseEvent<PopupPanel> event) {
              popup.hide();
              lightbox.getStyle().setProperty("display", "none");
              PhotoUnfocusEvent evt = new PhotoUnfocusEvent();
              evt.setPhotoIndex(lastFocusEvent.getPhotoIndex());
              evt.setPhoto(lastFocusEvent.getPhoto());
              handlerManager.fireEvent(evt);
            }
          });
        }
       
View Full Code Here

TOP

Related Classes of com.reveregroup.carousel.client.events.PhotoFocusEvent

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.