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