19 |
|
|
20 |
dbg = 0 |
dbg = 0 |
21 |
|
|
|
|
|
|
|
|
22 |
paper = vob.gl.SpecialPapers.selectionPaper(None); |
paper = vob.gl.SpecialPapers.selectionPaper(None); |
23 |
whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
24 |
|
|
25 |
|
|
|
|
|
|
|
|
26 |
class MindMapMainNode2D(ff.view.buoy.MainNode2D): |
class MindMapMainNode2D(ff.view.buoy.MainNode2D): |
27 |
def __init__(self, plane, view2d, focus, controller): |
def __init__(self, plane, view2d, focus, controller): |
28 |
ff.view.buoy.MainNode2D.__init__(self, plane, view2d, controller); |
ff.view.buoy.MainNode2D.__init__(self, plane, view2d, controller); |
72 |
cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0,0, p.getWidth(), p.getHeight()) |
cs_background = vs.orthoCS(cs,'WHITE_GROUND',0, 0,0, p.getWidth(), p.getHeight()) |
73 |
vs.put(whiteground, cs_background) |
vs.put(whiteground, cs_background) |
74 |
|
|
75 |
cs = vs.orthoBoxCS(cs,'CONTENT',0, 0,0, 1,1, p.getWidth(), p.getHeight()) |
cs = vs.orthoBoxCS(cs,node,0, 0,0, 1,1, p.getWidth(), p.getHeight()) |
76 |
p.place(vs, cs) |
p.place(vs, cs) |
77 |
|
vs.coords.activate(cs) |
78 |
|
|
79 |
class MindNet: |
class MindNet: |
80 |
""" Keeps up nodes in hashmap of 'linked to' nodes in hashmap. |
""" Keeps up nodes in hashmap of 'linked to' nodes in hashmap. |
131 |
self.whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
self.whiteground = vob.gl.GLRen.createFixedPaperQuad(paper, 0, 0, 1, 1, 0, 10, 10, 10); |
132 |
|
|
133 |
def getSize(self, node, wh): |
def getSize(self, node, wh): |
134 |
s = 240 |
s = -1 # s = 240 |
135 |
wh[0], wh[1] = s, s |
wh[0], wh[1] = s, s |
136 |
|
|
137 |
|
|
157 |
paper2box = vs.invertCS(box2plane, "minMap_INv") |
paper2box = vs.invertCS(box2plane, "minMap_INv") |
158 |
paper2screen = vs.concatCS(box2screen, 'mindMap_CONCAT', |
paper2screen = vs.concatCS(box2screen, 'mindMap_CONCAT', |
159 |
paper2box) |
paper2box) |
|
|
|
160 |
|
|
161 |
# nodes which has been handled |
# nodes which has been handled |
162 |
self.nodes = java.util.HashMap() |
self.nodes = java.util.HashMap() |
248 |
if dbg: p('old node', pl) |
if dbg: p('old node', pl) |
249 |
|
|
250 |
# debugging.. |
# debugging.. |
251 |
if 1: |
if dbg: |
252 |
p('main node:',self.alphContent.getText(node)) |
p('main node:',self.alphContent.getText(node)) |
253 |
for n in links: |
for n in links: |
254 |
p(' ',self.alphContent.getText(n),self.nodes.get(n)) |
p(' ',self.alphContent.getText(n),self.nodes.get(n)) |
266 |
x,y = xy[0], xy[1] |
x,y = xy[0], xy[1] |
267 |
|
|
268 |
s = self.getNodeSize(deepnes) |
s = self.getNodeSize(deepnes) |
269 |
cs = vs.coords.orthoBox(into,0, x-s/2.0,y-s/2.0, 1,1, s,s) |
cs = vs.orthoBoxCS(into,'foo'+str(key),0, x-s/2.0,y-s/2.0, 1,1, s,s) |
270 |
if 1 or dbg: |
if dbg: |
271 |
p('come:',x0,y0, angle, dirAngle) |
p('come:',x0,y0, angle, dirAngle) |
272 |
p(cs, xy, angle, s) |
p(cs, xy, angle, s) |
273 |
return [cs, x, y, angle] |
return [cs, x, y, angle] |
287 |
cs_background = vs.orthoCS(cs,'background',0, 0,0, p.getWidth(), p.getHeight()) |
cs_background = vs.orthoCS(cs,'background',0, 0,0, p.getWidth(), p.getHeight()) |
288 |
vs.put(whiteground, cs_background) |
vs.put(whiteground, cs_background) |
289 |
|
|
290 |
cs = vs.orthoBoxCS(cs,'content',0, 0,0, 1,1, p.getWidth(), p.getHeight()) |
cs = vs.orthoBoxCS(cs, node,0, 0,0, 1,1, p.getWidth(), p.getHeight()) |
291 |
p.place(vs, cs) |
p.place(vs, cs) |
292 |
|
vs.coords.activate(cs) |
293 |
|
|
294 |
|
|
295 |
|
|