Package org.richfaces.photoalbum.util

Examples of org.richfaces.photoalbum.util.ImageHandler


        if (this.selectedImage == null && (model.getImages() == null || model.getImages().size() < 1)) {
            onError(true);
            return;
        }
        if (this.selectedImage == null) {
            this.selectedImage = new ImageHandler(model.getImages().get(this.slideshowIndex));
        }
        // mark image as 'visited'
        if (this.selectedImage.getType() == ImageHandler.LOCAL) {
            ((Image) this.selectedImage.getImage()).setVisited(true);
        }
View Full Code Here


     */
    public void startSlideshow(Image selectedImage) {
        initSlideshow();
        this.slideshowIndex = model.getImages().indexOf(selectedImage);
        this.startSlideshowIndex = this.slideshowIndex;
        this.selectedImage = new ImageHandler(selectedImage);

        startSlideshow();
    }
View Full Code Here

        startSlideshow();
    }
   
    public void startSlideshow(JSONObject remoteImage) {
        initSlideshow();
        this.selectedImage = new ImageHandler(remoteImage);
        switch(selectedImage.getType()) {
            case ImageHandler.FACEBOOK:
                this.slideshowIndex = fac.getCurrentImages().indexOf(remoteImage);
                break;
            case ImageHandler.GOOGLE:
View Full Code Here

   
    public void startSlideshowRemote(int kind) {
        this.slideshowIndex = this.startSlideshowIndex = 0;
        switch(kind) {
            case ImageHandler.FACEBOOK:
                this.selectedImage = new ImageHandler(fac.getCurrentImages().get(0));
                break;
            case ImageHandler.GOOGLE:
                this.selectedImage = new ImageHandler(gpac.getCurrentImages().get(0));
        }
       
        startSlideshow();
    }
View Full Code Here

        Event event = model.getSelectedEvent();

        // add local images into the list
        for (Image i : event.getShelf().getImages()) {
            images.add(new ImageHandler(i));
        }

        /*
         * Facebook
         */

        List<String> facebookIds = event.getFacebookAlbumIds();

        if (facebookIds.size() != 0) {
            // check if albums are loaded
            emptyFacebookIds = new ArrayList<String>(Collections2.filter(facebookIds, new Predicate<String>() {

                @Override
                public boolean apply(String id) {
                    return !fac.isAlbumLoaded(id);
                }
            }));

            facebookAlbumIds = new ArrayList<String>(Collections2.filter(facebookIds, new Predicate<String>() {

                @Override
                public boolean apply(String id) {
                    return fac.isAlbumLoaded(id);
                }
            }));

            // set up the id
            setFbAlbumIds(ListConverter.sListToString(emptyFacebookIds));

            // load the loaded images
            for (String lId : facebookAlbumIds) {
                for (JSONObject fImage : fac.getImagesFromAlbum(lId)) {
                    images.add(new ImageHandler(fImage));
                }
            }

            setFacebookNeedsUpdate(emptyFacebookIds.size() > 0);
        }

        /*
         * Google+
         */

        emptyGoogleIds = new LinkedList<String>();
        googleAlbumIds = new ArrayList<String>();

        googleAlbumIds = event.getGooglePlusAlbumIds();

        if (googleAlbumIds.size() != 0) {

            for (String fullId : googleAlbumIds) {
                if (!gpac.isAlbumLoaded(fullId)) {
                    emptyGoogleIds.add(fullId);
                } else {
                    for (JSONObject gImage : gpac.getImagesOfAlbum(fullId).values()) {
                        images.add(new ImageHandler(gImage));
                    }
                }
            }
        }

View Full Code Here

        setPollEnabled(emptyGoogleIds.size() > 0);
    }

    private void addGoogleImages(String albumId) {
        for (JSONObject jo : gpac.getImagesOfAlbum(albumId).values()) {
            images.add(new ImageHandler(jo));
        }
    }
View Full Code Here

    }

    public void loadFBImages() {
        for (String albumId : emptyFacebookIds) {
            for (JSONObject jo : fac.getImagesFromAlbum(albumId)) {
                images.add(new ImageHandler(jo));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.richfaces.photoalbum.util.ImageHandler

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.