1 | package hozo.maptool;
|
---|
2 |
|
---|
3 |
|
---|
4 | import java.awt.Color;
|
---|
5 | import java.awt.Font;
|
---|
6 | import java.io.File;
|
---|
7 | import java.util.ArrayList;
|
---|
8 | import java.util.Enumeration;
|
---|
9 | import java.util.List;
|
---|
10 | import java.util.Vector;
|
---|
11 |
|
---|
12 | import javax.swing.JOptionPane;
|
---|
13 |
|
---|
14 | import hozo.sparql.gui.SparqlBuilderPanel;
|
---|
15 |
|
---|
16 | import org.biohackathon.SPARQLBuilder.OWL.ClassLink;
|
---|
17 | import org.biohackathon.SPARQLBuilder.OWL.Direction;
|
---|
18 | import org.biohackathon.SPARQLBuilder.OWL.Path;
|
---|
19 |
|
---|
20 | /***縲2008/10/18縲#kozaki
|
---|
21 | 縲MAP逕滓�縺ョ縺溘a縺ォ�梧ウ暮繧ОWL縺ョAPI縺九i�後�繝��逕ィ縺ョ繝��繧ソ繧剃ス懈�縺吶k縺溘a縺ョ
|
---|
22 | 縲繝。繧ス繝�ラ鬘槭r縺薙�繧ッ繝ゥ繧ケ縺ォ縺セ縺ィ繧√k�� |
---|
23 |
|
---|
24 | ***/
|
---|
25 | public class MapFactory implements Runnable{
|
---|
26 |
|
---|
27 | ExtendBP exbp;
|
---|
28 | public ExtendFrame exbpframe;
|
---|
29 | Vector focal_points;//譛蛻昴↓驕ク謚槭@縺櫻ode(縺ェ縺ゥ)繧剃ソ晄戟縺吶k
|
---|
30 | boolean isSubLung;
|
---|
31 | static boolean isGrayView=false;
|
---|
32 | Vector<String> checked_nodes;
|
---|
33 | boolean search_shortest=true;//繧オ繝シ繝√ヱ繧ケ縺ァ譛遏ュ繝代せ繧呈、懃エ「縺吶k
|
---|
34 | int serch_depth = 10;//繧オ繝シ繝√ヱ繧ケ縺ァ譛遏ュ繝代せ繧呈、懃エ「縺吶k豺ア縺包シ域怙遏ュ繝代せ讀懃エ「繧偵@縺ェ縺�→縺阪�蠢�★菴ソ縺�シ� |
---|
35 | Vector<ExbpNodeTemp> temp_nodes;
|
---|
36 |
|
---|
37 | SparqlBuilderPanel spBuilder;
|
---|
38 |
|
---|
39 | public static void main (String[] args) {
|
---|
40 | MapFactory map = new MapFactory();
|
---|
41 | //map.loadPathList(map.getDummyPathList());
|
---|
42 | }
|
---|
43 |
|
---|
44 | public List<Path> getDummyPathList(){
|
---|
45 | ArrayList pathlist = new ArrayList();
|
---|
46 | // ArrayList class_link_list = new ArrayList<ClassLink>() {{
|
---|
47 | // add(new ClassLink("propertyURI", "linkedClassURI2", Direction.forward));
|
---|
48 | // add(new ClassLink("propertyURI2", "linkedClassURI3", Direction.forward));
|
---|
49 | // add(new ClassLink("propertyURI3", "linkedClassURI4", Direction.forward));
|
---|
50 | // }};
|
---|
51 | // Path path = new Path("StartClass1", class_link_list);
|
---|
52 | // pathlist.add(path);
|
---|
53 | //
|
---|
54 | return pathlist;
|
---|
55 | }
|
---|
56 |
|
---|
57 | public void setSPARQLbuilder(SparqlBuilderPanel builder){
|
---|
58 | this.spBuilder = builder;
|
---|
59 | }
|
---|
60 |
|
---|
61 | // void setSPARQLquery(Path path){
|
---|
62 | // this.spBuilder;
|
---|
63 | // }
|
---|
64 |
|
---|
65 | public MapFactory() {
|
---|
66 | exbpframe = new ExtendFrame(this);
|
---|
67 | exbp = exbpframe.getExtendBP();
|
---|
68 | focal_points = new Vector<Object>();
|
---|
69 | temp_nodes = new Vector<ExbpNodeTemp>();
|
---|
70 |
|
---|
71 | // focal_points.add("TEST");
|
---|
72 | // focal_points.add("TEST2");
|
---|
73 |
|
---|
74 | // isSubLung=hze.isSubLang;
|
---|
75 | // isGrayView=hze.isGrayView;//#kozaki 2009/07/28
|
---|
76 | // exbp.setHZEditor(hze);
|
---|
77 | // exbpframe.select_dialog = new EtendBPSelectDialog(exbp,exbpframe);
|
---|
78 | exbpframe.setVisible(true);
|
---|
79 | exbpframe.RefreshExbp();
|
---|
80 |
|
---|
81 | // if(focal_points.size()==1){
|
---|
82 | // exbp.cmd_dialog.setCommandOptions(exbp.exbp_node_center);
|
---|
83 | // }
|
---|
84 | //
|
---|
85 | // treeSelectDialog = new TreeSelectDialog(true);
|
---|
86 | // treeSelectDialog.setHZEditor(this.hzEditor);
|
---|
87 | // treeSelectDialog.setSubLang(this.isSubLung);
|
---|
88 | // treeSelectDialog.setSize(450, 600);
|
---|
89 | //
|
---|
90 | }
|
---|
91 |
|
---|
92 | public void loadPathList(Path[] pathlist){
|
---|
93 | if(pathlist.length==0){
|
---|
94 | JOptionPane.showMessageDialog(null, "NO PATH!!");
|
---|
95 | return;
|
---|
96 | }
|
---|
97 | Path path = pathlist[0];
|
---|
98 |
|
---|
99 | this.exbp.exbp_node_center = new ExbpNode(getTempLabel(path.getStartClass()));
|
---|
100 |
|
---|
101 | for(int i = 0; i<pathlist.length; i++){
|
---|
102 | addPath(pathlist[i]);
|
---|
103 | }
|
---|
104 | this.exbpframe.RefreshExbp();
|
---|
105 | // this.exbp.exbp_node_center = exbpnode;
|
---|
106 | // exbpnode= new ExbpNode("Center");;
|
---|
107 | // exbpnode.setChildrenColor(Color.red);
|
---|
108 | // exbpnode.key="prop1";
|
---|
109 | // this.exbp_node_center.addChild(exbpnode);
|
---|
110 | // this.exbp_node_center.addChild(new ExbpNode("TEST2"));
|
---|
111 | // this.exbp_node_center.addChild(new ExbpNode("TEST3"));
|
---|
112 | // this.exbp_node_center.addChild(new ExbpNode("TEST4"));
|
---|
113 |
|
---|
114 |
|
---|
115 | }
|
---|
116 |
|
---|
117 |
|
---|
118 |
|
---|
119 | void addPath(Path path){
|
---|
120 | System.out.println("addPath"+path.getStartClass()+"--->"+path.getClassLinks().size());
|
---|
121 | String target_class = path.getStartClass();
|
---|
122 | // ExbpNode node = this.exbp.findExbpNode(target_class);
|
---|
123 | ExbpNode node = this.exbp.exbp_node_center;
|
---|
124 |
|
---|
125 |
|
---|
126 | List<ClassLink> links = path.getClassLinks();
|
---|
127 | for(ClassLink link : links){
|
---|
128 | String next_class = link.getLinkedClassURI();
|
---|
129 | System.out.println("==>"+next_class);
|
---|
130 | /*
|
---|
131 | String next_class_lbl ="";
|
---|
132 | int index = next_class.lastIndexOf("/");
|
---|
133 | if(index>0 && index<next_class.length()){
|
---|
134 | next_class_lbl = next_class.substring(index+1);
|
---|
135 | }
|
---|
136 | else{
|
---|
137 | next_class_lbl = next_class;
|
---|
138 | }
|
---|
139 |
|
---|
140 | int index2 = next_class_lbl.lastIndexOf("#");
|
---|
141 | if(index2>0 && index2<next_class_lbl.length()){
|
---|
142 | next_class_lbl = next_class_lbl.substring(index2+1);
|
---|
143 | }
|
---|
144 |
|
---|
145 | */
|
---|
146 | ExbpNode next_node = new ExbpNode(getTempLabel(next_class));
|
---|
147 | next_node.setOrgNode(path);
|
---|
148 |
|
---|
149 | node.addChild(next_node);
|
---|
150 | node = next_node;
|
---|
151 | String prop = link.getPropertyURI();
|
---|
152 |
|
---|
153 | if(link.getDirection().equals(Direction.reverse)){
|
---|
154 | prop += "[<=]";
|
---|
155 | }
|
---|
156 | else if(link.getDirection().equals(Direction.both)){
|
---|
157 | prop += "[<=>]";
|
---|
158 | }
|
---|
159 | next_node.key = prop;
|
---|
160 | }
|
---|
161 |
|
---|
162 |
|
---|
163 | }
|
---|
164 |
|
---|
165 |
|
---|
166 | String getTempLabel(String next_class){
|
---|
167 | String next_class_lbl ="";
|
---|
168 | int index = next_class.lastIndexOf("/");
|
---|
169 | if(index>0 && index<next_class.length()){
|
---|
170 | next_class_lbl = next_class.substring(index+1);
|
---|
171 | }
|
---|
172 | else{
|
---|
173 | next_class_lbl = next_class;
|
---|
174 | }
|
---|
175 |
|
---|
176 | int index2 = next_class_lbl.lastIndexOf("#");
|
---|
177 | if(index2>0 && index2<next_class_lbl.length()){
|
---|
178 | next_class_lbl = next_class_lbl.substring(index2+1);
|
---|
179 | }
|
---|
180 |
|
---|
181 | return next_class_lbl;
|
---|
182 | }
|
---|
183 |
|
---|
184 | //蜈�→縺ェ繧畿ditor遲峨〒MapTool繧堤ョ。逅�@縺ヲ縺�kVector繧定ソ斐☆縲食ozo莉・螟悶〒縺ッ繧ェ繝シ繝舌�繝ゥ繧、繝峨☆繧九� |
---|
185 | Vector getMapVec(){
|
---|
186 | return null;
|
---|
187 | }
|
---|
188 |
|
---|
189 | //蜈�→縺ェ繧九が繝ウ繝医Ο繧ク繝シ縺ョ繝輔ぃ繧、繝ォ繧定ソ斐☆縲食ozo莉・螟悶〒縺ッ繧ェ繝シ繝舌�繝ゥ繧、繝峨☆繧九� |
---|
190 | File getFile(){
|
---|
191 | return null;
|
---|
192 | }
|
---|
193 |
|
---|
194 | //縺吶∋縺ヲ縺ョ繝ュ繝シ繝ォ縺ョ荳隕ァ繧定ソ斐☆
|
---|
195 | Vector getRoleList(){
|
---|
196 | Vector roles = new Vector();
|
---|
197 | /* Enumeration en = this.hzEditor.WCEditor.browsingPanel.node_lists.elements();
|
---|
198 | while(en.hasMoreElements()){
|
---|
199 | Node n =(Node)en.nextElement();
|
---|
200 | Enumeration slot_en = n.getSlots().elements();
|
---|
201 | while(slot_en.hasMoreElements()){
|
---|
202 | Slot slot =(Slot)slot_en.nextElement();
|
---|
203 | if(!roles.contains(slot.getRoleName())){
|
---|
204 | roles.addElement(slot.getRoleName());
|
---|
205 | }
|
---|
206 | }
|
---|
207 | }
|
---|
208 | */
|
---|
209 | return roles;
|
---|
210 | }
|
---|
211 |
|
---|
212 | //蜈�→縺ェ繧九が繝ウ繝医Ο繧ク繝シ縺ァ縺ョ驕ク謚橸シ医け繝ェ繝�け�牙�逅�食ozo莉・螟悶〒縺ッ繧ェ繝シ繝舌�繝ゥ繧、繝峨☆繧九� |
---|
213 | void selected(ExbpNode exbpnode){
|
---|
214 | // this.hzEditor.WCEditor.browsingPanel.Jump(exbpnode.getHozoNode());
|
---|
215 | }
|
---|
216 |
|
---|
217 | //蜈�→縺ェ繧九が繝ウ繝医Ο繧ク繝シ縺ァ縺ョ驕ク謚橸シ医け繝ェ繝�け�牙�逅�食ozo莉・螟悶〒縺ッ繧ェ繝シ繝舌�繝ゥ繧、繝峨☆繧九� |
---|
218 | void selectedClear(){
|
---|
219 | // this.hzEditor.WCEditor.definitionPanel.uncursel();
|
---|
220 | // this.hzEditor.WCEditor.browsingPanel.pick(null, false);
|
---|
221 | }
|
---|
222 | //Open縺励◆MAP縺ィ繧ェ繝ウ繝医Ο繧ク繝シ縺ョ蜈�ョ繝シ繧ソ縺ョ蟇セ蠢懊▼縺� |
---|
223 | void setOrgNodes(){
|
---|
224 | /*
|
---|
225 | if (this.hzEditor==null) {
|
---|
226 | System.out.println("ERROR!!:::HzEditor is NOT FOUND!");
|
---|
227 | return;
|
---|
228 | }
|
---|
229 |
|
---|
230 | Enumeration en =exbp.nodes.elements();
|
---|
231 | while(en.hasMoreElements()){
|
---|
232 | ExbpNode node =(ExbpNode)en.nextElement();
|
---|
233 | String lbl = node.getLabel();
|
---|
234 | Node org_node;
|
---|
235 | if(lbl.endsWith("[RH]")){
|
---|
236 | lbl=lbl.substring(0,lbl.indexOf("[RH]"));
|
---|
237 | //System.out.println(node.getLabel()+"====>"+lbl);
|
---|
238 | if(this.isSubLung){
|
---|
239 | org_node = this.hzEditor.WCEditor.findNodeWithSubLang(lbl);
|
---|
240 | }
|
---|
241 | else{
|
---|
242 | org_node = this.hzEditor.findRH(lbl);
|
---|
243 | }
|
---|
244 | }
|
---|
245 | else{
|
---|
246 | if(this.isSubLung){
|
---|
247 | org_node = this.hzEditor.WCEditor.findNodeWithSubLang(lbl);
|
---|
248 | }
|
---|
249 | else{
|
---|
250 | org_node = this.hzEditor.findNode(lbl);
|
---|
251 | }
|
---|
252 | }
|
---|
253 | node.setOrgNode(org_node);
|
---|
254 | if(org_node!=null){
|
---|
255 | //System.out.println("setOrgNodes:::"+lbl+"<=>"+org_node.getLabel());
|
---|
256 | }else{
|
---|
257 | //System.out.println("setOrgNodes:::"+lbl+"<=>NOT FOUND!");
|
---|
258 | }
|
---|
259 | }
|
---|
260 | */
|
---|
261 | }
|
---|
262 |
|
---|
263 | //蜈�→縺ェ繧軌bject縺九iFocalPoint縺ィ縺ェ繧畿xbpNode繧剃ス懊k縲食ozo莉・螟悶〒縺ッ繧ェ繝シ繝舌�繝ゥ繧、繝峨☆繧九� |
---|
264 | ExbpNode[] setFocalPoints(){
|
---|
265 | // if (this.hzEditor==null) return null;
|
---|
266 |
|
---|
267 | ExbpNode[] exbpnodes = null;
|
---|
268 |
|
---|
269 | exbp.nodes.removeAllElements();
|
---|
270 |
|
---|
271 | // Vector<Node> chi_nodes;
|
---|
272 | // GraphicObject gobj=null;
|
---|
273 | // Object ob=null;
|
---|
274 |
|
---|
275 | if (focal_points.size() == 1) {//�代▽縺ョNode繧帝∈謚槭@縺滄圀縺ョ蜃ヲ逅� |
---|
276 | Object gobj = focal_points.firstElement();
|
---|
277 | //gobj =(GraphicObject) focal_points.firstElement();
|
---|
278 |
|
---|
279 | if(gobj instanceof String){
|
---|
280 | exbp.exbp_node_center =new ExbpNode((String)gobj);
|
---|
281 | exbp.exbp_node_center.setOrgNode(gobj);
|
---|
282 | exbp.nodes.add(exbp.exbp_node_center);
|
---|
283 | exbpnodes = new ExbpNode[1];
|
---|
284 | exbpnodes[0]=exbp.exbp_node_center;
|
---|
285 | }
|
---|
286 | else if(gobj instanceof Object){
|
---|
287 | System.out.println("*** ERROR:Node繧帝∈謚槭☆繧句ソ�ヲ√′縺ゅj縺セ縺�:" );
|
---|
288 | }
|
---|
289 | else{//驕ク謚槭↑縺励�蝣エ蜷医��後お繝ゥ繝シ繧貞�縺励※邨ゆコ� |
---|
290 |
|
---|
291 | JOptionPane.showMessageDialog(exbpframe,
|
---|
292 | "You Have to select [Node]!",
|
---|
293 | "ERROR",
|
---|
294 | JOptionPane.ERROR_MESSAGE);
|
---|
295 | System.out.println("ERROR:Node繧帝∈謚槭☆繧句ソ�ヲ√′縺ゅj縺セ縺�:" );
|
---|
296 | exbpframe.dispose();
|
---|
297 | }
|
---|
298 | }
|
---|
299 | else {//隍�焚Node繧帝∈謚槭@縺滄圀縺ョ蜃ヲ逅�
|
---|
300 | if(focal_points.size() > 1){
|
---|
301 | exbp.exbp_node_center = new ExbpNode("(ROOT)");
|
---|
302 | exbp.nodes.addElement(exbp.exbp_node_center);
|
---|
303 |
|
---|
304 | Vector chi_nodes = new Vector();
|
---|
305 | Enumeration node_en = focal_points.elements();
|
---|
306 | while(node_en.hasMoreElements()){
|
---|
307 | Object gobj2 = node_en.nextElement();
|
---|
308 | if(gobj2 instanceof String){
|
---|
309 | ExbpNode chinode = new ExbpNode((String)gobj2);
|
---|
310 | chinode.setOrgNode(gobj2);
|
---|
311 | exbp.exbp_node_center.addChild(chinode);
|
---|
312 | exbp.nodes.add(chinode);
|
---|
313 | }
|
---|
314 |
|
---|
315 | exbpnodes = new ExbpNode[exbp.exbp_node_center.children.size()];
|
---|
316 | for(int i=0;i<exbp.exbp_node_center.children.size();i++){
|
---|
317 | exbpnodes[i]=(ExbpNode)exbp.exbp_node_center.children.elementAt(i);
|
---|
318 | }
|
---|
319 | }
|
---|
320 | }
|
---|
321 | else{//Node繧定ヲ矩∈謚槭�髫帙�蜃ヲ逅� |
---|
322 | JOptionPane.showMessageDialog(exbpframe,
|
---|
323 | "You Have to select [Node]!",
|
---|
324 | "ERROR",
|
---|
325 | JOptionPane.ERROR_MESSAGE);
|
---|
326 | System.out.println("ERROR:Node繧帝∈謚槭☆繧句ソ�ヲ√′縺ゅj縺セ縺�);
|
---|
327 | exbpframe.dispose();
|
---|
328 | }
|
---|
329 | }
|
---|
330 |
|
---|
331 | return exbpnodes;
|
---|
332 | }
|
---|
333 |
|
---|
334 | /*
|
---|
335 | //蜈�→縺ェ繧軌bject縺九iExbpNode繧剃ス懊k縲食ozo莉・螟悶〒縺ッ繧ェ繝シ繝舌�繝ゥ繧、繝峨☆繧九� |
---|
336 | ExbpNode makeExbpNode(Object obj){
|
---|
337 | if(!(obj instanceof String)){
|
---|
338 | //System.out.println("ERROR@makeChildNodes():obj is NOT Node!");
|
---|
339 | return null;
|
---|
340 | }
|
---|
341 |
|
---|
342 | Node node =(Node)obj;
|
---|
343 | ExbpNode exbpnode;
|
---|
344 |
|
---|
345 |
|
---|
346 | //#kozaki 2009/08/19縲Slot縺ョ蜃ヲ逅�r霑ス蜉
|
---|
347 | if(node instanceof hozo.oe.gobj.Slot){
|
---|
348 | if(!((Slot)node).getRHname().equals("")){
|
---|
349 | node = this.hzEditor.findRH(((Slot)node).getRHname());
|
---|
350 | }
|
---|
351 | else{
|
---|
352 |
|
---|
353 | }
|
---|
354 | }
|
---|
355 |
|
---|
356 | if(node instanceof hozo.oe.gobj.NodeRH){
|
---|
357 | if(this.isSubLung){
|
---|
358 | exbpnode= new ExbpNode(node.getSubLabel()+"[RH]");
|
---|
359 | }
|
---|
360 | else{
|
---|
361 | exbpnode= new ExbpNode(node.getLabel()+"[RH]");
|
---|
362 | }
|
---|
363 | }
|
---|
364 | else{
|
---|
365 | if(this.isSubLung){
|
---|
366 | exbpnode= new ExbpNode(node.getSubLabel());
|
---|
367 | }
|
---|
368 | else{
|
---|
369 | exbpnode= new ExbpNode(node.getLabel());
|
---|
370 | }
|
---|
371 | }
|
---|
372 |
|
---|
373 | exbpnode.setOrgNode(obj);
|
---|
374 | //exbp.nodes.add(exbpnode);
|
---|
375 |
|
---|
376 | return exbpnode;
|
---|
377 | }*/
|
---|
378 |
|
---|
379 |
|
---|
380 | //�代▽縺ョExbpNode縺ォ繧ウ繝槭Φ繝峨r驕ゥ蠢懊@縺ヲ荳倶ス孔xbpNode繧定ソス蜉縺吶k縲食ozo莉・螟悶〒縺ョ繧ェ繝シ繝舌�繝ゥ繧、繝峨�蠢�ヲ√↑縺励� |
---|
381 | //縲繧ウ繝槭Φ繝画ッ弱↓繝。繧ス繝�ラ繧偵が繝シ繝舌�繝ゥ繧、繝峨☆繧� |
---|
382 | void makeChildNodes(ExbpNode exbpnode, String command){
|
---|
383 | /* if(!(exbpnode.getOrgNode() instanceof Node)){
|
---|
384 | //System.out.println("ERROR@makeChildNodes():orgnode is NOT Node!");
|
---|
385 | return;
|
---|
386 | }
|
---|
387 |
|
---|
388 | // exbpnode.children.removeAllElements();
|
---|
389 | // System.out.println("makeChildNodes():::command="+command);
|
---|
390 | removeAllChildren(exbpnode);
|
---|
391 |
|
---|
392 |
|
---|
393 | if(command.equals("isa")){ // ?縲荳倶ス肴ヲょソオ縺ョ謚ス蜃コ is-a
|
---|
394 | makeChildNodeISA(exbpnode);
|
---|
395 | }
|
---|
396 | else if(command.equals("super")){// ?荳贋ス肴ヲょソオ縺ョ謚ス蜃コ
|
---|
397 | makeChildNodeSuper(exbpnode);
|
---|
398 | }
|
---|
399 | else if(command.startsWith(":")){// 蜿ら�蜈��謚ス蜃コ縲Refereed to
|
---|
400 | makeChildNodeRefered(exbpnode,command);
|
---|
401 | }
|
---|
402 | // #hirota 08/08/19 繧ウ繝槭Φ繝臥オ仙粋
|
---|
403 | else if(command.startsWith(";")){ // (old)繝ュ繝シ繝ォ謖�ョ壹≠繧翫�九荳倶ス肴ヲょソオ謖�ョ壹≠繧� |
---|
404 | makeChildNodeRoleSub(exbpnode,command);
|
---|
405 | }
|
---|
406 | else if(command.equals("any-h")){ // ? depend-on 竊� #hirota 11/26 迴セ蝨ィ縺ョ隕也せ縺君ode縺ョ縺ィ縺阪¨ode縺ョ繧ケ繝ュ繝�ヨ縺ョRH繧定。ィ遉コ
|
---|
407 | makeChildNodeDependOnRH(exbpnode,command);
|
---|
408 | }
|
---|
409 | else if(command.equals("++s")){// ?縲depend on 縲竊舌さ繝ウ繝�く繧ケ繝医r蜿悶j蜃コ縺� |
---|
410 | makeChildNodeDependOnContext(exbpnode,command);
|
---|
411 | }
|
---|
412 | else if(command.equals("++P")){// playable 髢「菫�?縲竊�all
|
---|
413 | makeChildNodePlayable(exbpnode);
|
---|
414 | }
|
---|
415 | else if(command.startsWith("++p")){// playable 髢「菫�?縲竊�label 謖�ョ� |
---|
416 | makeChildNodePlayableByLabel(exbpnode, command);
|
---|
417 | }
|
---|
418 | else if(command.equals("++c")){ // ?縲playable 竊�繝励Ξ繧、繝、繝シ縺ョ蜿悶j蜃コ縺� |
---|
419 | makeChildNodePlayer(exbpnode);
|
---|
420 | }
|
---|
421 | else if(command.startsWith("++r:")){// ?髢「菫よヲょソオ縺ョ蜿悶j蜃コ縺� ++r:Lable
|
---|
422 | makeChildNodeRelationConcept(exbpnode,command);
|
---|
423 | }
|
---|
424 | else if(command.equals("++R")){ // ++R 蜈ィ驛ィ蜿悶j蜃コ縺� |
---|
425 | makeChildNodeRelationAll(exbpnode);
|
---|
426 | }
|
---|
427 | else if(command.startsWith("super_isa")){ // #hirota 08/09/03 蜈�シ滓ヲょソオ縺ョ蜿悶j蜃コ縺�super+isa)
|
---|
428 | makeChildNodeBrothers(exbpnode);
|
---|
429 | }
|
---|
430 | else if(command.startsWith("_")){// 繧ッ繝ゥ繧ケ蛻カ邏�r霎ソ繧句�逅�only RH
|
---|
431 | makeChildNodeCConlyRH(exbpnode,command);
|
---|
432 | }
|
---|
433 | else{
|
---|
434 | makeChildNodeReferringTo(exbpnode,command);// 繧ッ繝ゥ繧ケ蛻カ邏�r霎ソ繧句�逅� |
---|
435 | }
|
---|
436 | */
|
---|
437 | }
|
---|
438 |
|
---|
439 | public void run(){
|
---|
440 | //SerachPath(target_nodes,target_cls);
|
---|
441 | }
|
---|
442 |
|
---|
443 | public void stop(){
|
---|
444 | // pbar_frame.stop();
|
---|
445 | // pbar_frame=null;
|
---|
446 | }
|
---|
447 |
|
---|
448 | ExbpNode[] target_nodes;
|
---|
449 | // Node[] target_cls;
|
---|
450 | int[] match_num;
|
---|
451 | // ProgressFrame pbar_frame;
|
---|
452 |
|
---|
453 | /*
|
---|
454 | public void SearchPathAsThread(ExbpNode[] nodes, Node[] cls){
|
---|
455 | pbar_frame = new ProgressFrame("Serach Path","Now,Searching..., Please wait.");
|
---|
456 | pbar_frame.frame.setAlwaysOnTop(true);
|
---|
457 | pbar_frame.frame.setLocation(exbp.cmd_dialog.getWidth(),100);
|
---|
458 |
|
---|
459 |
|
---|
460 | target_nodes = nodes;
|
---|
461 | target_cls =cls;
|
---|
462 | match_num = new int[cls.length];
|
---|
463 | for(int i=0;i<match_num.length;i++){
|
---|
464 | match_num[i]=0;
|
---|
465 | }
|
---|
466 |
|
---|
467 | Thread thread = new Thread(this);
|
---|
468 | thread.start();
|
---|
469 |
|
---|
470 |
|
---|
471 | }*/
|
---|
472 | /*
|
---|
473 |
|
---|
474 | void checkMatchCount(){
|
---|
475 | match_num = new int[target_cls.length];
|
---|
476 | for(int i=0;i<match_num.length;i++){
|
---|
477 | match_num[i]=0;
|
---|
478 | }
|
---|
479 |
|
---|
480 | Enumeration en = this.exbp.nodes.elements();
|
---|
481 | while(en.hasMoreElements()){
|
---|
482 | ExbpNode node = (ExbpNode)en.nextElement();
|
---|
483 | Object obj = node.getOrgNode();
|
---|
484 | if(obj instanceof Node){
|
---|
485 | Node hozonode=(Node)obj;
|
---|
486 | for(int i=0;i<target_cls.length;i++){
|
---|
487 | if(target_cls[i] instanceof Node){
|
---|
488 | if(hozonode.isSubclassOf((Node)target_cls[i])
|
---|
489 | || hozonode.equals(target_cls[i])){
|
---|
490 | match_num[i]++;
|
---|
491 | }
|
---|
492 | }
|
---|
493 | }
|
---|
494 | }
|
---|
495 | }
|
---|
496 |
|
---|
497 | for(int i=0;i<target_cls.length;i++){
|
---|
498 | System.out.println(
|
---|
499 | target_cls[i].getLabel()+" = "+
|
---|
500 | match_num[i]);
|
---|
501 | }
|
---|
502 | }
|
---|
503 | */
|
---|
504 |
|
---|
505 | //#kozaki縲2009/02/13縲蟇セ雎。繝弱�繝峨r隍�焚縺ォ諡。蠑オ
|
---|
506 | // public void SerachPath(ExbpNode[] nodes, Node[] target_cls/*String[] cls_lists*/){}
|
---|
507 |
|
---|
508 | // private Vector<ExbpNode> SerachPath(Vector<ExbpNode> nodes,
|
---|
509 | // Node[] cls_lists,Vector<ExbpNode> match_nodes){}
|
---|
510 |
|
---|
511 | void removeAllChildren(ExbpNode exbpnode){
|
---|
512 | this.exbp.nodes.removeAll(exbpnode.children);
|
---|
513 | exbpnode.children.removeAllElements();
|
---|
514 | }
|
---|
515 |
|
---|
516 | //谺。縺ォ縺溘←繧九ヮ繝シ繝峨�繝ェ繧ケ繝医r蜿門セ励☆繧� |
---|
517 | //窶サ荳蠎ヲ縺溘←縺」縺溘%縺ィ縺ョ縺ゅk繝��繧ソ縺ッ�荊emp_nodes縺ォ菫晄戟縺輔l�後◎縺。繧峨r霑斐☆
|
---|
518 | // Vector<ExbpNode> getChildNodeFromTemp(ExbpNode exbpnode, String cmd){}
|
---|
519 |
|
---|
520 |
|
---|
521 | void explore(ExbpNode exbpnode, boolean all, String cmd){
|
---|
522 | /* ExbpNode[] exbpnodes=new ExbpNode[1];
|
---|
523 |
|
---|
524 | if(!all){
|
---|
525 | exbpnodes=new ExbpNode[1];
|
---|
526 | exbpnodes[0]=exbpnode;
|
---|
527 | }
|
---|
528 | else{
|
---|
529 | int layer = exbpnode.getLocatedLayer();
|
---|
530 | exbpnodes=exbp.getExbpNodesAtLear(layer,true);
|
---|
531 | }
|
---|
532 |
|
---|
533 | for(int l=0;l<exbpnodes.length;l++){
|
---|
534 | if(exbpnodes[l].visible){
|
---|
535 | this.makeChildNodeReferringToDirectly(exbpnodes[l], cmd);
|
---|
536 | this.makeChildNodeRefered(exbpnodes[l], ":Any");
|
---|
537 |
|
---|
538 | //exbpnodes[l].children.removeAllElements();
|
---|
539 | // Vector temp_children = getChildNodeFromTemp(exbpnodes[l],cmd);
|
---|
540 | // Enumeration en = temp_children.elements();
|
---|
541 | // while(en.hasMoreElements()){
|
---|
542 | // ExbpNode chi = (ExbpNode)en.nextElement();
|
---|
543 | // exbpnodes[l].addChild(chi);
|
---|
544 | // chi.setVisible(true);
|
---|
545 | // }
|
---|
546 | }
|
---|
547 | }*/
|
---|
548 |
|
---|
549 | }
|
---|
550 |
|
---|
551 | void clearSubPath(ExbpNode exbpnode){
|
---|
552 | ExbpNode[] exbpnodes=new ExbpNode[1];
|
---|
553 |
|
---|
554 | int layer = exbpnode.getLocatedLayer();
|
---|
555 | exbpnodes=exbp.getExbpNodesAtLear(layer,true);
|
---|
556 |
|
---|
557 |
|
---|
558 | for(int l=0;l<exbpnodes.length;l++){
|
---|
559 | if(exbpnodes[l].visible){
|
---|
560 | this.removeAllChildren(exbpnodes[l]);
|
---|
561 | }
|
---|
562 | }
|
---|
563 |
|
---|
564 | }
|
---|
565 |
|
---|
566 |
|
---|
567 | //蜷�さ繝槭Φ繝峨r驕ゥ逕ィ縺励◆縺ィ縺阪↓縺溘←繧九ヮ繝シ繝峨r縺励i縺ケ縺ヲ�卦ree縺ョ繧ウ繝槭Φ繝峨Μ繧ケ繝医↓蜈・繧後k�� |
---|
568 | // void setCommandsTree(ExbpNode[] exbpnodes){}
|
---|
569 |
|
---|
570 | public void makeChildNodeSuper(ExbpNode exbpnode) {}
|
---|
571 |
|
---|
572 |
|
---|
573 | private void makeSlotRelatedExbpNode(ExbpNode exbpnode, String command) {}
|
---|
574 |
|
---|
575 | // #kozaki 2008/08/17縲繧ケ繝ュ繝�ヨ縺ァ髢「騾」縺励◆讎ょソオ繧定セソ繧句�逅�∈縺ョ蛻�イ� |
---|
576 | // private void makeSlotRelatedExbpNode(ExbpNode par_exbpnode, Node node, String command){}
|
---|
577 |
|
---|
578 |
|
---|
579 | //#kozaki 2008/08/12縲繧ッ繝ゥ繧ケ蛻カ邏�r霎ソ繧句�逅�r迢ャ遶� |
---|
580 | // private void makeExbpNodeCC(ExbpNode par_exbpnode, //隕ェ縺ィ縺ェ繧畿xbpNode
|
---|
581 | // Slot slot, //霎ソ繧句ッセ雎。縺ィ縺ェ繧九せ繝ュ繝�ヨ
|
---|
582 | // Node slot_node, //繧ッ繝ゥ繧ケ蛻カ邏�→縺励※蜿ら�縺励※縺�k繝弱�繝� |
---|
583 | // Node node, //霎ソ繧九せ繝ュ繝�ヨ繧呈戟縺、繝弱�繝� |
---|
584 | // String command, //霎ソ繧九さ繝槭Φ繝� |
---|
585 | // String match_key //荳閾エ縺励◆繧ウ繝槭Φ繝会シ井ク贋ス阪せ繝ュ繝�ヨ縺ョ蜃ヲ逅�畑�� |
---|
586 | // ){}
|
---|
587 |
|
---|
588 | // public void makeChildNodeISA(ExbpNode exbpnode){}
|
---|
589 |
|
---|
590 |
|
---|
591 | // ?
|
---|
592 | // private void makeChildNodeRefered(ExbpNode exbpnode, String command) {}
|
---|
593 |
|
---|
594 | // ?窶�(old)繝ュ繝シ繝ォ謖�ョ壹≠繧翫�九荳倶ス肴ヲょソオ謖�ョ壹≠繧� |
---|
595 | // public void makeChildNodeRoleSub(ExbpNode exbpnode,String command) {}
|
---|
596 |
|
---|
597 | // ? depend-on 竊� #hirota 11/26 迴セ蝨ィ縺ョ隕也せ縺君ode縺ョ縺ィ縺阪¨ode縺ョ繧ケ繝ュ繝�ヨ縺ョRH繧定。ィ遉コ
|
---|
598 | // public void makeChildNodeDependOnRH(ExbpNode exbpnode,String NodeCC) {}
|
---|
599 |
|
---|
600 |
|
---|
601 |
|
---|
602 | // ?縲depend on 縲竊舌さ繝ウ繝�く繧ケ繝医r蜿悶j蜃コ縺�#hirota add 09/11/09
|
---|
603 | // public void makeChildNodeDependOnContext(ExbpNode exbpnode,String command) {}
|
---|
604 |
|
---|
605 | // playable 髢「菫�?縲竊�all
|
---|
606 | // public void makeChildNodePlayable(ExbpNode exbpnode) {}
|
---|
607 |
|
---|
608 | // playable 髢「菫�?縲竊�label 謖�ョ� |
---|
609 | // private void makeChildNodePlayableByLabel(ExbpNode exbpnode,String command) {}
|
---|
610 |
|
---|
611 | // ?縲playable 竊�繝励Ξ繧、繝、繝シ縺ョ蜿悶j蜃コ縺� |
---|
612 | // public void makeChildNodePlayer(ExbpNode exbpnode) {}
|
---|
613 | // private void makeChildNodeRelationConcept(ExbpNode exbpnode,String command) {}
|
---|
614 |
|
---|
615 | // ++R 蜈ィ驛ィ蜿悶j蜃コ縺�邯呎価繧ェ繝励す繝ァ繝ウ縺ゅj縺ョ縺ィ縺搾シ� |
---|
616 | // public void makeChildNodeRelationAllToDirectry(ExbpNode exbpnode) {}
|
---|
617 | // ++R 蜈ィ驛ィ蜿悶j蜃コ縺� |
---|
618 | // public void makeChildNodeRelationAll(ExbpNode exbpnode) {}
|
---|
619 |
|
---|
620 | // #hirota 08/09/03 蜈�シ滓ヲょソオ縺ョ蜿悶j蜃コ縺�super+isa)
|
---|
621 | // private void makeChildNodeBrothers(ExbpNode exbpnode) {}
|
---|
622 |
|
---|
623 | // 繧ッ繝ゥ繧ケ蛻カ邏�r霎ソ繧句�逅�only RH
|
---|
624 | // private void makeChildNodeCConlyRH(ExbpNode exbpnode,String command) {}
|
---|
625 |
|
---|
626 | // 繧ッ繝ゥ繧ケ蛻カ邏�r霎ソ繧句�逅�
|
---|
627 | // private void makeChildNodeReferringTo(ExbpNode exbpnode,String command) {}
|
---|
628 |
|
---|
629 | // 繧ッ繝ゥ繧ケ蛻カ邏�r霎ソ繧句�逅��繧オ繝悶せ繝ュ繝�ヨ繧貞性縺セ縺ェ縺�#kozaki縲2009/08/19
|
---|
630 | // private void makeChildNodeReferringToDirectly(ExbpNode exbpnode,String command) {}
|
---|
631 |
|
---|
632 |
|
---|
633 | // String[] getOtionLists(Vector<ExbpNode> exbpnodes){}
|
---|
634 |
|
---|
635 |
|
---|
636 | /* public String[] getSelectedClass(String[] labels){
|
---|
637 | TreeSelectDialog treeSelectDialog = new TreeSelectDialog(true);
|
---|
638 | treeSelectDialog.setHZEditor(this.hzEditor);
|
---|
639 | treeSelectDialog.setSubLang(this.isSubLung);
|
---|
640 | treeSelectDialog.updateTree();
|
---|
641 | //treeSelectDialog.setSize(320, 450);
|
---|
642 | if(labels.length>0){
|
---|
643 | String label = labels[0];
|
---|
644 | for(int i=1;i<labels.length;i++){
|
---|
645 | label +=" "+"\\" + Slot.OR_DELIMITER+" "+labels[i];
|
---|
646 | }
|
---|
647 | treeSelectDialog.setSelectedTreeDialog(labels, label);
|
---|
648 | }
|
---|
649 | treeSelectDialog.setVisible(true);
|
---|
650 | if (treeSelectDialog.isOK()) {
|
---|
651 | String[] cls_lists = treeSelectDialog.getSelectedHozoNodesByLabel();
|
---|
652 | // String opt = treeSelectDialog.getSelected();
|
---|
653 | // if(opt==null){
|
---|
654 | // opt="Any";
|
---|
655 | // }
|
---|
656 | // String[] cls_lists = opt.split(" "+"\\" + Slot.OR_DELIMITER+" ");
|
---|
657 | return cls_lists;
|
---|
658 | }
|
---|
659 | return null;
|
---|
660 | }*/
|
---|
661 |
|
---|
662 | // public Object[] getSelectedClasses(String target_cls){}
|
---|
663 |
|
---|
664 | // public Node[] getSelectedClassesAsNode(String target_cls){}
|
---|
665 |
|
---|
666 | // public Node getHozoNode(String lbl){}
|
---|
667 |
|
---|
668 | // public boolean isSubClassOfSelectedClasses(Object node, Object[] target_classes){}
|
---|
669 |
|
---|
670 | // public boolean isSubClass(Object node, Object target){}
|
---|
671 |
|
---|
672 | //#kozaki 2009/02/13縲Node[]繧担tring[]縺ォ螟画鋤
|
---|
673 | // public String[] NodesToStrings(Node[] nodes){}
|
---|
674 |
|
---|
675 | //#kozaki 2009/02/13縲繧ッ繝ゥ繧ケ荳隕ァ繧誰ode[]縺ァ蜿門セ� |
---|
676 | // public Node[] getSelectedClassNodes(Node[] nodes){}
|
---|
677 |
|
---|
678 | //#hirota 2009/05/18縲髢「菫よヲょソオ荳隕ァ繧誰ode[]縺ァ蜿門セ� |
---|
679 | // public Node[] getSelectedClassNodes2(Node[] nodes){
|
---|
680 | // return null;
|
---|
681 | // }
|
---|
682 |
|
---|
683 | //#kozaki 09/02/15
|
---|
684 | // public void setSubLang(boolean b){}
|
---|
685 |
|
---|
686 | }
|
---|
687 |
|
---|
688 |
|
---|