Package com.google.gwt.user.client.ui.impl

Examples of com.google.gwt.user.client.ui.impl.ClippedImageImpl$Template


      y1 -=
          rfm.stringWidth(String.valueOf(label.charAt(0)).toCharArray()) * Math
              .sin(Math.abs(angle)) + 5;
    }
    Bounds b = new Bounds();
    ClippedImageImpl ci = (ClippedImageImpl) GWT.create(ClippedImageImpl.class);

    for (int i = 0; i < label.length(); i++) {
      char c = label.charAt(i);
      rfm.getBounds(b, c);
      Element elem = (Element) ci
          .createStructure(rfm.url, (int) b.x, (int) (b.y + 1), (int) b.width,
              (int) b.height);

      DOM.setStyleAttribute(elem, "position", "absolute");
      DOM.setStyleAttribute(elem, "left", (x1 - layer.bounds.x) + "px");
View Full Code Here


        return result;
    }
   
    @Test
    public void testSimple() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        Assert.assertEquals("This is a test FOO\nBAR", t.eval(env(
                "foo", "FOO",
                "bar", "BAR")));
    }
View Full Code Here

                "bar", "BAR")));
    }
   
    @Test
    public void testJustPlaceholder() {
        Template t = new Template("@[foo]");
        Assert.assertEquals("FOO", t.eval(env(
                "foo", "FOO")));
    }
View Full Code Here

                "foo", "FOO")));
    }
   
    @Test
    public void testSimpleMissing() {
        Template t = new Template("This is a test @[foo]\n@[bar]");
        try {
            t.eval(env(
                    "foo", "FOO"));
            Assert.fail();
        } catch (RuntimeException e) {
            Assert.assertEquals("No replacement for bar at line 2", e.getMessage());
        }
        t = new Template("This is a test @[foo]\n\r\n@[bar]");
        try {
            t.eval(env(
                    "foo", "FOO"));
            Assert.fail();
        } catch (RuntimeException e) {
            Assert.assertEquals("No replacement for bar at line 3", e.getMessage());
        }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.impl.ClippedImageImpl$Template

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.