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 | import org.json.JSONException;
|
---|
20 |
|
---|
21 | /***邵イ�ス008/10/18邵イ�スkozaki
|
---|
22 | 邵イ�スAP騾墓サ難ソス邵コ�ョ邵コ貅假ス∫クコ�ォ�ス譴ァ�ウ證ョ�ス郢ァミ杆L邵コ�ョAPI邵コ荵晢ス会ソス蠕鯉ソス郢晢ソス�ス騾包スィ邵コ�ョ郢晢ソス�ス郢ァ�ソ郢ァ蜑�スス諛茨ソス邵コ蜷カ�狗クコ貅假ス∫クコ�ョ
|
---|
23 | 邵イ�スホ鍋ケァ�ス郢晢ソス繝ゥ鬯俶ァュ�堤クコ阮呻ソス郢ァ�ッ郢晢スゥ郢ァ�ケ邵コ�ォ邵コ�セ邵コ�ィ郢ァ竏夲ス具ソス�ス |
---|
24 |
|
---|
25 | ***/
|
---|
26 | public class MapFactory implements Runnable{
|
---|
27 |
|
---|
28 | ExtendBP exbp;
|
---|
29 | public ExtendFrame exbpframe;
|
---|
30 | Vector focal_points;//隴幢ソス�ス邵コ�ォ鬩包スク隰壽ァュ�邵コ讚サode(邵コ�ェ邵コ�ゥ)郢ァ蜑�スソ譎�亜邵コ蜷カ�� |
---|
31 | boolean isSubLung;
|
---|
32 | static boolean isGrayView=false;
|
---|
33 | Vector<String> checked_nodes;
|
---|
34 | boolean search_shortest=true;//郢ァ�オ郢晢スシ郢昶�繝ア郢ァ�ケ邵コ�ァ隴幢ソス豢堤ケ昜サ」縺帷ケァ蜻茨ス、諛�スエ�「邵コ蜷カ�� |
---|
35 | int serch_depth = 10;//郢ァ�オ郢晢スシ郢昶�繝ア郢ァ�ケ邵コ�ァ隴幢ソス豢堤ケ昜サ」縺帷ケァ蜻茨ス、諛�スエ�「邵コ蜷カ�玖アコ�ア邵コ蛹�スシ蝓滓咎¥�ュ郢昜サ」縺幄ョ諛�スエ�「郢ァ蛛オ�邵コ�ェ邵コ�ス竊堤クコ髦ェ�ス陟「�ス笘�抄�ソ邵コ�ス�シ�ス |
---|
36 | Vector<ExbpNodeTemp> temp_nodes;
|
---|
37 |
|
---|
38 | SparqlBuilderPanel spBuilder;
|
---|
39 |
|
---|
40 | public static void main (String[] args) {
|
---|
41 | MapFactory map = new MapFactory();
|
---|
42 | //map.loadPathList(map.getDummyPathList());
|
---|
43 | }
|
---|
44 |
|
---|
45 | public List<Path> getDummyPathList(){
|
---|
46 | ArrayList pathlist = new ArrayList();
|
---|
47 | // ArrayList class_link_list = new ArrayList<ClassLink>() {{
|
---|
48 | // add(new ClassLink("propertyURI", "linkedClassURI2", Direction.forward));
|
---|
49 | // add(new ClassLink("propertyURI2", "linkedClassURI3", Direction.forward));
|
---|
50 | // add(new ClassLink("propertyURI3", "linkedClassURI4", Direction.forward));
|
---|
51 | // }};
|
---|
52 | // Path path = new Path("StartClass1", class_link_list);
|
---|
53 | // pathlist.add(path);
|
---|
54 | //
|
---|
55 | return pathlist;
|
---|
56 | }
|
---|
57 |
|
---|
58 | public void setSPARQLbuilder(SparqlBuilderPanel builder){
|
---|
59 | this.spBuilder = builder;
|
---|
60 | }
|
---|
61 |
|
---|
62 | // void setSPARQLquery(Path path){
|
---|
63 | // this.spBuilder;
|
---|
64 | // }
|
---|
65 |
|
---|
66 | public MapFactory() {
|
---|
67 | exbpframe = new ExtendFrame(this);
|
---|
68 | exbp = exbpframe.getExtendBP();
|
---|
69 | focal_points = new Vector<Object>();
|
---|
70 | temp_nodes = new Vector<ExbpNodeTemp>();
|
---|
71 |
|
---|
72 | // focal_points.add("TEST");
|
---|
73 | // focal_points.add("TEST2");
|
---|
74 |
|
---|
75 | // isSubLung=hze.isSubLang;
|
---|
76 | // isGrayView=hze.isGrayView;//#kozaki 2009/07/28
|
---|
77 | // exbp.setHZEditor(hze);
|
---|
78 | // exbpframe.select_dialog = new EtendBPSelectDialog(exbp,exbpframe);
|
---|
79 | exbpframe.setVisible(true);
|
---|
80 | exbpframe.RefreshExbp();
|
---|
81 |
|
---|
82 | // if(focal_points.size()==1){
|
---|
83 | // exbp.cmd_dialog.setCommandOptions(exbp.exbp_node_center);
|
---|
84 | // }
|
---|
85 | //
|
---|
86 | // treeSelectDialog = new TreeSelectDialog(true);
|
---|
87 | // treeSelectDialog.setHZEditor(this.hzEditor);
|
---|
88 | // treeSelectDialog.setSubLang(this.isSubLung);
|
---|
89 | // treeSelectDialog.setSize(450, 600);
|
---|
90 | //
|
---|
91 | }
|
---|
92 |
|
---|
93 | public void loadPathList(Path[] pathlist) throws JSONException{
|
---|
94 | if(pathlist.length==0){
|
---|
95 | JOptionPane.showMessageDialog(null, "NO PATH!!");
|
---|
96 | return;
|
---|
97 | }
|
---|
98 | Path path = pathlist[0];
|
---|
99 |
|
---|
100 | this.exbp.exbp_node_center = new ExbpNode(getTempLabel(path.getStartClass()));
|
---|
101 |
|
---|
102 | String json_data="{\"paths\":[";
|
---|
103 |
|
---|
104 | for(int i = 0; i<pathlist.length; i++){
|
---|
105 | if(i>0){
|
---|
106 | json_data+=",";
|
---|
107 | }
|
---|
108 | addPath(pathlist[i]);
|
---|
109 | json_data+=pathlist[i].toJSONString2();
|
---|
110 | }
|
---|
111 | json_data+="]}";
|
---|
112 |
|
---|
113 | this.exbpframe.RefreshExbp();
|
---|
114 | System.out.println(json_data);
|
---|
115 | // this.exbp.exbp_node_center = exbpnode;
|
---|
116 | // exbpnode= new ExbpNode("Center");;
|
---|
117 | // exbpnode.setChildrenColor(Color.red);
|
---|
118 | // exbpnode.key="prop1";
|
---|
119 | // this.exbp_node_center.addChild(exbpnode);
|
---|
120 | // this.exbp_node_center.addChild(new ExbpNode("TEST2"));
|
---|
121 | // this.exbp_node_center.addChild(new ExbpNode("TEST3"));
|
---|
122 | // this.exbp_node_center.addChild(new ExbpNode("TEST4"));
|
---|
123 |
|
---|
124 |
|
---|
125 | }
|
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|
129 | void addPath(Path path){
|
---|
130 | System.out.println("addPath"+path.getStartClass()+"--->"+path.getClassLinks().size());
|
---|
131 | String target_class = path.getStartClass();
|
---|
132 | // ExbpNode node = this.exbp.findExbpNode(target_class);
|
---|
133 | ExbpNode node = this.exbp.exbp_node_center;
|
---|
134 |
|
---|
135 |
|
---|
136 | List<ClassLink> links = path.getClassLinks();
|
---|
137 | for(ClassLink link : links){
|
---|
138 | String next_class = link.getLinkedClassURI();
|
---|
139 | System.out.println("="+link.getNumOfLinks()+"=>"+next_class);
|
---|
140 |
|
---|
141 | /*
|
---|
142 | String next_class_lbl ="";
|
---|
143 | int index = next_class.lastIndexOf("/");
|
---|
144 | if(index>0 && index<next_class.length()){
|
---|
145 | next_class_lbl = next_class.substring(index+1);
|
---|
146 | }
|
---|
147 | else{
|
---|
148 | next_class_lbl = next_class;
|
---|
149 | }
|
---|
150 |
|
---|
151 | int index2 = next_class_lbl.lastIndexOf("#");
|
---|
152 | if(index2>0 && index2<next_class_lbl.length()){
|
---|
153 | next_class_lbl = next_class_lbl.substring(index2+1);
|
---|
154 | }
|
---|
155 |
|
---|
156 | */
|
---|
157 | ExbpNode next_node = new ExbpNode(getTempLabel(next_class));
|
---|
158 | next_node.setOrgNode(path);
|
---|
159 |
|
---|
160 | node.addChild(next_node);
|
---|
161 | node = next_node;
|
---|
162 | String prop = getTempLabel(link.getPropertyURI());
|
---|
163 |
|
---|
164 | if(link.getDirection().equals(Direction.reverse)){
|
---|
165 | prop += "[<=]";
|
---|
166 | }
|
---|
167 | else if(link.getDirection().equals(Direction.both)){
|
---|
168 | prop += "[<=>]";
|
---|
169 | }
|
---|
170 | next_node.key = prop;
|
---|
171 | }
|
---|
172 |
|
---|
173 |
|
---|
174 | }
|
---|
175 |
|
---|
176 |
|
---|
177 | String getTempLabel(String next_class){
|
---|
178 | String next_class_lbl ="";
|
---|
179 | int index = next_class.lastIndexOf("/");
|
---|
180 | if(index>0 && index<next_class.length()){
|
---|
181 | next_class_lbl = next_class.substring(index+1);
|
---|
182 | }
|
---|
183 | else{
|
---|
184 | next_class_lbl = next_class;
|
---|
185 | }
|
---|
186 |
|
---|
187 | int index2 = next_class_lbl.lastIndexOf("#");
|
---|
188 | if(index2>0 && index2<next_class_lbl.length()){
|
---|
189 | next_class_lbl = next_class_lbl.substring(index2+1);
|
---|
190 | }
|
---|
191 |
|
---|
192 | return next_class_lbl;
|
---|
193 | }
|
---|
194 |
|
---|
195 | //陷茨ソス竊堤クコ�ェ郢ァ逡ソditor驕イ蟲ィ縲樽apTool郢ァ蝣、�ョ�。騾�ソス�邵コ�ヲ邵コ�ス�儀ector郢ァ螳夲スソ譁絶�邵イ鬟殪zo闔会ス・陞滓じ縲堤クコ�ッ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ荵晢ソス
|
---|
196 | Vector getMapVec(){
|
---|
197 | return null;
|
---|
198 | }
|
---|
199 |
|
---|
200 | //陷茨ソス竊堤クコ�ェ郢ァ荵昴′郢晢スウ郢晏現ホ溽ケァ�ク郢晢スシ邵コ�ョ郢晁シ斐<郢ァ�、郢晢スォ郢ァ螳夲スソ譁絶�邵イ鬟殪zo闔会ス・陞滓じ縲堤クコ�ッ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ荵晢ソス
|
---|
201 | File getFile(){
|
---|
202 | return null;
|
---|
203 | }
|
---|
204 |
|
---|
205 | //邵コ蜷カ竏狗クコ�ヲ邵コ�ョ郢晢スュ郢晢スシ郢晢スォ邵コ�ョ闕ウ�ス�ヲ�ァ郢ァ螳夲スソ譁絶�
|
---|
206 | Vector getRoleList(){
|
---|
207 | Vector roles = new Vector();
|
---|
208 | /* Enumeration en = this.hzEditor.WCEditor.browsingPanel.node_lists.elements();
|
---|
209 | while(en.hasMoreElements()){
|
---|
210 | Node n =(Node)en.nextElement();
|
---|
211 | Enumeration slot_en = n.getSlots().elements();
|
---|
212 | while(slot_en.hasMoreElements()){
|
---|
213 | Slot slot =(Slot)slot_en.nextElement();
|
---|
214 | if(!roles.contains(slot.getRoleName())){
|
---|
215 | roles.addElement(slot.getRoleName());
|
---|
216 | }
|
---|
217 | }
|
---|
218 | }
|
---|
219 | */
|
---|
220 | return roles;
|
---|
221 | }
|
---|
222 |
|
---|
223 | //陷茨ソス竊堤クコ�ェ郢ァ荵昴′郢晢スウ郢晏現ホ溽ケァ�ク郢晢スシ邵コ�ァ邵コ�ョ鬩包スク隰壽ゥク�シ蛹サ縺醍ケ晢スェ郢晢ソス縺托ソス迚呻ソス騾�ソス�スHozo闔会ス・陞滓じ縲堤クコ�ッ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ荵晢ソス
|
---|
224 | void selected(ExbpNode exbpnode){
|
---|
225 | // this.hzEditor.WCEditor.browsingPanel.Jump(exbpnode.getHozoNode());
|
---|
226 | }
|
---|
227 |
|
---|
228 | //陷茨ソス竊堤クコ�ェ郢ァ荵昴′郢晢スウ郢晏現ホ溽ケァ�ク郢晢スシ邵コ�ァ邵コ�ョ鬩包スク隰壽ゥク�シ蛹サ縺醍ケ晢スェ郢晢ソス縺托ソス迚呻ソス騾�ソス�スHozo闔会ス・陞滓じ縲堤クコ�ッ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ荵晢ソス
|
---|
229 | void selectedClear(){
|
---|
230 | // this.hzEditor.WCEditor.definitionPanel.uncursel();
|
---|
231 | // this.hzEditor.WCEditor.browsingPanel.pick(null, false);
|
---|
232 | }
|
---|
233 | //Open邵コ蜉ア笳�AP邵コ�ィ郢ァ�ェ郢晢スウ郢晏現ホ溽ケァ�ク郢晢スシ邵コ�ョ陷茨ソス繝ァ郢晢スシ郢ァ�ソ邵コ�ョ陝�スセ陟「諛岩名邵コ�ス |
---|
234 | void setOrgNodes(){
|
---|
235 | /*
|
---|
236 | if (this.hzEditor==null) {
|
---|
237 | System.out.println("ERROR!!:::HzEditor is NOT FOUND!");
|
---|
238 | return;
|
---|
239 | }
|
---|
240 |
|
---|
241 | Enumeration en =exbp.nodes.elements();
|
---|
242 | while(en.hasMoreElements()){
|
---|
243 | ExbpNode node =(ExbpNode)en.nextElement();
|
---|
244 | String lbl = node.getLabel();
|
---|
245 | Node org_node;
|
---|
246 | if(lbl.endsWith("[RH]")){
|
---|
247 | lbl=lbl.substring(0,lbl.indexOf("[RH]"));
|
---|
248 | //System.out.println(node.getLabel()+"====>"+lbl);
|
---|
249 | if(this.isSubLung){
|
---|
250 | org_node = this.hzEditor.WCEditor.findNodeWithSubLang(lbl);
|
---|
251 | }
|
---|
252 | else{
|
---|
253 | org_node = this.hzEditor.findRH(lbl);
|
---|
254 | }
|
---|
255 | }
|
---|
256 | else{
|
---|
257 | if(this.isSubLung){
|
---|
258 | org_node = this.hzEditor.WCEditor.findNodeWithSubLang(lbl);
|
---|
259 | }
|
---|
260 | else{
|
---|
261 | org_node = this.hzEditor.findNode(lbl);
|
---|
262 | }
|
---|
263 | }
|
---|
264 | node.setOrgNode(org_node);
|
---|
265 | if(org_node!=null){
|
---|
266 | //System.out.println("setOrgNodes:::"+lbl+"<=>"+org_node.getLabel());
|
---|
267 | }else{
|
---|
268 | //System.out.println("setOrgNodes:::"+lbl+"<=>NOT FOUND!");
|
---|
269 | }
|
---|
270 | }
|
---|
271 | */
|
---|
272 | }
|
---|
273 |
|
---|
274 | //陷茨ソス竊堤クコ�ェ郢ァ霆恵ject邵コ荵晢ス宇ocalPoint邵コ�ィ邵コ�ェ郢ァ逡ソxbpNode郢ァ蜑�スス諛奇ス狗クイ鬟殪zo闔会ス・陞滓じ縲堤クコ�ッ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ荵晢ソス
|
---|
275 | ExbpNode[] setFocalPoints(){
|
---|
276 | // if (this.hzEditor==null) return null;
|
---|
277 |
|
---|
278 | ExbpNode[] exbpnodes = null;
|
---|
279 |
|
---|
280 | exbp.nodes.removeAllElements();
|
---|
281 |
|
---|
282 | // Vector<Node> chi_nodes;
|
---|
283 | // GraphicObject gobj=null;
|
---|
284 | // Object ob=null;
|
---|
285 |
|
---|
286 | if (focal_points.size() == 1) {//�ス莉」笆ス邵コ�ョNode郢ァ蟶昶�隰壽ァュ�邵コ貊�怙邵コ�ョ陷�スヲ騾�ソス |
---|
287 | Object gobj = focal_points.firstElement();
|
---|
288 | //gobj =(GraphicObject) focal_points.firstElement();
|
---|
289 |
|
---|
290 | if(gobj instanceof String){
|
---|
291 | exbp.exbp_node_center =new ExbpNode((String)gobj);
|
---|
292 | exbp.exbp_node_center.setOrgNode(gobj);
|
---|
293 | exbp.nodes.add(exbp.exbp_node_center);
|
---|
294 | exbpnodes = new ExbpNode[1];
|
---|
295 | exbpnodes[0]=exbp.exbp_node_center;
|
---|
296 | }
|
---|
297 | else if(gobj instanceof Object){
|
---|
298 | System.out.println("*** ERROR:Node郢ァ蟶昶�隰壽ァュ笘�ケァ蜿・�ソ�ス�ヲ竏壺イ邵コ繧�ス顔クコ�セ邵コ�ス:" );
|
---|
299 | }
|
---|
300 | else{//鬩包スク隰壽ァュ竊醍クコ蜉ア�ス陜」�エ陷キ蛹サ�ス�ス蠕後♀郢晢スゥ郢晢スシ郢ァ雋橸ソス邵コ蜉ア窶サ驍ィ繧�スコ�ス |
---|
301 |
|
---|
302 | JOptionPane.showMessageDialog(exbpframe,
|
---|
303 | "You Have to select [Node]!",
|
---|
304 | "ERROR",
|
---|
305 | JOptionPane.ERROR_MESSAGE);
|
---|
306 | System.out.println("ERROR:Node郢ァ蟶昶�隰壽ァュ笘�ケァ蜿・�ソ�ス�ヲ竏壺イ邵コ繧�ス顔クコ�セ邵コ�ス:" );
|
---|
307 | exbpframe.dispose();
|
---|
308 | }
|
---|
309 | }
|
---|
310 | else {//髫搾ソス辟哢ode郢ァ蟶昶�隰壽ァュ�邵コ貊�怙邵コ�ョ陷�スヲ騾�ソス
|
---|
311 | if(focal_points.size() > 1){
|
---|
312 | exbp.exbp_node_center = new ExbpNode("(ROOT)");
|
---|
313 | exbp.nodes.addElement(exbp.exbp_node_center);
|
---|
314 |
|
---|
315 | Vector chi_nodes = new Vector();
|
---|
316 | Enumeration node_en = focal_points.elements();
|
---|
317 | while(node_en.hasMoreElements()){
|
---|
318 | Object gobj2 = node_en.nextElement();
|
---|
319 | if(gobj2 instanceof String){
|
---|
320 | ExbpNode chinode = new ExbpNode((String)gobj2);
|
---|
321 | chinode.setOrgNode(gobj2);
|
---|
322 | exbp.exbp_node_center.addChild(chinode);
|
---|
323 | exbp.nodes.add(chinode);
|
---|
324 | }
|
---|
325 |
|
---|
326 | exbpnodes = new ExbpNode[exbp.exbp_node_center.children.size()];
|
---|
327 | for(int i=0;i<exbp.exbp_node_center.children.size();i++){
|
---|
328 | exbpnodes[i]=(ExbpNode)exbp.exbp_node_center.children.elementAt(i);
|
---|
329 | }
|
---|
330 | }
|
---|
331 | }
|
---|
332 | else{//Node郢ァ螳夲スヲ遏ゥ竏郁ャ壽ァュ�ス鬮ォ蟶呻ソス陷�スヲ騾�ソス |
---|
333 | JOptionPane.showMessageDialog(exbpframe,
|
---|
334 | "You Have to select [Node]!",
|
---|
335 | "ERROR",
|
---|
336 | JOptionPane.ERROR_MESSAGE);
|
---|
337 | System.out.println("ERROR:Node");
|
---|
338 | exbpframe.dispose();
|
---|
339 | }
|
---|
340 | }
|
---|
341 |
|
---|
342 | return exbpnodes;
|
---|
343 | }
|
---|
344 |
|
---|
345 | /*
|
---|
346 | //陷茨ソス竊堤クコ�ェ郢ァ霆恵ject邵コ荵晢ス右xbpNode郢ァ蜑�スス諛奇ス狗クイ鬟殪zo闔会ス・陞滓じ縲堤クコ�ッ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ荵晢ソス
|
---|
347 | ExbpNode makeExbpNode(Object obj){
|
---|
348 | if(!(obj instanceof String)){
|
---|
349 | //System.out.println("ERROR@makeChildNodes():obj is NOT Node!");
|
---|
350 | return null;
|
---|
351 | }
|
---|
352 |
|
---|
353 | Node node =(Node)obj;
|
---|
354 | ExbpNode exbpnode;
|
---|
355 |
|
---|
356 |
|
---|
357 | //#kozaki 2009/08/19邵イ�スlot邵コ�ョ陷�スヲ騾�ソス�帝恆�ス陷会ソス |
---|
358 | if(node instanceof hozo.oe.gobj.Slot){
|
---|
359 | if(!((Slot)node).getRHname().equals("")){
|
---|
360 | node = this.hzEditor.findRH(((Slot)node).getRHname());
|
---|
361 | }
|
---|
362 | else{
|
---|
363 |
|
---|
364 | }
|
---|
365 | }
|
---|
366 |
|
---|
367 | if(node instanceof hozo.oe.gobj.NodeRH){
|
---|
368 | if(this.isSubLung){
|
---|
369 | exbpnode= new ExbpNode(node.getSubLabel()+"[RH]");
|
---|
370 | }
|
---|
371 | else{
|
---|
372 | exbpnode= new ExbpNode(node.getLabel()+"[RH]");
|
---|
373 | }
|
---|
374 | }
|
---|
375 | else{
|
---|
376 | if(this.isSubLung){
|
---|
377 | exbpnode= new ExbpNode(node.getSubLabel());
|
---|
378 | }
|
---|
379 | else{
|
---|
380 | exbpnode= new ExbpNode(node.getLabel());
|
---|
381 | }
|
---|
382 | }
|
---|
383 |
|
---|
384 | exbpnode.setOrgNode(obj);
|
---|
385 | //exbp.nodes.add(exbpnode);
|
---|
386 |
|
---|
387 | return exbpnode;
|
---|
388 | }*/
|
---|
389 |
|
---|
390 |
|
---|
391 | //�ス莉」笆ス邵コ�ョExbpNode邵コ�ォ郢ァ�ウ郢晄ァュホヲ郢晏ウィ�帝ゥ包スゥ陟「諛奇シ邵コ�ヲ闕ウ蛟カ�ス蟄肺bpNode郢ァ螳夲スソ�ス陷会ソス笘�ケァ荵晢ソスHozo闔会ス・陞滓じ縲堤クコ�ョ郢ァ�ェ郢晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ�ス陟「�ス�ヲ竏壺�邵コ蜉ア�ス
|
---|
392 | //邵イ�ス縺慕ケ晄ァュホヲ郢晉判�ッ蠑ア竊鍋ケ晢ス。郢ァ�ス郢晢ソス繝ゥ郢ァ蛛オ縺檎ケ晢スシ郢晁��ス郢晢スゥ郢ァ�、郢晏ウィ笘�ケァ�ス |
---|
393 | void makeChildNodes(ExbpNode exbpnode, String command){
|
---|
394 | /* if(!(exbpnode.getOrgNode() instanceof Node)){
|
---|
395 | //System.out.println("ERROR@makeChildNodes():orgnode is NOT Node!");
|
---|
396 | return;
|
---|
397 | }
|
---|
398 |
|
---|
399 | // exbpnode.children.removeAllElements();
|
---|
400 | // System.out.println("makeChildNodes():::command="+command);
|
---|
401 | removeAllChildren(exbpnode);
|
---|
402 |
|
---|
403 |
|
---|
404 | if(command.equals("isa")){ // ?邵イ�ス�ク蛟カ�ス閧エ�ヲ繧�スソ�オ邵コ�ョ隰夲スス陷�スコ is-a
|
---|
405 | makeChildNodeISA(exbpnode);
|
---|
406 | }
|
---|
407 | else if(command.equals("super")){// ?闕ウ雍具スス閧エ�ヲ繧�スソ�オ邵コ�ョ隰夲スス陷�スコ
|
---|
408 | makeChildNodeSuper(exbpnode);
|
---|
409 | }
|
---|
410 | else if(command.startsWith(":")){// 陷ソ繧会ソス陷茨ソス�ス隰夲スス陷�スコ邵イ�スefereed to
|
---|
411 | makeChildNodeRefered(exbpnode,command);
|
---|
412 | }
|
---|
413 | // #hirota 08/08/19 郢ァ�ウ郢晄ァュホヲ郢晁��オ莉咏イ� |
---|
414 | else if(command.startsWith(";")){ // (old)郢晢スュ郢晢スシ郢晢スォ隰厄ソス�ョ螢ケ竕郢ァ鄙ォ�ス�ス荵晢ソス闕ウ蛟カ�ス閧エ�ヲ繧�スソ�オ隰厄ソス�ョ螢ケ竕郢ァ�ス |
---|
415 | makeChildNodeRoleSub(exbpnode,command);
|
---|
416 | }
|
---|
417 | else if(command.equals("any-h")){ // ? depend-on 遶奇ソス #hirota 11/26 霑エ�セ陜ィ�ィ邵コ�ョ髫穂ケ溘○邵コ蜷孃de邵コ�ョ邵コ�ィ邵コ髦ェ�スNode邵コ�ョ郢ァ�ケ郢晢スュ郢晢ソス繝ィ邵コ�ョRH郢ァ螳夲ス。�ィ驕会スコ
|
---|
418 | makeChildNodeDependOnRH(exbpnode,command);
|
---|
419 | }
|
---|
420 | else if(command.equals("++s")){// ?邵イ�スepend on 邵イ�ス�ス郢ァ�ウ郢晢スウ郢晢ソス縺冗ケァ�ケ郢晏現�定愾謔カ�願怎�コ邵コ�ス |
---|
421 | makeChildNodeDependOnContext(exbpnode,command);
|
---|
422 | }
|
---|
423 | else if(command.equals("++P")){// playable 鬮「�「闖ォ�ス?邵イ�ス�ス all
|
---|
424 | makeChildNodePlayable(exbpnode);
|
---|
425 | }
|
---|
426 | else if(command.startsWith("++p")){// playable 鬮「�「闖ォ�ス?邵イ�ス�ス label 隰厄ソス�ョ�ス |
---|
427 | makeChildNodePlayableByLabel(exbpnode, command);
|
---|
428 | }
|
---|
429 | else if(command.equals("++c")){ // ?邵イ�スlayable 遶奇ソス郢晏干ホ樒ケァ�、郢晢ス、郢晢スシ邵コ�ョ陷ソ謔カ�願怎�コ邵コ�ス |
---|
430 | makeChildNodePlayer(exbpnode);
|
---|
431 | }
|
---|
432 | else if(command.startsWith("++r:")){// ?鬮「�「闖ォ繧茨スヲ繧�スソ�オ邵コ�ョ陷ソ謔カ�願怎�コ邵コ�ス ++r:Lable
|
---|
433 | makeChildNodeRelationConcept(exbpnode,command);
|
---|
434 | }
|
---|
435 | else if(command.equals("++R")){ // ++R 陷茨スィ鬩幢スィ陷ソ謔カ�願怎�コ邵コ�ス |
---|
436 | makeChildNodeRelationAll(exbpnode);
|
---|
437 | }
|
---|
438 | else if(command.startsWith("super_isa")){ // #hirota 08/09/03 陷茨ソス�シ貊難スヲ繧�スソ�オ邵コ�ョ陷ソ謔カ�願怎�コ邵コ�スsuper+isa)
|
---|
439 | makeChildNodeBrothers(exbpnode);
|
---|
440 | }
|
---|
441 | else if(command.startsWith("_")){// 郢ァ�ッ郢晢スゥ郢ァ�ケ陋サ�カ驍擾ソス�帝恷�ソ郢ァ蜿・�ス騾�ソス�スonly RH
|
---|
442 | makeChildNodeCConlyRH(exbpnode,command);
|
---|
443 | }
|
---|
444 | else{
|
---|
445 | makeChildNodeReferringTo(exbpnode,command);// 郢ァ�ッ郢晢スゥ郢ァ�ケ陋サ�カ驍擾ソス�帝恷�ソ郢ァ蜿・�ス騾�ソス |
---|
446 | }
|
---|
447 | */
|
---|
448 | }
|
---|
449 |
|
---|
450 | public void run(){
|
---|
451 | //SerachPath(target_nodes,target_cls);
|
---|
452 | }
|
---|
453 |
|
---|
454 | public void stop(){
|
---|
455 | // pbar_frame.stop();
|
---|
456 | // pbar_frame=null;
|
---|
457 | }
|
---|
458 |
|
---|
459 | ExbpNode[] target_nodes;
|
---|
460 | // Node[] target_cls;
|
---|
461 | int[] match_num;
|
---|
462 | // ProgressFrame pbar_frame;
|
---|
463 |
|
---|
464 | /*
|
---|
465 | public void SearchPathAsThread(ExbpNode[] nodes, Node[] cls){
|
---|
466 | pbar_frame = new ProgressFrame("Serach Path","Now,Searching..., Please wait.");
|
---|
467 | pbar_frame.frame.setAlwaysOnTop(true);
|
---|
468 | pbar_frame.frame.setLocation(exbp.cmd_dialog.getWidth(),100);
|
---|
469 |
|
---|
470 |
|
---|
471 | target_nodes = nodes;
|
---|
472 | target_cls =cls;
|
---|
473 | match_num = new int[cls.length];
|
---|
474 | for(int i=0;i<match_num.length;i++){
|
---|
475 | match_num[i]=0;
|
---|
476 | }
|
---|
477 |
|
---|
478 | Thread thread = new Thread(this);
|
---|
479 | thread.start();
|
---|
480 |
|
---|
481 |
|
---|
482 | }*/
|
---|
483 | /*
|
---|
484 |
|
---|
485 | void checkMatchCount(){
|
---|
486 | match_num = new int[target_cls.length];
|
---|
487 | for(int i=0;i<match_num.length;i++){
|
---|
488 | match_num[i]=0;
|
---|
489 | }
|
---|
490 |
|
---|
491 | Enumeration en = this.exbp.nodes.elements();
|
---|
492 | while(en.hasMoreElements()){
|
---|
493 | ExbpNode node = (ExbpNode)en.nextElement();
|
---|
494 | Object obj = node.getOrgNode();
|
---|
495 | if(obj instanceof Node){
|
---|
496 | Node hozonode=(Node)obj;
|
---|
497 | for(int i=0;i<target_cls.length;i++){
|
---|
498 | if(target_cls[i] instanceof Node){
|
---|
499 | if(hozonode.isSubclassOf((Node)target_cls[i])
|
---|
500 | || hozonode.equals(target_cls[i])){
|
---|
501 | match_num[i]++;
|
---|
502 | }
|
---|
503 | }
|
---|
504 | }
|
---|
505 | }
|
---|
506 | }
|
---|
507 |
|
---|
508 | for(int i=0;i<target_cls.length;i++){
|
---|
509 | System.out.println(
|
---|
510 | target_cls[i].getLabel()+" = "+
|
---|
511 | match_num[i]);
|
---|
512 | }
|
---|
513 | }
|
---|
514 | */
|
---|
515 |
|
---|
516 | //#kozaki邵イ�ス009/02/13邵イ�ス�ッ�セ髮趣ス。郢晏シア�ス郢晏ウィ�帝嚶�ス辟夂クコ�ォ隲。�。陟托スオ
|
---|
517 | // public void SerachPath(ExbpNode[] nodes, Node[] target_cls/*String[] cls_lists*/){}
|
---|
518 |
|
---|
519 | // private Vector<ExbpNode> SerachPath(Vector<ExbpNode> nodes,
|
---|
520 | // Node[] cls_lists,Vector<ExbpNode> match_nodes){}
|
---|
521 |
|
---|
522 | void removeAllChildren(ExbpNode exbpnode){
|
---|
523 | this.exbp.nodes.removeAll(exbpnode.children);
|
---|
524 | exbpnode.children.removeAllElements();
|
---|
525 | }
|
---|
526 |
|
---|
527 | //隹コ�。邵コ�ォ邵コ貅倪�郢ァ荵昴Π郢晢スシ郢晏ウィ�ス郢晢スェ郢ァ�ケ郢晏現�定愾髢�セ蜉ア笘�ケァ�ス |
---|
528 | //遯カ�サ闕ウ�ス�コ�ヲ邵コ貅倪�邵コ�」邵コ貅假シ�クコ�ィ邵コ�ョ邵コ繧�ス狗ケ晢ソス�ス郢ァ�ソ邵コ�ッ�ス闕各mp_nodes邵コ�ォ闖ォ譎�亜邵コ霈費ス鯉ソス蠕娯落邵コ�。郢ァ蟲ィ�帝恆譁絶�
|
---|
529 | // Vector<ExbpNode> getChildNodeFromTemp(ExbpNode exbpnode, String cmd){}
|
---|
530 |
|
---|
531 |
|
---|
532 | void explore(ExbpNode exbpnode, boolean all, String cmd){
|
---|
533 | /* ExbpNode[] exbpnodes=new ExbpNode[1];
|
---|
534 |
|
---|
535 | if(!all){
|
---|
536 | exbpnodes=new ExbpNode[1];
|
---|
537 | exbpnodes[0]=exbpnode;
|
---|
538 | }
|
---|
539 | else{
|
---|
540 | int layer = exbpnode.getLocatedLayer();
|
---|
541 | exbpnodes=exbp.getExbpNodesAtLear(layer,true);
|
---|
542 | }
|
---|
543 |
|
---|
544 | for(int l=0;l<exbpnodes.length;l++){
|
---|
545 | if(exbpnodes[l].visible){
|
---|
546 | this.makeChildNodeReferringToDirectly(exbpnodes[l], cmd);
|
---|
547 | this.makeChildNodeRefered(exbpnodes[l], ":Any");
|
---|
548 |
|
---|
549 | //exbpnodes[l].children.removeAllElements();
|
---|
550 | // Vector temp_children = getChildNodeFromTemp(exbpnodes[l],cmd);
|
---|
551 | // Enumeration en = temp_children.elements();
|
---|
552 | // while(en.hasMoreElements()){
|
---|
553 | // ExbpNode chi = (ExbpNode)en.nextElement();
|
---|
554 | // exbpnodes[l].addChild(chi);
|
---|
555 | // chi.setVisible(true);
|
---|
556 | // }
|
---|
557 | }
|
---|
558 | }*/
|
---|
559 |
|
---|
560 | }
|
---|
561 |
|
---|
562 | void clearSubPath(ExbpNode exbpnode){
|
---|
563 | ExbpNode[] exbpnodes=new ExbpNode[1];
|
---|
564 |
|
---|
565 | int layer = exbpnode.getLocatedLayer();
|
---|
566 | exbpnodes=exbp.getExbpNodesAtLear(layer,true);
|
---|
567 |
|
---|
568 |
|
---|
569 | for(int l=0;l<exbpnodes.length;l++){
|
---|
570 | if(exbpnodes[l].visible){
|
---|
571 | this.removeAllChildren(exbpnodes[l]);
|
---|
572 | }
|
---|
573 | }
|
---|
574 |
|
---|
575 | }
|
---|
576 |
|
---|
577 |
|
---|
578 | //陷キ�ス縺慕ケ晄ァュホヲ郢晏ウィ�帝ゥ包スゥ騾包スィ邵コ蜉ア笳�クコ�ィ邵コ髦ェ竊鍋クコ貅倪�郢ァ荵昴Π郢晢スシ郢晏ウィ�堤クコ蜉ア�臥クコ�ケ邵コ�ヲ�ス蜊ヲree邵コ�ョ郢ァ�ウ郢晄ァュホヲ郢晏ウィホ懃ケァ�ケ郢晏現竊楢怦�・郢ァ蠕鯉ス具ソス�ス |
---|
579 | // void setCommandsTree(ExbpNode[] exbpnodes){}
|
---|
580 |
|
---|
581 | public void makeChildNodeSuper(ExbpNode exbpnode) {}
|
---|
582 |
|
---|
583 |
|
---|
584 | private void makeSlotRelatedExbpNode(ExbpNode exbpnode, String command) {}
|
---|
585 |
|
---|
586 | // #kozaki 2008/08/17邵イ�ス縺帷ケ晢スュ郢晢ソス繝ィ邵コ�ァ鬮「�「鬨セ�」邵コ蜉ア笳�ョ弱g�ソ�オ郢ァ螳夲スセ�ソ郢ァ蜿・�ス騾�ソス竏育クコ�ョ陋サ�ス�イ�ス |
---|
587 | // private void makeSlotRelatedExbpNode(ExbpNode par_exbpnode, Node node, String command){}
|
---|
588 |
|
---|
589 |
|
---|
590 | //#kozaki 2008/08/12邵イ�ス縺醍ケ晢スゥ郢ァ�ケ陋サ�カ驍擾ソス�帝恷�ソ郢ァ蜿・�ス騾�ソス�定ソ「�ャ驕カ�ス |
---|
591 | // private void makeExbpNodeCC(ExbpNode par_exbpnode, //髫包スェ邵コ�ィ邵コ�ェ郢ァ逡ソxbpNode
|
---|
592 | // Slot slot, //髴趣スソ郢ァ蜿・�ッ�セ髮趣ス。邵コ�ィ邵コ�ェ郢ァ荵昴○郢晢スュ郢晢ソス繝ィ
|
---|
593 | // Node slot_node, //郢ァ�ッ郢晢スゥ郢ァ�ケ陋サ�カ驍擾ソス竊堤クコ蜉ア窶サ陷ソ繧会ソス邵コ蜉ア窶サ邵コ�ス�狗ケ晏シア�ス郢晢ソス |
---|
594 | // Node node, //髴趣スソ郢ァ荵昴○郢晢スュ郢晢ソス繝ィ郢ァ蜻域亜邵コ�、郢晏シア�ス郢晢ソス |
---|
595 | // String command, //髴趣スソ郢ァ荵昴&郢晄ァュホヲ郢晢ソス |
---|
596 | // String match_key //闕ウ�ス�ス邵コ蜉ア笳�ケァ�ウ郢晄ァュホヲ郢昜シ夲スシ莠包スク雍具スス髦ェ縺帷ケ晢スュ郢晢ソス繝ィ邵コ�ョ陷�スヲ騾�ソス逡托ソス�ス |
---|
597 | // ){}
|
---|
598 |
|
---|
599 | // public void makeChildNodeISA(ExbpNode exbpnode){}
|
---|
600 |
|
---|
601 |
|
---|
602 | // ?
|
---|
603 | // private void makeChildNodeRefered(ExbpNode exbpnode, String command) {}
|
---|
604 |
|
---|
605 | // ?遯カ�ス(old)郢晢スュ郢晢スシ郢晢スォ隰厄ソス�ョ螢ケ竕郢ァ鄙ォ�ス�ス荵晢ソス闕ウ蛟カ�ス閧エ�ヲ繧�スソ�オ隰厄ソス�ョ螢ケ竕郢ァ�ス |
---|
606 | // public void makeChildNodeRoleSub(ExbpNode exbpnode,String command) {}
|
---|
607 |
|
---|
608 | // ? depend-on 遶奇ソス #hirota 11/26 霑エ�セ陜ィ�ィ邵コ�ョ髫穂ケ溘○邵コ蜷孃de邵コ�ョ邵コ�ィ邵コ髦ェ�スNode邵コ�ョ郢ァ�ケ郢晢スュ郢晢ソス繝ィ邵コ�ョRH郢ァ螳夲ス。�ィ驕会スコ
|
---|
609 | // public void makeChildNodeDependOnRH(ExbpNode exbpnode,String NodeCC) {}
|
---|
610 |
|
---|
611 |
|
---|
612 |
|
---|
613 | // ?邵イ�スepend on 邵イ�ス�ス郢ァ�ウ郢晢スウ郢晢ソス縺冗ケァ�ケ郢晏現�定愾謔カ�願怎�コ邵コ�ス#hirota add 09/11/09
|
---|
614 | // public void makeChildNodeDependOnContext(ExbpNode exbpnode,String command) {}
|
---|
615 |
|
---|
616 | // playable 鬮「�「闖ォ�ス?邵イ�ス�ス all
|
---|
617 | // public void makeChildNodePlayable(ExbpNode exbpnode) {}
|
---|
618 |
|
---|
619 | // playable 鬮「�「闖ォ�ス?邵イ�ス�ス label 隰厄ソス�ョ�ス |
---|
620 | // private void makeChildNodePlayableByLabel(ExbpNode exbpnode,String command) {}
|
---|
621 |
|
---|
622 | // ?邵イ�スlayable 遶奇ソス郢晏干ホ樒ケァ�、郢晢ス、郢晢スシ邵コ�ョ陷ソ謔カ�願怎�コ邵コ�ス |
---|
623 | // public void makeChildNodePlayer(ExbpNode exbpnode) {}
|
---|
624 | // private void makeChildNodeRelationConcept(ExbpNode exbpnode,String command) {}
|
---|
625 |
|
---|
626 | // ++R 陷茨スィ鬩幢スィ陷ソ謔カ�願怎�コ邵コ�ス驍ッ蜻惹セ。郢ァ�ェ郢晏干縺咏ケ晢スァ郢晢スウ邵コ繧�ス顔クコ�ョ邵コ�ィ邵コ謳セ�シ�ス |
---|
627 | // public void makeChildNodeRelationAllToDirectry(ExbpNode exbpnode) {}
|
---|
628 | // ++R 陷茨スィ鬩幢スィ陷ソ謔カ�願怎�コ邵コ�ス |
---|
629 | // public void makeChildNodeRelationAll(ExbpNode exbpnode) {}
|
---|
630 |
|
---|
631 | // #hirota 08/09/03 陷茨ソス�シ貊難スヲ繧�スソ�オ邵コ�ョ陷ソ謔カ�願怎�コ邵コ�スsuper+isa)
|
---|
632 | // private void makeChildNodeBrothers(ExbpNode exbpnode) {}
|
---|
633 |
|
---|
634 | // 郢ァ�ッ郢晢スゥ郢ァ�ケ陋サ�カ驍擾ソス�帝恷�ソ郢ァ蜿・�ス騾�ソス�スonly RH
|
---|
635 | // private void makeChildNodeCConlyRH(ExbpNode exbpnode,String command) {}
|
---|
636 |
|
---|
637 | // 郢ァ�ッ郢晢スゥ郢ァ�ケ陋サ�カ驍擾ソス�帝恷�ソ郢ァ蜿・�ス騾�ソス�ス
|
---|
638 | // private void makeChildNodeReferringTo(ExbpNode exbpnode,String command) {}
|
---|
639 |
|
---|
640 | // 郢ァ�ッ郢晢スゥ郢ァ�ケ陋サ�カ驍擾ソス�帝恷�ソ郢ァ蜿・�ス騾�ソス�ス郢ァ�オ郢晄じ縺帷ケ晢スュ郢晢ソス繝ィ郢ァ雋樊ァ邵コ�セ邵コ�ェ邵コ�ス�ス#kozaki邵イ�ス009/08/19
|
---|
641 | // private void makeChildNodeReferringToDirectly(ExbpNode exbpnode,String command) {}
|
---|
642 |
|
---|
643 |
|
---|
644 | // String[] getOtionLists(Vector<ExbpNode> exbpnodes){}
|
---|
645 |
|
---|
646 |
|
---|
647 | /* public String[] getSelectedClass(String[] labels){
|
---|
648 | TreeSelectDialog treeSelectDialog = new TreeSelectDialog(true);
|
---|
649 | treeSelectDialog.setHZEditor(this.hzEditor);
|
---|
650 | treeSelectDialog.setSubLang(this.isSubLung);
|
---|
651 | treeSelectDialog.updateTree();
|
---|
652 | //treeSelectDialog.setSize(320, 450);
|
---|
653 | if(labels.length>0){
|
---|
654 | String label = labels[0];
|
---|
655 | for(int i=1;i<labels.length;i++){
|
---|
656 | label +=" "+"\\" + Slot.OR_DELIMITER+" "+labels[i];
|
---|
657 | }
|
---|
658 | treeSelectDialog.setSelectedTreeDialog(labels, label);
|
---|
659 | }
|
---|
660 | treeSelectDialog.setVisible(true);
|
---|
661 | if (treeSelectDialog.isOK()) {
|
---|
662 | String[] cls_lists = treeSelectDialog.getSelectedHozoNodesByLabel();
|
---|
663 | // String opt = treeSelectDialog.getSelected();
|
---|
664 | // if(opt==null){
|
---|
665 | // opt="Any";
|
---|
666 | // }
|
---|
667 | // String[] cls_lists = opt.split(" "+"\\" + Slot.OR_DELIMITER+" ");
|
---|
668 | return cls_lists;
|
---|
669 | }
|
---|
670 | return null;
|
---|
671 | }*/
|
---|
672 |
|
---|
673 | // public Object[] getSelectedClasses(String target_cls){}
|
---|
674 |
|
---|
675 | // public Node[] getSelectedClassesAsNode(String target_cls){}
|
---|
676 |
|
---|
677 | // public Node getHozoNode(String lbl){}
|
---|
678 |
|
---|
679 | // public boolean isSubClassOfSelectedClasses(Object node, Object[] target_classes){}
|
---|
680 |
|
---|
681 | // public boolean isSubClass(Object node, Object target){}
|
---|
682 |
|
---|
683 | //#kozaki 2009/02/13邵イ�スode[]郢ァ諡�ring[]邵コ�ォ陞溽判驪、
|
---|
684 | // public String[] NodesToStrings(Node[] nodes){}
|
---|
685 |
|
---|
686 | //#kozaki 2009/02/13邵イ�ス縺醍ケ晢スゥ郢ァ�ケ闕ウ�ス�ヲ�ァ郢ァ隱ーode[]邵コ�ァ陷ソ髢�セ�ス |
---|
687 | // public Node[] getSelectedClassNodes(Node[] nodes){}
|
---|
688 |
|
---|
689 | //#hirota 2009/05/18邵イ�ス譛ェ闖ォ繧茨スヲ繧�スソ�オ闕ウ�ス�ヲ�ァ郢ァ隱ーode[]邵コ�ァ陷ソ髢�セ�ス |
---|
690 | // public Node[] getSelectedClassNodes2(Node[] nodes){
|
---|
691 | // return null;
|
---|
692 | // }
|
---|
693 |
|
---|
694 | //#kozaki 09/02/15
|
---|
695 | // public void setSubLang(boolean b){}
|
---|
696 |
|
---|
697 | }
|
---|
698 |
|
---|
699 |
|
---|