myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r891184 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/layout/ core/src/test/java/org/apache/myfaces/tobago/layout/ extension/math/src/test/java/org/apache/my...
Date Wed, 16 Dec 2009 10:55:32 GMT
Author: lofwyr
Date: Wed Dec 16 10:55:31 2009
New Revision: 891184

URL: http://svn.apache.org/viewvc?rev=891184&view=rev
Log:
move ZERO constant to Measure

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/IntervalList.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Measure.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
    myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java
    myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/component/GridLayoutManagerUnitTest.java
    myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java
    myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/CombinationEquationUnitTest.java
    myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/EquationManagerUnitTest.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
    myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java
Wed Dec 16 10:55:31 2009
@@ -133,7 +133,7 @@
     }
 
     // set the size if all sizes are set
-    Measure size = PixelMeasure.ZERO;
+    Measure size = Measure.ZERO;
     PixelMeasure[] sizes = grid.getSizes(orientation);
     for (int j = 0; j < sizes.length; j++) {
       if (sizes[j] == null) {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/IntervalList.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/IntervalList.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/IntervalList.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/IntervalList.java
Wed Dec 16 10:55:31 2009
@@ -84,7 +84,7 @@
   }
 
   private Measure max(List<Measure> list) {
-    Measure max = PixelMeasure.ZERO;
+    Measure max = Measure.ZERO;
     for (Measure measure : list) {
       if (measure.getPixel() > max.getPixel()) {
         max = measure;

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Measure.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Measure.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Measure.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Measure.java
Wed Dec 16 10:55:31 2009
@@ -29,11 +29,13 @@
 
   private static final Log LOG = LogFactory.getLog(Measure.class);
 
+  public static final Measure ZERO = new PixelMeasure(0);
+
   // todo: refactor and consolidate with LayoutToken
 
   public static Measure parse(Object object) {
     if (object == null) {
-      return PixelMeasure.ZERO; // fixme: may return a "default measure", or is Pixel the
default?
+      return ZERO;
     }
     if (object instanceof Measure) {
       return (Measure) object;
@@ -44,7 +46,7 @@
     String value = object instanceof String ? (String) object : object.toString();
     
     if (StringUtils.isEmpty(value)) {
-      return PixelMeasure.ZERO; // fixme: may return a "default measure", or is Pixel the
default?
+      return ZERO;
     }
     if (value.toLowerCase().matches("\\d+px")) {// XXX no regexp here: user LayoutTokens.parse
!!!
       return new PixelMeasure(Integer.parseInt(value.substring(0, value.length() - 2)));

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/PixelMeasure.java
Wed Dec 16 10:55:31 2009
@@ -27,8 +27,6 @@
 
   private static final Log LOG = LogFactory.getLog(PixelMeasure.class);
 
-  public static final Measure ZERO = new PixelMeasure(0);
-
   private final int pixel;
 
   public PixelMeasure(int pixel) {

Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java
(original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/IntervalListUnitTest.java
Wed Dec 16 10:55:31 2009
@@ -31,7 +31,7 @@
   public void test0() {
     IntervalList list = new IntervalList();
     Measure auto = list.computeAuto();
-    Assert.assertEquals(PixelMeasure.ZERO, auto);
+    Assert.assertEquals(Measure.ZERO, auto);
   }
 
   /**

Modified: myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/component/GridLayoutManagerUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/component/GridLayoutManagerUnitTest.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/component/GridLayoutManagerUnitTest.java
(original)
+++ myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/component/GridLayoutManagerUnitTest.java
Wed Dec 16 10:55:31 2009
@@ -54,30 +54,30 @@
     UIEquationGridLayout manager = new UIEquationGridLayout();
     manager.setColumns("*;2*");
     manager.setRows("*");
-    manager.setColumnSpacing(PixelMeasure.ZERO);
-    manager.setRowSpacing(PixelMeasure.ZERO);
+    manager.setColumnSpacing(Measure.ZERO);
+    manager.setRowSpacing(Measure.ZERO);
     manager.setParent(container);
     container.setLayoutManager(manager);
 
     container.setWidth(new PixelMeasure(300));
     container.setHeight(new PixelMeasure(20));
-    container.setLeftOffset(PixelMeasure.ZERO);
-    container.setTopOffset(PixelMeasure.ZERO);
-    container.setRightOffset(PixelMeasure.ZERO);
-    container.setBottomOffset(PixelMeasure.ZERO);
+    container.setLeftOffset(Measure.ZERO);
+    container.setTopOffset(Measure.ZERO);
+    container.setRightOffset(Measure.ZERO);
+    container.setBottomOffset(Measure.ZERO);
     EquationLayoutContext layoutContext = new EquationLayoutContext(container);
     layoutContext.layout();
 
     Measure[] result = layoutContext.getHorizontal().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(300), new PixelMeasure(100), new PixelMeasure(200), PixelMeasure.ZERO,
+        new PixelMeasure(300), new PixelMeasure(100), new PixelMeasure(200), Measure.ZERO,
         new PixelMeasure(100), new PixelMeasure(200)}, result);
 
     result = layoutContext.getVertical().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(20), new PixelMeasure(20), PixelMeasure.ZERO, new PixelMeasure(20),
new PixelMeasure(20)},
+        new PixelMeasure(20), new PixelMeasure(20), Measure.ZERO, new PixelMeasure(20), new
PixelMeasure(20)},
         result);
 
     Assert.assertEquals("width of container", 300, container.getWidth().getPixel());
@@ -102,17 +102,17 @@
     container.getComponents().add(c);
     MockComponent span = new MockComponent();
     container.getComponents().add(span);
-    container.setLeftOffset(PixelMeasure.ZERO);
-    container.setTopOffset(PixelMeasure.ZERO);
-    container.setRightOffset(PixelMeasure.ZERO);
-    container.setBottomOffset(PixelMeasure.ZERO);
+    container.setLeftOffset(Measure.ZERO);
+    container.setTopOffset(Measure.ZERO);
+    container.setRightOffset(Measure.ZERO);
+    container.setBottomOffset(Measure.ZERO);
     span.setColumnSpan(2);
 
     UIEquationGridLayout manager = new UIEquationGridLayout();
     manager.setColumns("*;*;*");
     manager.setRows("*");
-    manager.setColumnSpacing(PixelMeasure.ZERO);
-    manager.setRowSpacing(PixelMeasure.ZERO);
+    manager.setColumnSpacing(Measure.ZERO);
+    manager.setRowSpacing(Measure.ZERO);
     manager.setParent(container);
     container.setLayoutManager(manager);
 
@@ -124,13 +124,13 @@
     Measure[] result = layoutContext.getHorizontal().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(300), new PixelMeasure(100), new PixelMeasure(100), new PixelMeasure(100),
PixelMeasure.ZERO,
+        new PixelMeasure(300), new PixelMeasure(100), new PixelMeasure(100), new PixelMeasure(100),
Measure.ZERO,
         new PixelMeasure(100), new PixelMeasure(200)}, result);
 
     result = layoutContext.getVertical().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(20), new PixelMeasure(20), PixelMeasure.ZERO, new PixelMeasure(20),
new PixelMeasure(20)},
+        new PixelMeasure(20), new PixelMeasure(20), Measure.ZERO, new PixelMeasure(20), new
PixelMeasure(20)},
         result);
 
     Assert.assertEquals("width of container", 300, container.getWidth().getPixel());
@@ -172,42 +172,42 @@
     UIEquationGridLayout manager = new UIEquationGridLayout();
     manager.setColumns("*;2*;500px");
     manager.setRows("*;600px");
-    manager.setColumnSpacing(PixelMeasure.ZERO);
-    manager.setRowSpacing(PixelMeasure.ZERO);
+    manager.setColumnSpacing(Measure.ZERO);
+    manager.setRowSpacing(Measure.ZERO);
     manager.setParent(container);
     container.setLayoutManager(manager);
 
     UIEquationGridLayout subManager = new UIEquationGridLayout();
     subManager.setColumns("7*;3*");
     subManager.setRows("*;*");
-    subManager.setColumnSpacing(PixelMeasure.ZERO);
-    subManager.setRowSpacing(PixelMeasure.ZERO);
+    subManager.setColumnSpacing(Measure.ZERO);
+    subManager.setRowSpacing(Measure.ZERO);
     subManager.setParent(subContainer);
     subContainer.setLayoutManager(subManager);
     subContainer.getComponents().add(new MockComponent());
     subContainer.getComponents().add(new MockComponent());
     subContainer.getComponents().add(new MockComponent());
     subContainer.getComponents().add(new MockComponent());
-    subContainer.setLeftOffset(PixelMeasure.ZERO);
-    subContainer.setTopOffset(PixelMeasure.ZERO);
-    subContainer.setRightOffset(PixelMeasure.ZERO);
-    subContainer.setBottomOffset(PixelMeasure.ZERO);
+    subContainer.setLeftOffset(Measure.ZERO);
+    subContainer.setTopOffset(Measure.ZERO);
+    subContainer.setRightOffset(Measure.ZERO);
+    subContainer.setBottomOffset(Measure.ZERO);
 
     container.setWidth(new PixelMeasure(800));
     container.setHeight(new PixelMeasure(800));
-    container.setLeftOffset(PixelMeasure.ZERO);
-    container.setTopOffset(PixelMeasure.ZERO);
-    container.setRightOffset(PixelMeasure.ZERO);
-    container.setBottomOffset(PixelMeasure.ZERO);
+    container.setLeftOffset(Measure.ZERO);
+    container.setTopOffset(Measure.ZERO);
+    container.setRightOffset(Measure.ZERO);
+    container.setBottomOffset(Measure.ZERO);
     EquationLayoutContext layoutContext = new EquationLayoutContext(container);
     layoutContext.layout();
 
     Measure[] result = layoutContext.getHorizontal().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(800), new PixelMeasure(100), new PixelMeasure(200), new PixelMeasure(500),
PixelMeasure.ZERO,
+        new PixelMeasure(800), new PixelMeasure(100), new PixelMeasure(200), new PixelMeasure(500),
Measure.ZERO,
         new PixelMeasure(100), new PixelMeasure(700), new PixelMeasure(100), new PixelMeasure(200),
-        new PixelMeasure(500), new PixelMeasure(350), new PixelMeasure(150), PixelMeasure.ZERO,
new PixelMeasure(350),
+        new PixelMeasure(500), new PixelMeasure(350), new PixelMeasure(150), Measure.ZERO,
new PixelMeasure(350),
         new PixelMeasure(150), new PixelMeasure(350), new PixelMeasure(150)
     }, result);
 
@@ -215,10 +215,10 @@
     result = layoutContext.getVertical().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(800), new PixelMeasure(200), new PixelMeasure(600), PixelMeasure.ZERO,
+        new PixelMeasure(800), new PixelMeasure(200), new PixelMeasure(600), Measure.ZERO,
         new PixelMeasure(200), new PixelMeasure(200),
         new PixelMeasure(600), new PixelMeasure(600), new PixelMeasure(600),
-        new PixelMeasure(300), new PixelMeasure(300), PixelMeasure.ZERO,
+        new PixelMeasure(300), new PixelMeasure(300), Measure.ZERO,
         new PixelMeasure(300), new PixelMeasure(300),
         new PixelMeasure(300), new PixelMeasure(300)
     }, result);
@@ -253,33 +253,33 @@
     UIEquationGridLayout manager1 = new UIEquationGridLayout();
     manager1.setColumns("*;*;*");
     manager1.setRows("*;*");
-    manager1.setColumnSpacing(PixelMeasure.ZERO);
-    manager1.setRowSpacing(PixelMeasure.ZERO);
+    manager1.setColumnSpacing(Measure.ZERO);
+    manager1.setRowSpacing(Measure.ZERO);
     manager1.setParent(container);
     container.setLayoutManager(manager1);
 
     UIEquationGridLayout manager2 = new UIEquationGridLayout();
     manager2.setColumns("*;*;*");
     manager2.setRows("*");
-    manager2.setColumnSpacing(PixelMeasure.ZERO);
-    manager2.setRowSpacing(PixelMeasure.ZERO);
+    manager2.setColumnSpacing(Measure.ZERO);
+    manager2.setRowSpacing(Measure.ZERO);
     manager2.setParent(span1);
     span1.setLayoutManager(manager2);
 
     UIEquationGridLayout manager3 = new UIEquationGridLayout();
     manager3.setColumns("*;*;*");
     manager3.setRows("*");
-    manager3.setColumnSpacing(PixelMeasure.ZERO);
-    manager3.setRowSpacing(PixelMeasure.ZERO);
+    manager3.setColumnSpacing(Measure.ZERO);
+    manager3.setRowSpacing(Measure.ZERO);
     manager3.setParent(span2);
     span2.setLayoutManager(manager3);
 
     container.setWidth(new PixelMeasure(900));
     container.setHeight(new PixelMeasure(200));
-    container.setLeftOffset(PixelMeasure.ZERO);
-    container.setTopOffset(PixelMeasure.ZERO);
-    container.setRightOffset(PixelMeasure.ZERO);
-    container.setBottomOffset(PixelMeasure.ZERO);
+    container.setLeftOffset(Measure.ZERO);
+    container.setTopOffset(Measure.ZERO);
+    container.setRightOffset(Measure.ZERO);
+    container.setBottomOffset(Measure.ZERO);
     EquationLayoutContext layoutContext = new EquationLayoutContext(container);
     layoutContext.layout();
 
@@ -288,18 +288,18 @@
     Measure[] result = layoutContext.getHorizontal().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(900), new PixelMeasure(300), new PixelMeasure(300), new PixelMeasure(300),
PixelMeasure.ZERO,
+        new PixelMeasure(900), new PixelMeasure(300), new PixelMeasure(300), new PixelMeasure(300),
Measure.ZERO,
         new PixelMeasure(300), new PixelMeasure(600), new PixelMeasure(200), new PixelMeasure(200),
-        new PixelMeasure(200), PixelMeasure.ZERO, new PixelMeasure(600), new PixelMeasure(200),
new PixelMeasure(200),
-        new PixelMeasure(200), PixelMeasure.ZERO, new PixelMeasure(300)
+        new PixelMeasure(200), Measure.ZERO, new PixelMeasure(600), new PixelMeasure(200),
new PixelMeasure(200),
+        new PixelMeasure(200), Measure.ZERO, new PixelMeasure(300)
     }, result);
 
     result = layoutContext.getVertical().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(200), new PixelMeasure(100), new PixelMeasure(100), PixelMeasure.ZERO,
-        new PixelMeasure(100), new PixelMeasure(100), new PixelMeasure(100), PixelMeasure.ZERO,
-        new PixelMeasure(100), new PixelMeasure(100), PixelMeasure.ZERO, new PixelMeasure(100)},
+        new PixelMeasure(200), new PixelMeasure(100), new PixelMeasure(100), Measure.ZERO,
+        new PixelMeasure(100), new PixelMeasure(100), new PixelMeasure(100), Measure.ZERO,
+        new PixelMeasure(100), new PixelMeasure(100), Measure.ZERO, new PixelMeasure(100)},
         result);
 
     Assert.assertEquals("width of container", 900, container.getWidth().getPixel());
@@ -337,31 +337,31 @@
     UIEquationGridLayout manager = new UIEquationGridLayout();
     manager.setColumns("*;*");
     manager.setRows("*;*");
-    manager.setColumnSpacing(PixelMeasure.ZERO);
-    manager.setRowSpacing(PixelMeasure.ZERO);
+    manager.setColumnSpacing(Measure.ZERO);
+    manager.setRowSpacing(Measure.ZERO);
     manager.setParent(container);
     container.setLayoutManager(manager);
 
     container.setWidth(new PixelMeasure(800));
     container.setHeight(new PixelMeasure(800));
-    container.setLeftOffset(PixelMeasure.ZERO);
-    container.setTopOffset(PixelMeasure.ZERO);
-    container.setRightOffset(PixelMeasure.ZERO);
-    container.setBottomOffset(PixelMeasure.ZERO);
+    container.setLeftOffset(Measure.ZERO);
+    container.setTopOffset(Measure.ZERO);
+    container.setRightOffset(Measure.ZERO);
+    container.setBottomOffset(Measure.ZERO);
     EquationLayoutContext layoutContext = new EquationLayoutContext(container);
     layoutContext.layout();
 
     Measure[] result = layoutContext.getHorizontal().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(800), new PixelMeasure(400), new PixelMeasure(400), PixelMeasure.ZERO,
+        new PixelMeasure(800), new PixelMeasure(400), new PixelMeasure(400), Measure.ZERO,
         new PixelMeasure(400), new PixelMeasure(400), new PixelMeasure(400)}, result);
 
 
     result = layoutContext.getVertical().getResult();
     LOG.info("result: " + Arrays.toString(result));
     Assert.assertArrayEquals(new Measure[]{
-        new PixelMeasure(800), new PixelMeasure(400), new PixelMeasure(400), PixelMeasure.ZERO,
+        new PixelMeasure(800), new PixelMeasure(400), new PixelMeasure(400), Measure.ZERO,
         new PixelMeasure(800), new PixelMeasure(400), new PixelMeasure(400)}, result);
 
     Assert.assertEquals("width of container", 800, container.getWidth().getPixel());

Modified: myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java
(original)
+++ myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java
Wed Dec 16 10:55:31 2009
@@ -26,11 +26,11 @@
 
   private List<LayoutComponent> components;
 
-  private Measure leftOffset = PixelMeasure.ZERO;
-  private Measure topOffset = PixelMeasure.ZERO;
+  private Measure leftOffset = Measure.ZERO;
+  private Measure topOffset = Measure.ZERO;
 
-  private Measure rightOffset = PixelMeasure.ZERO;
-  private Measure bottomOffset = PixelMeasure.ZERO;
+  private Measure rightOffset = Measure.ZERO;
+  private Measure bottomOffset = Measure.ZERO;
 
   public MockContainer() {
     components = new ArrayList<LayoutComponent>();

Modified: myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/CombinationEquationUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/CombinationEquationUnitTest.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/CombinationEquationUnitTest.java
(original)
+++ myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/CombinationEquationUnitTest.java
Wed Dec 16 10:55:31 2009
@@ -18,6 +18,7 @@
  */
 
 import org.apache.myfaces.tobago.internal.layout.MathUtils;
+import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.layout.PixelMeasure;
 import org.junit.Assert;
 import org.junit.Test;
@@ -28,11 +29,11 @@
   public void testToString() {
     
     Assert.assertEquals("CombinationEquation:  x_0 = x_4 (test)",
-        new CombinationEquation(4, 0, 1, PixelMeasure.ZERO, null, "test").toString());
+        new CombinationEquation(4, 0, 1, Measure.ZERO, null, "test").toString());
     Assert.assertEquals("CombinationEquation:  x_0 + x_1 = x_4 (test)",
-        new CombinationEquation(4, 0, 2, PixelMeasure.ZERO, null, "test").toString());
+        new CombinationEquation(4, 0, 2, Measure.ZERO, null, "test").toString());
     Assert.assertEquals("CombinationEquation:  x_0 + ... + x_2 = x_4 (test)",
-        new CombinationEquation(4, 0, 3, PixelMeasure.ZERO, null, "test").toString());
+        new CombinationEquation(4, 0, 3, Measure.ZERO, null, "test").toString());
 
     Assert.assertEquals("CombinationEquation:  x_0 = x_4 (test)",
         new CombinationEquation(4, 0, 1, new PixelMeasure(5), null, "test").toString());
@@ -47,11 +48,11 @@
     int length = 8;
     double[] row;
 
-    row = new CombinationEquation(4, 0, 1, PixelMeasure.ZERO, null, "test").fillRow(length);
+    row = new CombinationEquation(4, 0, 1, Measure.ZERO, null, "test").fillRow(length);
     Assert.assertArrayEquals(new double[] {-1, 0, 0, 0, 1, 0, 0, 0}, row, MathUtils.EPSILON);
-    row = new CombinationEquation(4, 0, 2, PixelMeasure.ZERO, null, "test").fillRow(length);
+    row = new CombinationEquation(4, 0, 2, Measure.ZERO, null, "test").fillRow(length);
     Assert.assertArrayEquals(new double[] {-1, -1, 0, 0, 1, 0, 0, 0}, row, MathUtils.EPSILON);
-    row = new CombinationEquation(4, 0, 3, PixelMeasure.ZERO, null, "test").fillRow(length);
+    row = new CombinationEquation(4, 0, 3, Measure.ZERO, null, "test").fillRow(length);
     Assert.assertArrayEquals(new double[] {-1, -1, -1, 0, 1, 0, 0, 0}, row, MathUtils.EPSILON);
 
     row = new CombinationEquation(4, 0, 1, new PixelMeasure(5), null, "test").fillRow(length);

Modified: myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/EquationManagerUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/EquationManagerUnitTest.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/EquationManagerUnitTest.java
(original)
+++ myfaces/tobago/trunk/extension/math/src/test/java/org/apache/myfaces/tobago/layout/math/EquationManagerUnitTest.java
Wed Dec 16 10:55:31 2009
@@ -364,7 +364,7 @@
   }
 
   private static Measure px0() {
-    return PixelMeasure.ZERO;
+    return Measure.ZERO;
   }
 
 }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
Wed Dec 16 10:55:31 2009
@@ -49,7 +49,7 @@
     if (toolbar != null) {
       Measure padding = getResourceManager().getThemeMeasure(facesContext, box, "paddingTopWhenToolbar");
       style.setPaddingTop(padding);
-      style.setPaddingBottom(PixelMeasure.ZERO);
+      style.setPaddingBottom(Measure.ZERO);
     }
 
     writer.startElement(HtmlConstants.FIELDSET, box);

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
Wed Dec 16 10:55:31 2009
@@ -130,7 +130,7 @@
   public Measure getPreferredWidth(FacesContext facesContext, Configurable component) {
 
     UIButton button = (UIButton) component;
-    Measure width = PixelMeasure.ZERO;
+    Measure width = Measure.ZERO;
     boolean image = button.getImage() != null;
     if (image) {
       width = getResourceManager().getThemeMeasure(facesContext, button, "imageWidth");

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
Wed Dec 16 10:55:31 2009
@@ -32,7 +32,6 @@
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.layout.LayoutContext;
 import org.apache.myfaces.tobago.layout.Measure;
-import org.apache.myfaces.tobago.layout.PixelMeasure;
 import org.apache.myfaces.tobago.renderkit.PageRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -675,7 +674,7 @@
     if (menuBar != null) {
       return getResourceManager().getThemeMeasure(facesContext, menuBar, "fixedHeight");
     } else {
-      return PixelMeasure.ZERO;
+      return Measure.ZERO;
     }
   }
 }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
Wed Dec 16 10:55:31 2009
@@ -283,7 +283,7 @@
     writer.writeClassAttribute("tobago-sheet-body-div ");
     Style sheetBodyStyle = new Style(bodyStyle);
     if (!showHeader) {
-      bodyStyle.setPaddingTop(PixelMeasure.ZERO);
+      bodyStyle.setPaddingTop(Measure.ZERO);
     }
     writer.writeStyleAttribute(bodyStyle);
     if (bodyStyle.getWidth() != null) {
@@ -673,7 +673,7 @@
   private Measure getFooterHeight(FacesContext facesContext, UISheet sheet) {
     return isFooterVisible(sheet) 
         ? getResourceManager().getThemeMeasure(facesContext, sheet, "footerHeight")
-        : PixelMeasure.ZERO;
+        : Measure.ZERO;
   }
   
   private boolean isFooterVisible(UISheet sheet) {

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
Wed Dec 16 10:55:31 2009
@@ -135,7 +135,7 @@
     // tabs and render it as they are selected, and it will
     // selected with stylesheet.
     int virtualTab = 0;
-    Measure currentWidth = PixelMeasure.ZERO;
+    Measure currentWidth = Measure.ZERO;
 
     Measure navigationBarWidth = getResourceManager().getThemeMeasure(facesContext, tabGroup,
"navigationBarWidth");
     for (UIComponent tab : (List<UIComponent>) tabGroup.getChildren()) {
@@ -181,7 +181,7 @@
   }
 
   private Measure getCurrentWidth(TabList tabs, int tabIndex) {
-    Measure currentWidth = PixelMeasure.ZERO;
+    Measure currentWidth = Measure.ZERO;
     for (int i = 0; i <= tabIndex; i++) {
       currentWidth = currentWidth.add(tabs.getWidthList().get(i));
     }
@@ -214,7 +214,7 @@
           }
           tabs.lastIndex = index;
         } else {
-          tabs.getWidthList().add(PixelMeasure.ZERO);
+          tabs.getWidthList().add(Measure.ZERO);
         }
         index++;
       }

Modified: myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=891184&r1=891183&r2=891184&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
Wed Dec 16 10:55:31 2009
@@ -26,7 +26,6 @@
 import org.apache.myfaces.tobago.component.UIBox;
 import org.apache.myfaces.tobago.component.UIToolBar;
 import org.apache.myfaces.tobago.layout.Measure;
-import org.apache.myfaces.tobago.layout.PixelMeasure;
 import org.apache.myfaces.tobago.renderkit.BoxRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -102,7 +101,7 @@
 
     // todo: shadow = 0px means, that shadow is disabled, but it may be better, if we can
set a boolean in the config.
     Measure measure = getResourceManager().getThemeMeasure(facesContext, box, "shadow");
-    boolean hasShadow = measure.greaterThan(PixelMeasure.ZERO);
+    boolean hasShadow = measure.greaterThan(Measure.ZERO);
 
     if (hasShadow) {
       // shadow begin



Mime
View raw message