[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst
From: |
Matti Katila |
Subject: |
[ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst |
Date: |
Sun, 26 Oct 2003 14:07:57 -0500 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Matti Katila <address@hidden> 03/10/26 14:07:56
Modified files:
doc/pegboard/animation_api--mudyc: peg.rst
Log message:
finally..
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/pegboard/animation_api--mudyc/peg.rst.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: libvob/doc/pegboard/animation_api--mudyc/peg.rst
diff -u libvob/doc/pegboard/animation_api--mudyc/peg.rst:1.17
libvob/doc/pegboard/animation_api--mudyc/peg.rst:1.18
--- libvob/doc/pegboard/animation_api--mudyc/peg.rst:1.17 Sun Oct 26
10:40:54 2003
+++ libvob/doc/pegboard/animation_api--mudyc/peg.rst Sun Oct 26 14:07:55 2003
@@ -5,8 +5,8 @@
:Authors: mudyc
:Date-Created: 2003-09-27
-:Last-Modified: $Date: 2003/10/26 15:40:54 $
-:Revision: $Revision: 1.17 $
+:Last-Modified: $Date: 2003/10/26 19:07:55 $
+:Revision: $Revision: 1.18 $
:Status: Current
:Stakeholders: mudyc, tjl, benja
:Scope: Minor
@@ -245,47 +245,55 @@
* 50, 1,1, 100,100)
* self.windowAnimation.rerender()
* </li><li>
- * Example: Quite a difficult example where we start to drag
- * red box around the scene that may end to be yellow one.
- * Point of the example is to use both rerendering of one
- * scene and switching to scene.
- *
+ * Example: Quite a difficult example where we start to drag
+ * red box around the scene that may end to be yellow one.
+ * Point of the example is to use both rerendering of one
+ * scene and switching of scene.
+ * <p>
+ * The main problem in example is that when handling mouse event you
+ * don't know what is it in the current window: a yellow or red
+ * box. We try to guess *the position of the moon* from previous
+ * event if we even have a one.
+ *
* <pre>
* class Scene:
* """ Example scene to drag the red or yellow box around.
- * In left the box is red but in right it is yellow.
- * """
- * def __init__(self, windowAnimation):
- * self.windowAnimation = windowAnimation
- * self.half = 300
+ * In left the box is red but in right it is yellow.
+ * """
+ * def __init__(self, windowAnimation):
+ * self.windowAnimation = windowAnimation
+ * self.half = 300
* self.ev = None
- * def scene(self, vs):
- * # this is an event grabbing example.
- * pass
- * def mouse(self, ev):
- * if self.ev = None: self.ev = ev
+ * def scene(self, vs):
+ * # this is an event grabbing example, really.
+ * self.evenrGrabberDraw(vs)
+ * def eventGrabberDraw(self, vs):
+ * if self.ev != None:
+ * cs = vs.orthoBoxCS(0, "Box", 0,
+ * self.ev.getX(),self.ev.getY(), 1,1, 100,100)
+ * else:
+ * cs = vs.orthoBoxCS(0, "Box", 0,10,10, 1,1, 100,100)
+ * if self.ev.getX() < self.half:
+ * vs.put(vob.vobs.RectBgVob(java.awt.Color.red), cs)
+ * else:
+ * vs.put(vob.vobs.RectBgVob(java.awt.Color.yellow), cs)
+ * def mouse(self, ev):
+ * if self.ev == None: self.ev = ev
* vs = self.windowAnimation.getCurrentVS()
- * if vs.matcher.getCS(0, "Box") < 1:
- * cs = vs.orthoBoxCS(0, "Box", 0,ev.getX(),ev.getY(),
- * 1,1, 100,100)
- * if ev.getX() < self.half:
- * vs.put(vob.vobs.RectBgVob(java.awt.Color.red), cs)
- * else:
- * vs.put(vob.vobs.RectBgVob(java.awt.Color.yellow), cs)
* cs = vs.matcher.getCS(0, "Box")
* if self.ev.getX() < self.half and ev.getX() < self.half:
- * vs.coords.setOrthoBoxParams(cs, 0,ev.getX(),ev.getY(),
+ * vs.coords.setOrthoBoxParams(cs, 0,ev.getX(),ev.getY(),
* 1,1, 100,100)
* if not self.windowAnimation.hasSceneReplacementPending():
- * self.windowAnimation.rerender()
- * elif self.ev.getX() > self.half and ev.getX() > self.half:
- * vs.coords.setOrthoBoxParams(cs, 0,self.right,
- * 50, 1,1, 100,100)
+ * self.windowAnimation.rerender()
+ * elif self.ev.getX() > self.half and ev.getX() > self.half:
+ * vs.coords.setOrthoBoxParams(cs, 0,ev.getX(),ev.getY(),
+ * 1,1, 100,100)
* if not self.windowAnimation.hasSceneReplacementPending():
- * self.windowAnimation.rerender()
+ * self.windowAnimation.rerender()
* else:
* self.windowAnimation.switchVS()
- * self.ev = ev
+ * self.ev = ev
* </li> </ol>
*/
public interface WindowAnimation {
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, (continued)
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/24
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/24
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/24
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/24
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/24
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/24
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/25
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/25
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/26
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst,
Matti Katila <=
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/26
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/26
- [ff-cvs] libvob/doc/pegboard/animation_api--mudyc peg.rst, Matti Katila, 2003/10/26