[richfaces-svn-commits] JBoss Rich Faces SVN: r4545 - in trunk/framework/impl/src/main/java/org/richfaces: renderkit/html/images and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 6 07:11:26 EST 2007


Author: akushunin
Date: 2007-12-06 07:11:26 -0500 (Thu, 06 Dec 2007)
New Revision: 4545

Added:
   trunk/framework/impl/src/main/java/org/richfaces/images/
   trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java
   trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java
   trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java
   trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java
   trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java
Log:
RF-1545

Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java	                        (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java	2007-12-06 12:11:26 UTC (rev 4545)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.ResourceContext;
+
+public class SpinnerButtonDown extends SpinnerButtonImage {
+	private static final Dimension dimensions = new Dimension(14, 7);
+	
+	protected Dimension getDimensions(ResourceContext resourceContext) {
+		return dimensions;
+	}
+	public Dimension getDimensions(FacesContext facesContext, Object data) {
+		return dimensions;
+	}
+
+	protected void paint(ResourceContext context, Graphics2D g2d) {
+		Integer color = (Integer) restoreData(context);
+		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		g2d.setColor(new Color(color.intValue()));
+		g2d.drawLine(5,2,9,2);
+		g2d.drawLine(6,3,8,3);
+		g2d.drawLine(7,4,7,4);
+	}
+	
+
+}


Property changes on: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java	                        (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java	2007-12-06 12:11:26 UTC (rev 4545)
@@ -0,0 +1,30 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class SpinnerButtonGradient extends BaseGradient {
+	public SpinnerButtonGradient() {
+		super(30, 50, 20, "headerGradientColor", "headerBackgroundColor");
+	}
+}


Property changes on: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java	                        (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java	2007-12-06 12:11:26 UTC (rev 4545)
@@ -0,0 +1,68 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import java.util.Date;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.GifRenderer;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+public abstract class SpinnerButtonImage extends Java2Dresource {
+
+	public SpinnerButtonImage() {
+		setRenderer(new GifRenderer());
+		setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+	}
+	
+	protected Object deserializeData(byte[] objectArray) {
+		if (objectArray == null) {
+			return null;
+		}
+		
+		return new Integer(new Zipper2(objectArray).nextIntColor());
+	}
+	
+	protected Object getDataToStore(FacesContext context, Object data) {
+		Skin skin = SkinFactory.getInstance().getSkin(context);
+		
+		String skinParameter = "headerTextColor";
+		String headerTextColor = (String) skin.getParameter(context, skinParameter);
+		if (null == headerTextColor || "".equals(headerTextColor)) {
+			Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+			headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
+		}
+		
+		int intValue = HtmlColor.decode( headerTextColor == null ? "#000000":headerTextColor ).getRGB();
+		byte[] ret = new byte[3];
+		new Zipper2(ret).addColor(intValue);
+		
+		return ret;
+	}
+	
+}


Property changes on: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java	                        (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java	2007-12-06 12:11:26 UTC (rev 4545)
@@ -0,0 +1,54 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.ResourceContext;
+
+public class SpinnerButtonUp extends SpinnerButtonImage {
+	private static final Dimension dimensions = new Dimension(14, 7);
+	
+	protected Dimension getDimensions(ResourceContext resourceContext) {
+		return dimensions;
+	}
+	public Dimension getDimensions(FacesContext facesContext, Object data) {
+		return dimensions;
+	}
+
+	protected void paint(ResourceContext context, Graphics2D g2d) {
+		Integer color = (Integer) restoreData(context);
+		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		g2d.setColor(new Color(color.intValue()));
+		g2d.drawLine(5,5,9,5);
+		g2d.drawLine(6,4,8,4);
+		g2d.drawLine(7,3,7,3);
+	}
+	
+
+
+}


Property changes on: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java	                        (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java	2007-12-06 12:11:26 UTC (rev 4545)
@@ -0,0 +1,33 @@
+/**
+ * License Agreement.
+ *
+ *  JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007  Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+public class SpinnerFieldGradient extends BaseGradient {
+
+	public SpinnerFieldGradient() {
+		super(30, 50, 12, "additionalBackgroundColor", "controlBackgroundColor");
+	}
+	
+	
+}


Property changes on: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native




More information about the richfaces-svn-commits mailing list