[richfaces-svn-commits] JBoss Rich Faces SVN: r14110 - in trunk/examples/photoalbum/source/web/src/main: java/org/richfaces/photoalbum/ui and 3 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon May 11 15:02:27 EDT 2009


Author: amarkhel
Date: 2009-05-11 15:02:27 -0400 (Mon, 11 May 2009)
New Revision: 14110

Modified:
   trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java
   trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageEditInfo.xhtml
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageInfo.xhtml
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageList.xhtml
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/slideshow.xhtml
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
   trunk/examples/photoalbum/source/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
Log:


Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java	2009-05-11 17:53:10 UTC (rev 14109)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java	2009-05-11 19:02:27 UTC (rev 14110)
@@ -44,10 +44,14 @@
 	
 	private Integer slideshowIndex;
 	
+	private Integer startSlideshowIndex;
+	
 	private Image selectedImage;
 	
 	private boolean active;
 	
+	private boolean errorDetected;
+	
 	@In Model model;
 	
 	private int interval = Constants.INITIAL_DELAY;
@@ -75,8 +79,10 @@
 	public void startSlideshow(){
 		active = true;
 		this.slideshowIndex = 0;
+		this.startSlideshowIndex = 0;
 		if(model.getImages() == null || model.getImages().size() < 1){
 			stopSlideshow();
+			errorDetected = true;
 			Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_IMAGES_FOR_SLIDESHOW_ERROR);
 			return;
 		}
@@ -88,6 +94,7 @@
 		if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
 			Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
 			active = false;
+			errorDetected = true;
 			model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, this.selectedImage.getAlbum().getOwner(), this.selectedImage.getAlbum().getShelf(), this.selectedImage.getAlbum(), null, this.selectedImage.getAlbum().getImages());
 			return;
 		}
@@ -102,10 +109,12 @@
 		active = true;
 		if(model.getImages() == null || model.getImages().size() < 1){
 			stopSlideshow();
+			errorDetected = true;
 			Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_IMAGES_FOR_SLIDESHOW_ERROR);
 			return;
 		}
 		this.slideshowIndex = model.getImages().indexOf(selectedImage);
+		this.startSlideshowIndex = this.slideshowIndex;
 		this.selectedImage = selectedImage;
 		//mark image as 'visited'
 		this.selectedImage.setVisited(true);
@@ -114,6 +123,7 @@
 		if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
 			Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
 			active = false;
+			errorDetected = true;
 			model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, this.selectedImage.getAlbum().getOwner(), this.selectedImage.getAlbum().getShelf(), this.selectedImage.getAlbum(), null, this.selectedImage.getAlbum().getImages());
 			return;
 		}
@@ -126,8 +136,10 @@
 	@Observer(Constants.STOP_SLIDESHOW_EVENT)
 	public void stopSlideshow(){
 		active = false;
+		errorDetected = false;
 		this.selectedImage = null;
 		this.slideshowIndex = 0;
+		this.startSlideshowIndex = 0;
 	}
 
 	public Integer getSlideshowIndex() {
@@ -152,6 +164,7 @@
 	 */
 	public void showNextImage(){
 		if(!active){
+			errorDetected = true;
 			return;
 		}
 		//reset index if we reached last image
@@ -159,6 +172,11 @@
 			slideshowIndex = -1;
 		}
 		slideshowIndex++;
+		if(slideshowIndex == startSlideshowIndex){
+			stopSlideshow();
+			errorDetected = true;
+			return;
+		}
 		selectedImage = model.getImages().get(slideshowIndex);
 		//mark image as 'visited'
 		this.selectedImage.setVisited(true);
@@ -167,8 +185,25 @@
 		if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
 			Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
 			active = false;
+			errorDetected = true;
 			model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, this.selectedImage.getAlbum().getOwner(), this.selectedImage.getAlbum().getShelf(), this.selectedImage.getAlbum(), null, this.selectedImage.getAlbum().getImages());
 			return;
 		}
 	}
+
+	public Integer getStartSlideshowIndex() {
+		return startSlideshowIndex;
+	}
+
+	public void setStartSlideshowIndex(Integer startSlideshowIndex) {
+		this.startSlideshowIndex = startSlideshowIndex;
+	}
+
+	public boolean isErrorDetected() {
+		return errorDetected;
+	}
+
+	public void setErrorDetected(boolean errorDetected) {
+		this.errorDetected = errorDetected;
+	}
 }
\ No newline at end of file

Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java	2009-05-11 17:53:10 UTC (rev 14109)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java	2009-05-11 19:02:27 UTC (rev 14110)
@@ -5,6 +5,9 @@
 
 import java.io.File;
 import java.io.Serializable;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
 
 import javax.faces.model.SelectItem;
 
@@ -27,7 +30,7 @@
 @Scope(ScopeType.EVENT)
 public class UserPrefsHelper implements Serializable{
 	private static final long serialVersionUID = -1767281809514660171L;
-	
+	private Calendar calendar;
 	@In IUserAction userAction;
 	
 	@In(required=false, scope=ScopeType.CONVERSATION) @Out(required=false, scope=ScopeType.CONVERSATION) private File avatarData;
@@ -45,6 +48,13 @@
 		avatarData = item.getFile();
 	}
 
+	public Date getDefaultDate(){
+		if(calendar == null){
+			calendar = new GregorianCalendar(1980, Calendar.DECEMBER, 25);
+		}
+	    return calendar.getTime();
+	}
+	
 	public File getAvatarData() {
 		return avatarData;
 	}

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageEditInfo.xhtml
===================================================================
(Binary files differ)

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageList.xhtml
===================================================================
(Binary files differ)

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml	2009-05-11 17:53:10 UTC (rev 14109)
+++ trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/inputNumberSlider.xhtml	2009-05-11 19:02:27 UTC (rev 14110)
@@ -5,8 +5,8 @@
 	xmlns:a4j="http://richfaces.org/a4j"
 	xmlns:rich="http://richfaces.org/rich"
 	xmlns:richx="http://richfaces.org/richx">
-	<div><h:panelGrid columns="2">
-	<rich:inputNumberSlider enableManualInput="false"
+	<div><h:panelGrid columns="3">
+	<h:outputText value="Image Dimension:"/><rich:inputNumberSlider rendered="#{model.images.size > 0}" enableManualInput="false"
 		value="#{imageSizeHelper.value}" minValue="80" maxValue="200"
 		showArrows="false" showBoundaryValues="true" showInput="false"
 		step="40" width="100">

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
===================================================================
(Binary files differ)

Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
===================================================================
(Binary files differ)




More information about the richfaces-svn-commits mailing list