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 |
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 |
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 |
|
|
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) |
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 |
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]) |
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() |