106 |
else |
else |
107 |
sc.map.put(conn, cs2, focusCs); |
sc.map.put(conn, cs2, focusCs); |
108 |
|
|
109 |
if (depth > 1) { |
if (depth > 1) |
110 |
RDFNode newFocus = (RDFNode)current.first; |
renderDepth(sc, into, c, focus, current, nodes, dir, |
111 |
if (newFocus != null && newFocus instanceof Resource) { |
cura, rota, r, cs2, depth, midx, midy); |
112 |
|
|
|
Vector removal = new Vector(); |
|
|
Pair focusPair = new Pair(focus, (Property)current.second); |
|
|
removal.add(focusPair); |
|
|
|
|
|
/** This shows as much nodes as possible. Shows the both directions |
|
|
* also in branches. Removes the focused node+prop pairs from branch. |
|
|
* Problem is that moving don't work properly. Nodes change from the |
|
|
* one side to another and it seems to be confusing. |
|
|
*/ |
|
|
Collection subNodes = getNodes(c, (Resource)newFocus, 0, removal); |
|
|
|
|
|
/** This won't remove any nodes. */ |
|
|
//Collection subNodes = getNodes(c, (Resource)newFocus, 0); |
|
|
|
|
|
/** This don't show the links of opposite direction at all in branches. |
|
|
* This is the one, which would really work, if we would have rotable |
|
|
* stubs to shown the hidden connections |
|
|
*/ |
|
|
//Collection subNodes = getNodes(c, (Resource)newFocus, dir); |
|
|
|
|
|
double subRota = getRotationAngle(c, (Resource)newFocus, subNodes, |
|
|
rota, depth-1); |
|
|
renderSomewardConnections(sc, into, c, (Resource)newFocus, subNodes, |
|
|
subNodes.size()/2, dir, cura, subRota, |
|
|
r+gapx+sizex, cs2, depth-1, midx, midy); |
|
|
} |
|
|
} |
|
|
|
|
113 |
cura+=rota; |
cura+=rota; |
114 |
before--; |
before--; |
115 |
} |
} |
116 |
} |
} |
117 |
|
|
118 |
|
protected void renderDepth(VobScene sc, int into, Cursor c, Resource focus, |
119 |
|
Pair current, Collection nodes, int dir, double cura, |
120 |
|
double rota, float r, int focusCs, int depth, int midx, |
121 |
|
int midy) { |
122 |
|
RDFNode newFocus = (RDFNode)current.first; |
123 |
|
if (newFocus != null && newFocus instanceof Resource) { |
124 |
|
|
125 |
|
Vector removal = new Vector(); |
126 |
|
Pair focusPair = new Pair(focus, (Property)current.second); |
127 |
|
removal.add(focusPair); |
128 |
|
|
129 |
|
/** This shows as much nodes as possible. Shows the both directions |
130 |
|
* also in branches. Removes the focused node+prop pairs from branch. |
131 |
|
* Problem is that moving don't work properly. Nodes change from the |
132 |
|
* one side to another and it seems to be confusing. |
133 |
|
*/ |
134 |
|
Collection subNodes = getNodes(c, (Resource)newFocus, 0, removal); |
135 |
|
|
136 |
|
/** This won't remove any nodes. */ |
137 |
|
//Collection subNodes = getNodes(c, (Resource)newFocus, 0); |
138 |
|
|
139 |
|
/** This don't show the links of opposite direction at all in branches. |
140 |
|
* This is the one, which would really work, if we would have rotable |
141 |
|
* stubs to shown the hidden connections |
142 |
|
*/ |
143 |
|
//Collection subNodes = getNodes(c, (Resource)newFocus, dir); |
144 |
|
|
145 |
|
double subRota = getRotationAngle(c, (Resource)newFocus, subNodes, |
146 |
|
rota, depth-1); |
147 |
|
renderSomewardConnections(sc, into, c, (Resource)newFocus, subNodes, |
148 |
|
subNodes.size()/2, dir, cura, subRota, |
149 |
|
r+gapx+sizex, focusCs, depth-1, midx, midy); |
150 |
|
} |
151 |
|
} |
152 |
|
|
153 |
public void render(VobScene sc, int into, Cursor c) { |
public void render(VobScene sc, int into, Cursor c) { |
154 |
if (dbg) p("*******************************************************************"); |
if (dbg) p("*******************************************************************"); |
155 |
int midx = sc.size.width/2, midy = sc.size.height/2; |
int midx = sc.size.width/2, midy = sc.size.height/2; |
159 |
sc.coords.activate(cs); |
sc.coords.activate(cs); |
160 |
nodeView.render(sc, cs, spec); |
nodeView.render(sc, cs, spec); |
161 |
|
|
|
/** Radius = gapx * sizex */ |
|
|
int r = gapx + sizex; |
|
|
|
|
162 |
Collection posNodes = getNodes(c, 1); |
Collection posNodes = getNodes(c, 1); |
163 |
Collection negNodes = getNodes(c, -1); |
Collection negNodes = getNodes(c, -1); |
164 |
double posRota = getRotationAngle(c, posNodes, Math.PI, depth); |
double posRota = getRotationAngle(c, posNodes, Math.PI, depth); |
173 |
/** Poswards connections */ |
/** Poswards connections */ |
174 |
renderSomewardConnections(sc, into, c, c.focus, posNodes, |
renderSomewardConnections(sc, into, c, c.focus, posNodes, |
175 |
c.getRotationIndex(1), 1, 0, |
c.getRotationIndex(1), 1, 0, |
176 |
rota, r, cs, depth, midx, midy); |
rota, radius, cs, depth, midx, midy); |
177 |
|
|
178 |
if (dbg) p("Render, negNodes: "+negNodes.size()+ |
if (dbg) p("Render, negNodes: "+negNodes.size()+ |
179 |
", negRota: "+negRota+", rota: "+rota); |
", negRota: "+negRota+", rota: "+rota); |
180 |
/** Negward connections */ |
/** Negward connections */ |
181 |
renderSomewardConnections(sc, into, c, c.focus, negNodes, |
renderSomewardConnections(sc, into, c, c.focus, negNodes, |
182 |
c.getRotationIndex(-1), -1, Math.PI, |
c.getRotationIndex(-1), -1, Math.PI, |
183 |
rota, r, cs, depth, midx, midy); |
rota, radius, cs, depth, midx, midy); |
184 |
} |
} |
185 |
|
|
186 |
protected double getRotationAngle(Cursor c, Resource node, Collection nodes, |
protected double getRotationAngle(Cursor c, Resource node, Collection nodes, |