Package kirin.client.model

Examples of kirin.client.model.PhotoModel


          final PopupPanel imagePopup = new PopupPanel(true);
          imagePopup.setAnimationEnabled(true);

          for (int k = 0; k < result.size(); k++) {

            PhotoModel photoModel = result.get(k);

            FlexTable i_layout = new FlexTable();
            i_layout.setCellSpacing(6);
            FlexCellFormatter i_cellFormatter = i_layout.getFlexCellFormatter();
            i_layout.setHTML(0, 0, photoModel.getTitle());

            // add small image to flexTable
            Image thumbImage = new Image(photoModel.getThumbURL());
            i_cellFormatter.setColSpan(0, 0, 1);
            i_cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
            i_layout.setWidget(1, 0, thumbImage);

            DecoratorPanel decPanel = new DecoratorPanel();
            decPanel.setWidget(i_layout);

            if (j >= 5) {
              j = 0;
              i++;
            }
            m_layout.setWidget(i, j++, decPanel);

            // add full image popup windows for small image
            imagePopup.setHeight(photoModel.getHeight() + "px");
            imagePopup.setWidth(photoModel.getWidth() + "px");
            final String fullImageURL = photoModel.getURL();

            final Image fullImage = new Image();

            thumbImage.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
View Full Code Here


      int x_pos = event.getRelativeX(fullImageElement);
      int imageWidth = fullImageElement.getClientWidth();

      if (x_pos > (imageWidth / 2)) {

        PhotoModel nextPhotoModel = currIdx < (photoModelList.size() - 1) ? photoModelList.get(currIdx + 1) : null;

        if (nextPhotoModel != null) {
          loadNewImage(nextPhotoModel, currIdx + 1);
        }

      } else {
        PhotoModel prePhotoModel = currIdx > 0 ? photoModelList.get(currIdx - 1) : null;

        if (prePhotoModel != null) {
          loadNewImage(prePhotoModel, currIdx - 1);
        }
      }
View Full Code Here

    try {
      PicasawebService service = new PicasawebService("Kirin-App");
      service.setAuthSubToken(this.getThreadLocalRequest().getSession().getAttribute("sessionToken").toString());
      URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/" + userId + "/albumid/" + albumid);
      AlbumFeed albumFeed = service.getFeed(feedUrl, AlbumFeed.class);
      PhotoModel photoModel = null;
      for (PhotoEntry photoEntry : albumFeed.getPhotoEntries()) {
        photoModel = new PhotoModel();
        photoModel.setTitle(photoEntry.getTitle().getPlainText());
        photoModel.setThumbURL((photoEntry.getMediaThumbnails().get(2).getUrl()));
        photoModel.setHeight(photoEntry.getMediaGroup().getContents().get(0).getHeight());
        photoModel.setWidth(photoEntry.getMediaGroup().getContents().get(0).getWidth());
        photoModel.setURL(photoEntry.getMediaGroup().getContents().get(0).getUrl());
        result.add(photoModel);
      }
    } catch (Exception e) {
      // log.error(e);
    }
View Full Code Here

TOP

Related Classes of kirin.client.model.PhotoModel

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.