[richfaces-svn-commits] JBoss Rich Faces SVN: r4550 - branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Thu Dec 6 08:21:49 EST 2007
Author: akushunin
Date: 2007-12-06 08:21:48 -0500 (Thu, 06 Dec 2007)
New Revision: 4550
Added:
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java
branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java
Log:
RF-1545
Copied: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java (from rev 4545, branches/3.1.x/ui/inputnumber-spinner/src/main/java/org/richfaces/renderkit/html/images/buttons/SpinnerButtonDown.java)
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java (rev 0)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonDown.java 2007-12-06 13:21:48 UTC (rev 4550)
@@ -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);
+ }
+
+
+}
Copied: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java (from rev 4545, branches/3.1.x/ui/inputnumber-spinner/src/main/java/org/richfaces/renderkit/html/images/background/SpinnerButtonGradient.java)
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java (rev 0)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonGradient.java 2007-12-06 13:21:48 UTC (rev 4550)
@@ -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");
+ }
+}
Copied: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java (from rev 4545, branches/3.1.x/ui/inputnumber-spinner/src/main/java/org/richfaces/renderkit/html/images/buttons/SpinnerButtonImage.java)
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java (rev 0)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonImage.java 2007-12-06 13:21:48 UTC (rev 4550)
@@ -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;
+ }
+
+}
Copied: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java (from rev 4545, branches/3.1.x/ui/inputnumber-spinner/src/main/java/org/richfaces/renderkit/html/images/buttons/SpinnerButtonUp.java)
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java (rev 0)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerButtonUp.java 2007-12-06 13:21:48 UTC (rev 4550)
@@ -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);
+ }
+
+
+
+}
Copied: branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java (from rev 4545, branches/3.1.x/ui/inputnumber-spinner/src/main/java/org/richfaces/renderkit/html/images/background/SpinnerFieldGradient.java)
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java (rev 0)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/renderkit/html/images/SpinnerFieldGradient.java 2007-12-06 13:21:48 UTC (rev 4550)
@@ -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");
+ }
+
+
+}
More information about the richfaces-svn-commits
mailing list