69 |
/** XXX gapy has currently no effect, should be used |
/** XXX gapy has currently no effect, should be used |
70 |
* to determine the minimum rotation angle. |
* to determine the minimum rotation angle. |
71 |
*/ |
*/ |
72 |
protected int sizex = 150, sizey = 20; |
protected int sizex = 166, sizey = 22; |
73 |
protected int gapx = 50, gapy = 30; |
protected int gapx = 50, gapy = 30; |
74 |
|
|
75 |
protected int radius = sizex + gapx; |
protected int radius = sizex + gapx; |
107 |
new NodeView.Nodespec((RDFNode)current.first, |
new NodeView.Nodespec((RDFNode)current.first, |
108 |
(Property)current.second, |
(Property)current.second, |
109 |
dir); |
dir); |
110 |
int x = midx+x(cura, r)-sizex/2; |
float scale = scale(depth); |
111 |
int y = midy+y(cura, r)-sizey/2; |
int sx = (int)(sizex*scale); |
112 |
int cs2 = sc.orthoBoxCS(into, spec, Math.abs(before), |
int sy = (int)(sizey*scale); |
113 |
x, y, 1, 1, sizex, sizey); |
int x = midx+x(cura, r)-sx/2; |
114 |
|
int y = midy+y(cura, r)-sy/2; |
115 |
|
int cs2 = sc.orthoBoxCS(into, current.first, Math.abs(before), |
116 |
|
x, y, scale, scale, sx, sy); |
117 |
|
((LoomVobMatcher)sc.matcher).link(focusCs, dir, cs2, |
118 |
|
current.second); |
119 |
|
|
120 |
if (depth == maxDepth) { |
if (depth == maxDepth) { |
121 |
Vob stub; |
Vob stub; |
176 |
int posPosition = curPosition.getRotationIndex(1); |
int posPosition = curPosition.getRotationIndex(1); |
177 |
int negPosition = curPosition.getRotationIndex(-1); |
int negPosition = curPosition.getRotationIndex(-1); |
178 |
|
|
179 |
|
float scale = scale(depth); |
180 |
if (dir > 0) { |
if (dir > 0) { |
181 |
renderSomewardConnections(sc, into, focusCs, c, focus, null, |
renderSomewardConnections(sc, into, focusCs, c, focus, null, |
182 |
posNodes, posPosition, 1, cura, newRota, |
posNodes, posPosition, 1, cura, newRota, |
183 |
r+gapx+sizex, midx, midy, depth); |
r+(int)(scale*(gapx+sizex)), midx, midy, depth); |
184 |
renderSomewardConnections(sc, into, focusCs, c, focus, oldFocus, |
renderSomewardConnections(sc, into, focusCs, c, focus, oldFocus, |
185 |
negNodes, negPosition, -1, Math.PI+cura, newRota, |
negNodes, negPosition, -1, Math.PI+cura, newRota, |
186 |
gapx+sizex, x, y, maxDepth); |
(int)(scale*(gapx+sizex)), x, y, maxDepth); |
187 |
} else { |
} else { |
188 |
renderSomewardConnections(sc, into, focusCs, c, focus, oldFocus, |
renderSomewardConnections(sc, into, focusCs, c, focus, oldFocus, |
189 |
posNodes, posPosition, 1, Math.PI+cura, newRota, |
posNodes, posPosition, 1, Math.PI+cura, newRota, |
190 |
gapx+sizex, x, y, maxDepth); |
(int)(scale*(gapx+sizex)), x, y, maxDepth); |
191 |
renderSomewardConnections(sc, into, focusCs, c, focus, null, |
renderSomewardConnections(sc, into, focusCs, c, focus, null, |
192 |
negNodes, negPosition, -1, cura, newRota, |
negNodes, negPosition, -1, cura, newRota, |
193 |
r+gapx+sizex, midx, midy, depth); |
r+(int)(scale*(gapx+sizex)), midx, midy, depth); |
194 |
} |
} |
195 |
} |
} |
196 |
} |
} |
199 |
if (dbg) p("*******************************************************************"); |
if (dbg) p("*******************************************************************"); |
200 |
int midx = sc.size.width/2, midy = sc.size.height/2; |
int midx = sc.size.width/2, midy = sc.size.height/2; |
201 |
NodeView.Nodespec spec = new NodeView.Nodespec(c.focus); |
NodeView.Nodespec spec = new NodeView.Nodespec(c.focus); |
202 |
int cs = sc.orthoBoxCS(into, spec, 0, midx-sizex/2, midy-sizey/2, |
int cs = sc.orthoBoxCS(into, c.focus, 0, midx-sizex/2, midy-sizey/2, |
203 |
1, 1, sizex, sizey); |
1, 1, sizex, sizey); |
204 |
|
((LoomVobMatcher)sc.matcher).setFocus(cs); |
205 |
sc.coords.activate(cs); |
sc.coords.activate(cs); |
206 |
nodeView.render(sc, cs, spec); |
nodeView.render(sc, cs, spec); |
207 |
|
|
304 |
protected int y(double angle, float radius) { |
protected int y(double angle, float radius) { |
305 |
return (int)(Math.sin(angle) * radius); |
return (int)(Math.sin(angle) * radius); |
306 |
} |
} |
307 |
|
|
308 |
|
protected float scale(int depth) { |
309 |
|
float scale = 1; |
310 |
|
for(int foo=0; foo<depth+2; foo++) |
311 |
|
scale = scale * .9f; |
312 |
|
return scale; |
313 |
|
} |
314 |
} |
} |