Author: nbelaevski
Date: 2010-05-21 09:15:51 -0400 (Fri, 21 May 2010)
New Revision: 17174
Modified:
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
Log:
https://jira.jboss.org/browse/RF-8457
Modified:
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
---
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2010-05-21
13:05:57 UTC (rev 17173)
+++
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2010-05-21
13:15:51 UTC (rev 17174)
@@ -150,7 +150,7 @@
}
public Dimension getDimension() {
- return new Dimension(width, height);
+ return new Dimension(getWidth(), getHeight());
}
/**
@@ -160,6 +160,14 @@
return gradientHeight;
}
+ protected int getHeight() {
+ return height;
+ }
+
+ protected int getWidth() {
+ return width;
+ }
+
/**
* @return the baseColor
*/
Modified:
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java
===================================================================
---
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2010-05-21
13:05:57 UTC (rev 17173)
+++
root/core/trunk/impl/src/main/java/org/richfaces/renderkit/html/images/BaseControlBackgroundImage.java 2010-05-21
13:15:51 UTC (rev 17174)
@@ -21,14 +21,13 @@
package org.richfaces.renderkit.html.images;
+import javax.faces.context.FacesContext;
+
import org.ajax4jsf.util.NumericDataInputStream;
import org.ajax4jsf.util.NumericDataOutputStream;
import org.richfaces.renderkit.html.BaseGradient;
import org.richfaces.skin.Skin;
-import javax.faces.context.FacesContext;
-import java.awt.*;
-
/**
* Created 23.02.2008
*
@@ -38,10 +37,6 @@
public abstract class BaseControlBackgroundImage extends BaseGradient {
- private static final Dimension DEFAULT_DIMENSION = new Dimension(1, 1);
-
- private Dimension dimension = null;
-
//TODO - lazy initialize?
private Integer height = getHeight(FacesContext.getCurrentInstance(),
Skin.GENERAL_SIZE_FONT);
@@ -50,14 +45,10 @@
}
@Override
- public Dimension getDimension() {
- if (dimension != null) {
- return dimension;
- }
-
- return DEFAULT_DIMENSION;
+ protected int getHeight() {
+ return height;
}
-
+
@Override
protected void writeState(FacesContext context,
NumericDataOutputStream stream) {