As for now, no documentation exists. It is the first checkin on that
branch after all :).

Since there's no fancy JavaScript going on, I don't see why you
couldn't invoke it directly from GWT. I haven't really considered
packaging it for GWT, but now that you say it, it makes perfect sense.

It has not yet been optimized at all, so if you do plan on making use
of it, you may want to take that into account.

Good luck,
Allain

On Jan 10, 7:20 pm, Ben Suter <ben.su...@gmail.com> wrote:
> Hi Allain,
> I'm glad someone has tackled this - it's been a few years since I used
> (the Java version of) Piccolo, but back then I was curious how long
> until it would be ported to JS. I've embedded Piccolo ZUI's in the
> browser as applets, but would love to go the plugin-free route. I
> checked out your examples. Do you have any documentation on how to get
> started using your library? In particular, do you think it would work
> well with GWT / do you think you might package it as a library for
> GWT?
>
> Thanks,
> Ben.
>
> On Jan 4, 12:16 pm, piccol...@googlecode.com wrote:
>
>
>
> > Revision: 922
> > Author: allain.lalonde
> > Date: Mon Jan  4 10:15:57 2010
> > Log: Initial Piccolo2d port to Javascript.
>
> > It makes use of the canvas tag, which limits it to Chrome, Safari and  
> > Firefox for the time being, but there exist wrappers for IE (excanvas) and  
> > there's talk about supporting the HTML5 canvas tag in the next version.
>
> > It currently supports the core functionality:
> > - scene construction
> > - activities.html
> > - events (mouseup, mousedown, click, mousemove)
>
> > I have tried (by using some John Resig code) to retain the basic "feel" of  
> > Piccolo2d even though JavaScript doesn't quite support object inheritance  
> > in the way most OO languages do.
>
> > If you want to see it in action, take a look at  
> > http://www.machete.ca/piccolo2d.js/andbrowse to the examples.css
>
> > There are still definitely some things missing so far, but I think this is  
> > a good start.
>
> >http://code.google.com/p/piccolo2d/source/detail?r=922
>
> > Added:
> >   /piccolo2d.js
> >   /piccolo2d.js/branches
> >   /piccolo2d.js/tags
> >   /piccolo2d.js/trunk
> >   /piccolo2d.js/trunk/examples
> >   /piccolo2d.js/trunk/examples/activities.html
> >   /piccolo2d.js/trunk/examples/calendar.html
> >   /piccolo2d.js/trunk/examples/events.html
> >   /piccolo2d.js/trunk/examples/examples.css
> >   /piccolo2d.js/trunk/examples/hierarchy.html
> >   /piccolo2d.js/trunk/examples/sticky-nodes.html
> >   /piccolo2d.js/trunk/extends.js
> >   /piccolo2d.js/trunk/lib
> >   /piccolo2d.js/trunk/lib/javascript-1.6.js
> >   /piccolo2d.js/trunk/lib/jquery-1.3.2.min.js
> >   /piccolo2d.js/trunk/lib/qunit.css
> >   /piccolo2d.js/trunk/lib/qunit.js
> >   /piccolo2d.js/trunk/license-piccolo.txt
> >   /piccolo2d.js/trunk/piccolo2d.js
> >   /piccolo2d.js/trunk/test.html
>
> > =======================================
> > --- /dev/null
> > +++ /piccolo2d.js/trunk/examples/activities.html        Mon Jan  4 10:15:57 
> > 2010
> > @@ -0,0 +1,97 @@
> > +<!--
> > +Copyright (c) 2008-2009, Piccolo2D project,http://piccolo2d.org
> > +Copyright (c) 1998-2008, University of Maryland
> > +All rights reserved.
> > +
> > +Redistribution and use in source and binary forms, with or without  
> > modification, are permitted provided
> > +that the following conditions are met:
> > +
> > +Redistributions of source code must retain the above copyright notice,  
> > this list of conditions
> > +and the following disclaimer.
> > +
> > +Redistributions in binary form must reproduce the above copyright notice,  
> > this list of conditions
> > +and the following disclaimer in the documentation and/or other materials  
> > provided with the
> > +distribution.
> > +
> > +None of the name of the University of Maryland, the name of the Piccolo2D  
> > project, or the names of its
> > +contributors may be used to endorse or promote products derived from this  
> > software without specific
> > +prior written permission.
> > +
> > +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS  
> > IS" AND ANY EXPRESS OR IMPLIED
> > +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  
> > MERCHANTABILITY AND FITNESS FOR A
> > +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER  
> > OR CONTRIBUTORS BE LIABLE FOR
> > +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL  
> > DAMAGES (INCLUDING, BUT NOT
> > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  
> > DATA, OR PROFITS; OR BUSINESS
> > +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN  
> > CONTRACT, STRICT LIABILITY, OR
> > +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
> >  
> > OF THIS SOFTWARE, EVEN IF
> > +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > +-->
> > +<html>
> > +  <head>
> > +    <title>Activities Example - Piccolo2d.js</title>
> > +    <link rel="stylesheet" href="examples.css" />
> > +  </head>
> > +  <body>
> > +  <canvas id="canvas" width="400" height="400">
> > +    <p>No Canvas Support in this browser.</p>
> > +  </canvas>
> > +  <script type="text/javascript" src="../lib/javascript-1.6.js"></script>
> > +  <script type="text/javascript" src="../lib/jquery-1.3.2.min.js"></script>
> > +  <script type="text/javascript" src="../extends.js"></script>
> > +  <script type="text/javascript" src="../piccolo2d.js"></script>
> > +  <script type="text/javascript">
> > +    // To deal with the case where firebug's console is not available'
> > +    if (typeof console == "undefined")
> > +      console = {log: function() {}};
> > +
> > +    // Example usage
> > +    var pCanvas = new PCanvas(document.getElementById('canvas'));
> > +
> > +    with ({
> > +      camera: pCanvas.camera,
> > +      layer : pCanvas.camera.layers[0],
> > +      scheduler: pCanvas.camera.getRoot().scheduler
> > +    }) {
> > +      var squareContainer = new PNode({
> > +        fillStyle: "rgb(200, 200, 200)",
> > +        bounds: new PBounds(0, 0, 400, 400)
> > +      })
> > +
> > +      for (var i=0; i<100; i++) {
> > +        var randomColor = "rgb("+(Math.round(Math.random()*254)) + ","  
> > +(Math.round(Math.random()*254)) + "," +(Math.round(Math.random()*254))  
> > +")";
> > +        squareContainer.addChild(new PNode({
> > +          fillStyle: randomColor,
> > +          bounds: new PBounds(0, 0, 10, 10)
> > +        }));
> > +      }
> > +      layer.addChild(squareContainer);
> > +
> > +      var step = 0;
> > +      scheduler.schedule(new PActivity({
> > +        init: function() {
> > +          this.lastCalled = 0;
> > +        },
> > +
> > +        step: function() {
> > +          if (scheduler.globalTime - this.lastCalled > 1500) {
> > +            for (var i=0; i<squareContainer.children.length; i++) {
> > +              var x = Math.round(Math.random()* 380) + 10;
> > +              var y = Math.round(Math.random()* 380) + 10;
> > +              squareContainer.children[i].animateToTransform(new  
> > PTransform().translate(x, y), 1000);
> > +            }
> > +
> > +            this.lastCalled = scheduler.globalTime;
> > +          }
> > +
> > +          return true;
> > +        }
> > +      }));
> > +    }
> > +  </script>
> > +  <h1>Activity Example</h1>
> > +  <p>This example contains:</p>
> > +  <ul>
> > +    <li>100 Rectangles being scheduled every 1.5 seconds for 1 second.</li>
> > +  </ul>
> > +</body>
> > +</html>
> > =======================================
> > --- /dev/null
> > +++ /piccolo2d.js/trunk/examples/calendar.html  Mon Jan  4 10:15:57 2010
> > @@ -0,0 +1,183 @@
> > +<!--
> > +Copyright (c) 2008-2009, Piccolo2D project,http://piccolo2d.org
> > +Copyright (c) 1998-2008, University of Maryland
> > +All rights reserved.
> > +
> > +Redistribution and use in source and binary forms, with or without  
> > modification, are permitted provided
> > +that the following conditions are met:
> > +
> > +Redistributions of source code must retain the above copyright notice,  
> > this list of conditions
> > +and the following disclaimer.
> > +
> > +Redistributions in binary form must reproduce the above copyright notice,  
> > this list of conditions
> > +and the following disclaimer in the documentation and/or other materials  
> > provided with the
> > +distribution.
> > +
> > +None of the name of the University of Maryland, the name of the Piccolo2D  
> > project, or the names of its
> > +contributors may be used to endorse or promote products derived from this  
> > software without specific
> > +prior written permission.
> > +
> > +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS  
> > IS" AND ANY EXPRESS OR IMPLIED
> > +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  
> > MERCHANTABILITY AND FITNESS FOR A
> > +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER  
> > OR CONTRIBUTORS BE LIABLE FOR
> > +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL  
> > DAMAGES (INCLUDING, BUT NOT
> > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  
> > DATA, OR PROFITS; OR BUSINESS
> > +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN  
> > CONTRACT, STRICT LIABILITY, OR
> > +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
> >  
> > OF THIS SOFTWARE, EVEN IF
> > +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> > +--><html>
> > +    <head>
> > +        <title>Calendar Example - Piccolo2d.js</title>
> > +        <link rel="stylesheet" href="examples.css" />
> > +    </head>
> > +    <body>
> > +    <canvas id="canvas" width="800" height="600">
> > +        <p>No Canvas Support in this browser.</p>
> > +    </canvas>
> > +
> > +    <script type="text/javascript" src="../lib/javascript-1.6.js"></script>
> > +    <script type="text/javascript" src="../extends.js"></script>
> > +    <script type="text/javascript"  
> > src="../lib/jquery-1.3.2.min.js"></script>
> > +    <script type="text/javascript" src="../piccolo2d.js"></script>
> > +    <script type="text/javascript">
> > +        // To deal with the case where firebug's console is not available'
> > +        if (typeof console === "undefined") {
> > +            console = {log: function() {}};
> > +        }
> > +
> > +        var pCanvas = new PCanvas('canvas');
> > +
> > +        with ({
> > +            camera: pCanvas.camera,
> > +            layer : pCanvas.camera.layers[0]
> > +        }) {
> > +            var monthWidth = 600;
> > +            var columnWidth = 600/7;
> > +
> > +          
>
> ...
>
> read more »
-- 
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to