/[fenfire]/fenfire/org/fenfire/demo/buoyoing.py
ViewVC logotype

Diff of /fenfire/org/fenfire/demo/buoyoing.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by mudyc, Fri May 2 00:22:40 2003 UTC revision 1.37 by mudyc, Sat May 3 00:56:59 2003 UTC
# Line 24  Line 24 
24    
25  dbg = 0  dbg = 0
26    
27    def pa(*s):
28        print 'fenfire.demo.buoyoing::',s
29    
30  import sys  import sys
31  import jarray  import jarray
32  import java  import java
# Line 33  del(sys.modules["org"]) Line 36  del(sys.modules["org"])
36  print "LOADING BUOYOING"  print "LOADING BUOYOING"
37  if dbg:  if dbg:
38      for (k,v) in sys.modules.items():      for (k,v) in sys.modules.items():
39          print k,"\t",v          pa( k,"\t",v)
40    
41  from org import fenfire as ff  from org import fenfire as ff
42  from org.fenfire.swamp import Nodes  from org.fenfire.swamp import Nodes
# Line 48  from org.fenfire.vocab import PP Line 51  from org.fenfire.vocab import PP
51    
52  import vob  import vob
53    
54    
55  ff.util.PageSpanPaper.paperMill = vob.gl.PaperMill.getInstance()  ff.util.PageSpanPaper.paperMill = vob.gl.PaperMill.getInstance()
56  ff.util.PageSpanPaper.paperMillWindow = vob.putil.demowindow.w  ff.util.PageSpanPaper.paperMillWindow = vob.putil.demowindow.w
57    
# Line 80  vs.put(background((.8, .4, .9))) Line 84  vs.put(background((.8, .4, .9)))
84  w.renderStill(vs, 0)  w.renderStill(vs, 0)
85    
86  if 1:  if 1:
     #global linkid1  
87      paperA = ppAct.newPaper()      paperA = ppAct.newPaper()
88      note1 = Nodes.get(ppAct.newNote(paperA, 0,0, 'This is a test!'))      noteA1 = Nodes.get(ppAct.newNote(paperA, -30,-30, 'This is a test!'))
89      note1c = Nodes.get(ppAct.newNote(paperA, -30,-30, 'This is a test2!'))      noteA2 = Nodes.get(ppAct.newNote(paperA, -60,-70, 'This is a test2!'))
90      note1b = Nodes.get(ppAct.newNote(paperA, 100, 100, ''))      noteA3 = Nodes.get(ppAct.newNote(paperA, 100, 100, ''))
91    
92      span = sc.getCurrent().getPage(0).subArea(100, 100, 300, 200);      span = sc.getCurrent().getPage(0).subArea(100, 100, 300, 200);
93      fen.txt.set(note1b, enfMaker.makeEnfilade(span))      fen.txt.set(noteA3, enfMaker.makeEnfilade(span))
     #linkid1 = addTrans(span, paper)  
94    
95      paperB = ppAct.newPaper()      paperB = ppAct.newPaper()
96      note2 = Nodes.get(ppAct.newNote(paperB, 1000,500, 'This is an another test!'))      noteB1 = Nodes.get(ppAct.newNote(paperB, 1000,500, 'This is an another test!'))
97    
98      ppAct.assocNotes(note1, 1, note2)      ppAct.assocNotes(noteB1, 1, noteA1)
99    
100      canvas = rst.newRSTCanvas()      canvas = rst.newRSTCanvas()
101      parag = rst.newParagraph(canvas, 10,10)      parag = rst.newParagraph(canvas, 10,10)
102      senten = rst.newSentence(parag,0)      senten = rst.newSentence(parag,0)
103      note = ff.swamp.Nodes.N()      note = ff.swamp.Nodes.N()
104      text = (ff.util.AlphContent(fen)).setText('This is rst canvas test', note, 1)      ff.util.AlphContent(fen).setText(note, 'This is rst canvas test', 1)
105      rst.insertNode(senten, note, 0)      rst.insertNode(senten, note, 0)
106      rst.generateBasicSpatialCoords(canvas)      rst.generateBasicSpatialCoords(canvas)
107    
108      # something is really broken because it hangs on loop and      ppAct.assocNotes(noteA2, 1, Nodes.toString(note))
109      # eats all available cpu if do uncomment this line.      ppAct.assocNotes(noteB1, -1, noteA1)
110      # rstactions and ppactions do produces same basic structure      
     # so it isn't understandable. Different with this too is in  
     # text structure. rstactions can be made to allow sentences etc.  
     #ppAct.assocNotes(note1c, 1, ff.swamp.Nodes.toString(note))  
     ppAct.assocNotes(note1, -1, note2)  
     print 'Association done!'  
111    
112  textstyle = vob.GraphicsAPI.getInstance().getTextStyle("sans", 0, 24)  textstyle = vob.GraphicsAPI.getInstance().getTextStyle("sans", 0, 24)
113  textnodeview = ff.view.TextNodeView(fen.txtfunc, textstyle, 1)  textnodeview = ff.view.TextNodeView(fen.txtfunc, textstyle, 1)
# Line 134  ff.view.buoy.NodeType2DFull.effigy = 0 Line 131  ff.view.buoy.NodeType2DFull.effigy = 0
131  plane = Nodes.get(paperA)  plane = Nodes.get(paperA)
132    
133  mainNode = ff.view.buoy.MainNode2D(plane, irregu)  mainNode = ff.view.buoy.MainNode2D(plane, irregu)
134  # mainNode = ff.view.buoy.MainNode2D(plane, paperview)  #mainNode = ff.view.buoy.MainNode2D(plane, paperview)
135    
136  #connector = ff.view.buoy.PPConnector(fen, paperviewonly)  #connector = ff.view.buoy.PPConnector(fen, paperviewonly)
137  #connector.hackForTesting = 1  #connector.hackForTesting = 1
# Line 158  for k in em.keySet(): Line 155  for k in em.keySet():
155      print "\t",k,"\t",em[k]      print "\t",k,"\t",em[k]
156  print "DUMPED!"  print "DUMPED!"
157    
   
158  class Scene(vob.buoy.buoymanager.RealBuoyManager):  class Scene(vob.buoy.buoymanager.RealBuoyManager):
159      def __init__(self):      def __init__(self):
160          vob.buoy.buoymanager.RealBuoyManager.__init__(self, mainNode, [ppconnector, tconnector])          vob.buoy.buoymanager.RealBuoyManager.__init__(self, mainNode, [ppconnector, tconnector])
# Line 220  def globalkey(k): Line 216  def globalkey(k):
216          saveanim.saveframe("/tmp/buoyframeWithHand.png", w)          saveanim.saveframe("/tmp/buoyframeWithHand.png", w)
217                    
218      if k == "S":      if k == "S":
         print 'FOOO'  
219          screenshots()          screenshots()
220      if k == "Ctrl-PrinT":      if k == "Ctrl-PrinT":
221          screenshots()          screenshots()

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26