Author: andrei_exadel
Date: 2009-03-06 11:56:28 -0500 (Fri, 06 Mar 2009)
New Revision: 12875
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageSizeHelper.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
Log:
Slider for image size change
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageSizeHelper.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageSizeHelper.java
(rev 0)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageSizeHelper.java 2009-03-06
16:56:28 UTC (rev 12875)
@@ -0,0 +1,75 @@
+/**
+ *
+ */
+package org.richfaces.realworld.ui;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+@Name("imageSizeHelper")
+(a)Scope(ScopeType.CONVERSATION)
+public class ImageSizeHelper {
+
+ int value;
+
+ final static String CSS_CLASS = "preview_box_album_";
+
+ final static String FILE_POSTFIX = "_small";
+
+ public static enum ImageDimension {
+
+ SIZE1 (80, 60),
+ SIZE2 (120, 80),
+ SIZE3 (160, 100),
+ SIZE4 (160, 100);
+
+ int x;
+ int y;
+
+ private ImageDimension(int x, int y) {
+ this.x = x;
+ this.y = y;
+
+ }
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public String getCssClass() {
+ return CSS_CLASS + x;
+ }
+
+ public String getFilePostfix() {
+ return FILE_POSTFIX + x;
+ }
+ };
+
+ static ImageDimension [] dimensions = new ImageDimension []
+ {
+ ImageDimension.SIZE1, ImageDimension.SIZE2,
+ ImageDimension.SIZE3, ImageDimension.SIZE4
+ };
+
+ public ImageDimension getCurrentDimension() {
+ return dimensions[value];
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+
+}
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
===================================================================
(Binary files differ)
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
===================================================================
---
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
(rev 0)
+++
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml 2009-03-06
16:56:28 UTC (rev 12875)
@@ -0,0 +1,66 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:richx="http://richfaces.org/richx">
+ <style>
+ .inputSlider {
+ height: auto;
+ margin-right: -7px;
+ margin-left: -3px;
+ position: relative;
+ }
+ .sliderBorder {
+ width: 100%;
+ border-left: 1px solid #636363;
+ height: 4px;
+ }
+ </style>
+ <div>
+ <table border="0" cellpadding="0"
cellspacing="0">
+ <tr style="height: 20px; padding-botton: 3px">
+ <td>
+ <div class="font-size: 9px">80-60</div>
+ </td>
+ <td>
+ <div style="font-size: 9px">120-80</div>
+ </td>
+ <td>
+ <div style="font-size: 9px">160-120</div>
+ </td>
+ <td>
+ <div style="font-size: 9px">500-375</div>
+ </td>
+ </tr>
+ <tr style="height: 4px">
+ <td style="width: 25%">
+ <div class="sliderBorder" style="height:
4px"></div>
+ </td>
+ <td style="width: 25%">
+ <div class="sliderBorder" style="height:
4px"></div>
+ </td>
+ <td style="width: 25%">
+ <div class="sliderBorder" style="border-right: 1px solid
#636363;"></div>
+ </td>
+ <td style="width: 25%">
+ <div></div>
+ </td>
+ </tr>
+ <tr><td colspan="3" style="overflow: visible">
+ <rich:inputNumberSlider enableManualInput="false"
+ value="#{imageSizeHelper.value}"
+ minValue="0"
+ maxValue="3"
+ style="height: auto"
+ styleClass="inputSlider"
+ showArrows="false"
+ showBoundaryValues="false"
+ showInput="false"
+ step="1">
+ <a4j:support event="onchange"
reRender="userAlbumImages"></a4j:support>
+ </rich:inputNumberSlider>
+ </td><td></td></tr></table>
+ </div>
+</ui:composition>
\ No newline at end of file
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
---
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-06
16:56:19 UTC (rev 12874)
+++
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-06
16:56:28 UTC (rev 12875)
@@ -470,4 +470,6 @@
width: 25px;
}
-
+.dr-insldr-vert-spacer {
+ padding: 0px;
+ }