package hozo.maptool; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridBagLayout; import java.awt.List; import java.awt.Point; import java.awt.Rectangle; import java.util.ArrayList; import java.util.Enumeration; import java.util.StringTokenizer; import java.util.Vector; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.border.*; import org.biohackathon.SPARQLBuilder.OWL.Path; import java.awt.*; import java.awt.event.*; import java.awt.Toolkit; import java.io.*; import java.util.Iterator; //import hozo.oe.util.*; class Edge { ExbpNode from; ExbpNode to; double len; // String key = ""; // // boolean isVisible=true; } public class ExtendBP extends JPanel implements Runnable{ private static final long serialVersionUID = 1L; ExbpNode exbp_node_center; //���S�́iRoot�́jE������Node ExbpNode exbp_node_pick; // @jve:decl-index=0: Vector nodes; // @jve:decl-index=0: ArrayList topicColorList = new ArrayList(10); // HZEditor _hzeditor; ExtendFrame _extendFrame; //#kozaki 2008/07/31 // ExtendBPPopupMenu _popupMenu; private int currentLayerNum = 6; private int currentLayerLength = 80; private boolean isVisibleCenter = true; private boolean isVisibleInflu = true; private boolean isVisibleLink = true; //#kozaki�@2008/06/14�@�f�t�H���g��Link��\������悤�ɕύX private boolean isVisibleLevel = false; private boolean isVisibleBorder = true; public boolean skip_repetition = true;//#kozaki�@2009/11/30�@�J��Ԃ��� private static int WIDTH_MARGIN = 80; private static int HEIGHT_MARGIN = 50; private static int FONT_MARGIN = 10; private int layoutOption = 0; public static int LinkCentricLayout = 0; public static int NodeCentricLayout = 1; public static int LinkCentricLayout2= 2; protected static final String DEFAULT_NAME = "(ROOT)"; public static Font fontLink = new Font("Times", Font.PLAIN, 12); Font fontBorder = new Font("Times", Font.BOLD, 18); private static String DASH_PATURN = "0.0f, 5.0f, 5.0f, 0.0f"; public String command; //#kozaki�@2008/10/03�@�R�}���h��String�ŕێ����� public String[] optionList = new String[4]; //#kozaki 2008/10/19�@�g���Ă��Ȃ��̂ō폜 //public Vector tempGobjList = new Vector(20); // �I�������I�u�W�F�N�g���i�[����R���N�V���� Vector role_lists = new Vector(10); //#kozaki 2008/01/02�@�e�w�ł̃��[���̎�ފi�[ RoleLists link_list = new RoleLists(); //#kozaki 2008/03/22 �T�u���ꏈ���p�̕ϐ� // static boolean isSubLung = false; // private int scale; // �`��{�� private JFrame _ownerFrame = null; // �����t���[�� //#kozaki�@�o�l���f���p private Thread relaxer; // private boolean random; public boolean stop = true; public boolean stopOnLayer = true; public boolean showEdges = false; Vector edges = new Vector(); public MapFactory mapfactory; // public MapCommandDialog cmd_dialog; // ChangeViewFrame changeView; // public ArrayList> hilight_nodes=new ArrayList>(); static Color[] hilight_color = { Color.red, Color.blue, Color.green, Color.cyan, Color.magenta, new Color(153,0,153) /* Color.orange/*, Color.pink, //#kozaki�@2008/08/18�@���Ԃ�ύX Color.yellow, new Color(255,102,255), // Color.magenta, //#kozaki�@2008/08/18�@���Ԃ�ύX Color.lightGray, new Color(255,51,102),// // new Color(50,155,255), // // Color.gray*/ }; static String[] hilight_color_str = { "red","blue","green","aqua","fuchsia","purple"}; /** * This is the default constructor */ public ExtendBP(MapFactory fac) { super(); mapfactory = fac; ExbpNode exbpnode= new ExbpNode("Center");; this.exbp_node_center = exbpnode; // exbpnode = new ExbpNode("TEST"); // exbpnode= new ExbpNode("Center");; // exbpnode.setChildrenColor(Color.red); // exbpnode.key="prop1"; // this.exbp_node_center.addChild(exbpnode); // this.exbp_node_center.addChild(new ExbpNode("TEST2")); // this.exbp_node_center.addChild(new ExbpNode("TEST3")); // this.exbp_node_center.addChild(new ExbpNode("TEST4")); // cmd_dialog = new MapCommandDialog(this); // _popupMenu = new ExtendBPPopupMenu(this, null); // // new MapCommandEasy(this); initialize(); } /* public ExtendBP(JFrame owner) { this(); initialize(); this._ownerFrame = owner; }*/ // #hirota 08/10/21 public MapFactory getMapFactory(){ return this.mapfactory; } public void setcenternode(ExbpNode center){ this.exbp_node_center = center; } public int getlength(ExbpNode from, ExbpNode to){ return (int)Math.abs(Math.sqrt((from.getCenterPoint().x-to.getCenterPoint().x)*(from.getCenterPoint().x-to.getCenterPoint().x) + (from.getCenterPoint().y-to.getCenterPoint().y)*(from.getCenterPoint().y-to.getCenterPoint().y)) ); } void addEdge(ExbpNode from, ExbpNode to, int len, boolean isv) { Edge e = new Edge(); e.from = from; e.to = to; e.len = len; // e.key = from.exbpnode.key; // e.isVisible = isv; // if(e.key.equals("")){ // e.key = "is_a"; // } // edges.addElement(e); } public void start() { relaxer = new Thread(this); relaxer.start(); } public void stop() { relaxer = null; } public void run() { Thread me = Thread.currentThread(); while (relaxer == me) { relax(); // if (random && (Math.random() < 0.03)) { // Node1 n = nodes[(int)(Math.random() * nnodes)]; // // if (!n.fixed) { // n.x += 100*Math.random() - 50; // n.y += 100*Math.random() - 50; // } // } try { Thread.sleep(100); } catch (InterruptedException e) { break; } } } synchronized void relax() { //#kozaki int cx = this.exbp_node_center.getCenterPoint().x; int cy = this.exbp_node_center.getCenterPoint().y; if( stop ){ } else{ // #hirota 8/1 int sikii = 0; Enumeration en_edges = this.edges.elements(); while(en_edges.hasMoreElements()){ //for (int i = 0 ; i < nedges ; i++) { Edge e = en_edges.nextElement(); //Edge e = edges[i]; double vx = e.to.getCenterPoint().x - e.from.getCenterPoint().x; double vy = e.to.getCenterPoint().y - e.from.getCenterPoint().y; double len = Math.sqrt(vx * vx + vy * vy); len = (len == 0) ? .0001 : len; double f = (e.len - len) / (len * 3); double dx = f * vx; double dy = f * vy; e.to.dx += dx; e.to.dy += dy; e.from.dx += -dx; e.from.dy += -dy; } Enumeration en = this.nodes.elements(); while(en.hasMoreElements()){ //for (int i = 0 ; i < nnodes ; i++) { ExbpNode n1 = en.nextElement(); if(this.exbp_node_center.equals(n1)){ continue; } //Node1 n1 = nodes[i]; double dx = 0; double dy = 0; Enumeration en2 = this.nodes.elements(); while(en2.hasMoreElements()){ //for (int j = 0 ; j < nnodes ; j++) { ExbpNode n2 = en2.nextElement(); //if (i == j) { if (n1.equals(n2)) { continue; } //Node1 n2 = nodes[j]; double vx = n1.getCenterPoint().x - n2.getCenterPoint().x; double vy = n1.getCenterPoint().y - n2.getCenterPoint().y; double len = vx * vx + vy * vy; if (len == 0) { dx += Math.random(); dy += Math.random(); } else if (len < 100*100) { dx += vx / len; dy += vy / len; } } double dlen = dx * dx + dy * dy; if (dlen > 0) { dlen = Math.sqrt(dlen) / 2; n1.dx += dx / dlen; n1.dy += dy / dlen; } } Dimension d = getSize(); Enumeration en3 = this.nodes.elements(); while(en3.hasMoreElements()){ //for (int i = 0 ; i < nnodes ; i++) { //Node1 n = nodes[i]; ExbpNode n = en3.nextElement(); int layer = n.getLocatedLayer(); if(this.exbp_node_center.equals(n)){ continue; } // stop���Ă��Ȃ��Ƃ� if(! n.n_stop ){ if (!n.fixed) { n.x += Math.max(-5, Math.min(5, n.dx)); n.y += Math.max(-5, Math.min(5, n.dy)); } if (n.x < 0) { n.x = 0; } else if (n.x > d.width) { n.x = d.width; } if (n.y < 0) { n.y = 0; } else if (n.y > d.height) { n.y = d.height; } n.dx /= 2; n.dy /= 2; // #hirota 08/8/1 // ���a�v�Z // 臒l�������ꂽ�Ƃ� length_of_layer if(stopOnLayer){ // double rx = ( this.graph.cx - n.x ); // double ry = ( this.graph.cy - n.y ); //double rx = ( n.x - this.graph.cx); //double ry = ( n.y - this.graph.cy); double rx = ( n.getCenterPoint().x - cx); double ry = ( n.getCenterPoint().y - cy); if( Math.abs( (Math.sqrt( rx*rx + ry*ry) - (layer*currentLayerLength)) ) > sikii ){ //System.out.println( "layer :" + n.layer + " label ::" + n.lbl + " r:" + (int)(Math.sqrt( n.x*n.x + n.y*n.y)) ); //n.n_stop = true; // #hirota 8/7 test // �p�x�̍������Ƃ� //double theta = Math.atan2(rx, ry); // double theta = Math.atan2(rx, ry); double theta = Math.atan2(ry, rx); // �œK(x,y)������ double ddx = (layer*currentLayerLength)*Math.cos(theta); double ddy = (layer*currentLayerLength)*Math.sin(theta); //System.out.println(" node : ddx ddy :" + n.lbl + ddx + ", "+ddy); //n.x= this.graph.cx + ddx; //n.y= this.graph.cy + ddy; n.x= cx + (new Double(ddx)).intValue() -n.width/2; n.y= cy + (new Double(ddy)).intValue() -n.height/2; } } } // stop���Ă���Ƃ� else{ // #hirota 08/8/1 //double rx = Math.abs( this.graph.cx - n.x ); //double ry = Math.abs( this.graph.cy - n.y ); double rx = Math.abs( cx - n.getCenterPoint().x ); double ry = Math.abs( cy - n.getCenterPoint().y ); if( Math.abs( (Math.sqrt( rx*rx + ry*ry) - (layer*currentLayerLength) ) )<= sikii ){ n.n_stop = false; } } } repaint(); } } //#kozaki�@2008/06/26�@���C�A�E�g�ݒ� public void setLayoutOption(int layout){ this.layoutOption = layout; } // public ExtendBP(HZEditor hze) { // super(); // initialize(); // //ExbpNode.setColors(); // this.setHZEditor(hze); // } // #kozaki 2007/10/28�@ExbpNode�ւ�path�𒲂ׂ� // #hirota 09/11/19 path��vector�ŕԂ� public Vector getPath2(ExbpNode node){ System.out.println(node.getPath()); Vector path = new Vector();//String path="";//"["+node.getLabel()+"]"; Vector nodes = new Vector(); for(ExbpNode n = node ; n.parent!=null ; n=n.parent ) { nodes.insertElementAt(n,0); //path="["+n.parent.getLabel()+"]"+ "\n-"+ n.key +"->"+path; } ExbpNode n =nodes.firstElement(); path.add(this.exbp_node_center); //path +="["+this.exbp_node_center.getLabel()+"]\n"; //Root Enumeration en = nodes.elements(); while(en.hasMoreElements()){ n =en.nextElement(); path.add(n); if(n.opt.equals("")){ n.opt="isa"; } //#kozaki 2009/01/20�@����lj� if(n.opt.startsWith(":!")){ //path +="("+n.opt+")->"+n.key+"<- ["+ n.getLabel()+"]\n"; } else if(n.opt.startsWith(":")){ //path +="("+n.opt+")<-"+n.key+"-- ["+ n.getLabel()+"]\n"; } else{ //path +="("+n.opt+")--"+n.key+"-> ["+ n.getLabel()+"]\n"; } } return path; } //#kozaki 2007/10/28�@ExbpNode�ւ�path�𒲂ׂ� public String getPath(ExbpNode node){ System.out.println(node.getPath()); String path="";//"["+node.getLabel()+"]"; Vector nodes = new Vector(); for(ExbpNode n = node ; n.parent!=null ; n=n.parent ) { nodes.insertElementAt(n,0); //path="["+n.parent.getLabel()+"]"+ "\n-"+ n.key +"->"+path; } ExbpNode n =nodes.firstElement(); path +="["+this.exbp_node_center.getLabel()+"]\n"; //Root Enumeration en = nodes.elements(); while(en.hasMoreElements()){ n =en.nextElement(); if(n.opt.equals("")){ n.opt="isa"; } //#kozaki 2009/01/20�@����lj� if(n.opt.startsWith(":!")){ path +="("+n.opt+")->"+n.key+"<- ["+ n.getLabel()+"]\n"; } else if(n.opt.startsWith(":")){ path +="("+n.opt+")<-"+n.key+"-- ["+ n.getLabel()+"]\n"; } else{ path +="("+n.opt+")--"+n.key+"-> ["+ n.getLabel()+"]\n"; } } return path; } //#kozaki 2007/10/28�@ExbpNode�ւ�path�𒲂ׂ� public void showPath(ExbpNode node){ //JOptionPane.showMessageDialog(this, getPath(node)); // #enegate# 08/07/07 �t���[�������ɔz�u���� //JOptionPane.showMessageDialog(this._ownerFrame, getPath(node),"The detail of the conceptual chain",JOptionPane.OK_OPTION); // #hirota save�p�@ // �y�Q�l�zsave_maps���� int ans = JOptionPane.showConfirmDialog(this._ownerFrame, getPath(node),"�p�X�̏ڍׁ@�ۑ����܂����H", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); if(ans!=JOptionPane.YES_OPTION){ return; } else{ String OPEN_DIRECTORY = "./data3/mapdata/"; File dir = new File(OPEN_DIRECTORY); if(!dir.exists()){ File ont_file = this.mapfactory.getFile(); if(ont_file!=null){ OPEN_DIRECTORY= ont_file.getParentFile().getAbsolutePath(); } } JFileChooser fd = new JFileChooser(OPEN_DIRECTORY); fd.showSaveDialog(this); File file = fd.getSelectedFile(); this.saveMAPinXML(file,node);// this.saveMAPinXML(file); return; } } // void setRoles(boolean inh){ // // } //#kozaki 2011/01/25 ���S���烉�x������v����ExbpNode��T���ĕԂ��D public ExbpNode findExbpNode(String lbl){ ExbpNode node;// = this.exbp_node_center; Vector nodes = new Vector(); nodes.add(this.exbp_node_center); for(int i=0;i en_edges = this.edges.elements(); while(en_edges.hasMoreElements()){ Edge e = en_edges.nextElement(); g.setColor(Color.red); // g.drawLine(e.to.x, e.to.y, e.from.x, e.from.y); g.drawLine(e.to.getCenterPoint().x, e.to.getCenterPoint().y, e.from.getCenterPoint().x, e.from.getCenterPoint().y); } } // // �`��{����ݒ肷�� // double dScale = getScaledCanvasScale(); // ((Graphics2D) g).scale(dScale, dScale); // ���E��̉~�ʂ�`�� if (this.isVisibleBorder) { this.drawBorderCircle(g); } // �K�w�̉~�ʂ�`�� if (this.isVisibleLevel) { this.drawLayerCircle(g); } // �m�[�h�Ԃ̐���� if (this.isVisibleLink) { this.drawLink(g); } // �m�[�h��`�� Enumeration en_nodes = this.nodes.elements(); int node_num=0; while(en_nodes.hasMoreElements()){ ExbpNode node = en_nodes.nextElement(); //System.out.println("PAINT:"+node.getLabel()); //node.paint2(g); // ���[�g�m�[�h�̕`�� if (node.equals(this.exbp_node_center)) { if (this.isVisibleCenter) { //node.paint2(g); node.paint(g,this); } } else if(!node.visible){//#kozaki 2008/08/15 continue; } else { //node.paint2(g); node.paint(g,this); } // g.setColor(Color.blue); // g.drawString(Integer.toString(node_num), node.x-5, node.y-5); // node_num++; //#kozaki 2007/09/07�@�����T�O���w���m�[�h�������\�� // if(node.getHozoNode()!=null){ // if(node.getHozoNode().isPicked){ // node.paintHilighit(g,Color.green); //// g.setColor(Color.green); //// g.drawRect(node.x-1, node.y-1, node.width+2, node.height+2); //// g.drawRect(node.x-2, node.y-2, node.width+4, node.height+4); //// g.drawRect(node.x, node.y, node.width, node.height); // }} //�I�����̋����\�������i�{����ExbpNode�N���X�Ɉڍs���ׂ��j if(node.equals(this.exbp_node_pick)){ /*#kozaki 2009/06/12�@���ꃌ�C���[�̃n�C���C�g����߂�y�b��z * if(this.cmd_dialog.all_node.isSelected()){ int layer = exbp_node_pick.getLocatedLayer(); ExbpNode[] target_nodes = getExbpNodesAtLear(layer,true); for(int i=0;i en = this.nodes.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); if (node.equals(this.exbp_node_center)) { } else { //node.setHighLight(false, Color.red); node.setLinkHighLight(false, Color.white); for(int i=0;i en = this.nodes.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); node.setLinkHighLight(false, Color.red); } this.repaint(); } // public void setClassRestrictedView(Node[] target_cls/*String[] cls_lists*/){} public void setClassRestrictedViewClear(){ //this.exbp_node_center.setVisbleChildren(true); Enumeration en = this.nodes.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); //node.setHighLight(false, Color.red); node.setHighLight(false, Color.white); node.clearHighLightColorList(); } this.repaint(); } //#kozaki 2009/02/13�@�s�Ž��ɂ���͈͂��C�I�������m�[�h�ȉ��Ɍ��� // public void setClassRestrictedView2(ExbpNode[] target_nodes, Node[] target_cls/*String[] cls_lists*/){} public void setClassRestrictedView2(ExbpNode ceter_node, String[] cls_lists){} private float[] getDashList() { StringTokenizer st = new StringTokenizer(DASH_PATURN, ","); float[] list = new float[st.countTokens()]; int i = 0; try { while (st.hasMoreTokens()) { list[i] = (new Float(st.nextToken())).floatValue(); i++; } } catch (final NumberFormatException nfe) { float[] fd = { 1.0f }; return fd; } return list; } private void drawBorderCircle(Graphics g) { Graphics2D g2 = (Graphics2D) g; //super.paintComponent(g2); BasicStroke dashedStroke = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, getDashList(), 0.0f); Stroke currentStroke = g2.getStroke(); g2.setStroke(dashedStroke); // ���S�_ Point pt = getCenterPosition(); int cx = pt.x; int cy = pt.y; Vector draw_option = new Vector(); if(optionList!=null){ for(int k=0; k 0 && draw_option.size() > i-1) { //option = optionList[i-1]; //#kozaki 2008/08/12�@�I�v�V�����\�L�̒��� if(this.exbp_node_center.getLabel().contains("ROOT") && draw_option.size() > i-1){ option = draw_option.elementAt(i-1); }else if(draw_option.size() > i){ option = draw_option.elementAt(i); } else{ option =""; } //System.out.println("drawBorderCircle:"+i+option); if (option.indexOf(ExbpNode.IS_A) == 0 && option.length() == ExbpNode.IS_A.length()) { canDraw = false; } else { canDraw = true; } } if (canDraw) { g2.setColor(Color.BLACK); g2.drawOval(cx-len, cy-len, len*2, len*2); if (option != null) { g.setFont(fontBorder); g.setColor(Color.BLACK); String s = "<" + option + ">"; g.drawString(s, cx - FONT_MARGIN, cy - len - FONT_MARGIN); } } } g2.setStroke(currentStroke); } // �K�w�̉~�ʂ�`�� private void drawLayerCircle(Graphics g) { // // ���S�m�[�h�̕��ƍ��� // int nw = this.exbp_node_center.width; // int nh = this.exbp_node_center.height; // // ���S�_ // //int cx = currentLayerLength * currentLayerNum + 30 + (nw / 2); // int cx = currentLayerLength * currentLayerNum + WIDTH_MARGIN; // int cy = currentLayerLength * currentLayerNum + HEIGHT_MARGIN + (nh / 2); Point pt = getCenterPosition(); int cx = pt.x; int cy = pt.y; for (int i = 1; i < currentLayerNum + 1; i++) { int len = currentLayerLength * i; g.setColor(Color.LIGHT_GRAY); g.drawOval(cx-len, cy-len, len*2, len*2); } } // public Color getHilightColor(Node n){ // int clr=0; // for(int i=0;i=6){ // clr-=6; // } // return hilight_color[clr]; // } // } // // // return Color.yellow; // } private Point getCenterPosition() { Point pt = new Point(0,0); // ���S�m�[�h�̕��ƍ��� int nw = this.exbp_node_center.width; int nh = this.exbp_node_center.height; // ���S�_ //int cx = currentLayerLength * currentLayerNum + 30 + (nw / 2); int cx = currentLayerLength * currentLayerNum + WIDTH_MARGIN; int cy = currentLayerLength * currentLayerNum + HEIGHT_MARGIN + (nh / 2); // �����`�F�b�N if (cx < 0) cx = 0; if (cy < 0) cy = 0; pt.setLocation(cx, cy); return pt; } // �m�[�h�Ԃ̐���� private void drawLink(Graphics g) { ExbpNode rootNode = this.exbp_node_center; // �q�m�[�h�ɑ΂��Đ���� this.drawLinkNode(g, rootNode); } // �q�m�[�h�ɑ΂��Đ���� private void drawLinkNode(Graphics g, ExbpNode node) { ExbpNode parentNode = node; int px = parentNode.x + parentNode.width / 2; int py = parentNode.y + parentNode.height / 2; // Vector childNodes = parentNode.getChildExbpNodes(); // Iterator it = childNodes.iterator(); // #kozaki 2008/02/09�@���[�t�����p�̃_�~�[�m�[�h�͕`�悵�Ȃ� // Vector childs = new Vector(); // while (it.hasNext()) { // ExbpNode childNode = (ExbpNode) it.next(); // if(childNode.isDummy){ // childs.addAll(childNode.children); // } // else{ // childs.add(childNode); // } // } //#kozaki 2008/05/09�@Dummy��2�i�ȏ�̏����Ή����\�b�h�ɕύX Vector childs = parentNode.getChildren(); Iterator it = childs.iterator(); while (it.hasNext()) { ExbpNode childNode = it.next(); if(!childNode.visible){//#kozaki 2008/08/15 continue; } Graphics2D g2 = (Graphics2D)g; BasicStroke wideStroke = new BasicStroke(1.0f); g2.setStroke(wideStroke); int cx = childNode.x + childNode.width / 2; int cy = childNode.y + childNode.height / 2; // ����l���\���ΏۊO�ł���Ε\�����Ȃ� //if (cx == 0 && cy == 0) { if (nodes.contains(childNode)) { g.setColor(Color.blue); if(childNode.opt.startsWith("isa")){ g.setColor(Color.green); drawArrow(g,px,py,cx,cy); } else if(childNode.opt.startsWith("super")){ g.setColor(Color.green); drawArrow(g,cx,cy,px,py); } else if(childNode.opt.startsWith(":!")){ g.setColor(Color.orange); } else if(childNode.opt.startsWith(":")){ g.setColor(Color.red); drawArrow(g,cx,cy,px,py); } else{ drawArrow(g,px,py,cx,cy); } if (parentNode.equals(this.exbp_node_center)) { if (this.isVisibleCenter) { if(childNode.link_highlight==true){ float dash[] = {10.0f, 3.0f}; wideStroke = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); g2.setStroke(wideStroke); g2.setColor(childNode.link_highligjtColor); g2.drawLine(px, py, cx, cy); } else{ g.drawLine(px, py, cx, cy); } drawLinkName(g,childNode, px, py, cx, cy); } } else { if(childNode.link_highlight==true){ float dash[] = {10.0f, 3.0f}; wideStroke = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); g2.setStroke(wideStroke); g2.setColor(childNode.link_highligjtColor); g2.drawLine(px, py, cx, cy); } else{ g.drawLine(px, py, cx, cy); } drawLinkName(g,childNode, px, py, cx, cy); } // �q�m�[�h�ɑ΂��Đ���� this.drawLinkNode(g, childNode); } } } void drawArrow(Graphics g,int px,int py, int cx, int cy){ int r = 10; double arc = java.lang.Math.atan2(py-cy, px-cx);//-Math.PI; double arc_1 = arc-Math.PI/6; double arc_2 = arc+Math.PI/6; int arc_x = px + (cx-px)*3/4; int arc_y = py + (cy-py)*3/4; g.drawLine(arc_x+(int)(Math.cos(arc_1)*r),arc_y+(int)(Math.sin(arc_1)*r), arc_x, arc_y); g.drawLine(arc_x+(int)(Math.cos(arc_2)*r),arc_y+(int)(Math.sin(arc_2)*r), arc_x, arc_y); } private void drawLinkName(Graphics g, ExbpNode node, int px, int py, int cx, int cy) { int sx = (px + cx) / 2; int sy = (py + cy) / 2; g.setFont(fontLink); g.setColor(Color.GRAY); g.drawString(node.key, sx+5, sy); } /* public void update(Graphics g){ this.setForeground(Color.white); Enumeration en_nodes = this.nodes.elements(); while(en_nodes.hasMoreElements()){ ExbpNode node = (ExbpNode)en_nodes.nextElement(); node.paint2(g); } }*/ /** * This method initializes this * * @return void */ private void initialize() { this.setSize(300, 200); this.setLayout(new GridBagLayout()); this.nodes = new Vector(); //#kozaki 2008/08/11 ExbpMouseListener mouseL = new ExbpMouseListener(this); this.addMouseListener(mouseL); this.addMouseMotionListener(mouseL); //setNodes(); //this.tempGobjList = null; } //�w�肵���K�w�ɂ���ExbpNode��Ԃ� #kozaki 2009/01/22�@skipUnVisible:���s�Ž��̃m�[�h���X�L�b�v���� ExbpNode[] getExbpNodesAtLear(int layer, boolean skipUnVisible){ if(this.exbp_node_center==null)return null; Vector nodes = new Vector(); nodes.addElement(this.exbp_node_center); for(int i=1;i<=layer;i++){ Enumeration en = nodes.elements(); Vector nodes2 = new Vector(); while(en.hasMoreElements()){ ExbpNode node = en.nextElement(); //#kozaki 2009/01/08�@Leaf�ŏ�������悤�Ƀ_�~�[�m�[�h��lj����鏈�� if(node.key.equals(ExbpNode.IS_A)||node.key.equals(ExbpNode.IS_A_L)){ if(node.getChildren().size()==0){ node.removeDummyNodesAll(); ExbpNode dummy = new ExbpNode(node.getLabel()); dummy.setDummyNode(true); dummy.setOrgNode(node.getOrgNode()); dummy.key=node.key; node.addChild(dummy); //nodes2.add(dummy); } } //�s�Ž��̃m�[�h���΂����� if(!skipUnVisible){ nodes2.addAll(node.getChildrenWithISADummy(false)); } else{ nodes2.addAll(node.getChildrenWithISADummy(true)); } } //���̒i�ɏ������ڍs���邽�߃f�[�^��n�� nodes = nodes2; } ExbpNode[] exbpnodes = new ExbpNode[nodes.size()]; nodes.copyInto(exbpnodes); return exbpnodes; } //#kozaki 2008/10/25�@�����ӏ��ɂ������������\�b�h��������ɓ��� String getSelectedRoles(int i){ RoleLists roles =(RoleLists) role_lists.elementAt(i); // Enumeration en = roles.getRoleLists().elements(); List list = new List(roles.getRoleLists().size(),true); // while(en.hasMoreElements()){ // String role = (String)en.nextElement(); // list.add(role); // } Vector rolelists = roles.getRoleLists(); Vector hit_num_lists = roles.getHitNumLists(); for(int l=0;l0){ selected_role+="|"; } selected_role+=selected[k].split(",")[0]; } return selected_role; } return null; } //�eLink�̐����ꗗ�ŕԂ� Vector getLinkListCount(){ return link_list.getHitNumLists(); } //���ׂĂ�Link�̈ꗗ��Ԃ� Vector getLinkList(){ link_list.clearRoles(); Enumeration en = this.nodes.elements(); while(en.hasMoreElements()){ ExbpNode n =(ExbpNode)en.nextElement(); link_list.addRole(n.key); } return link_list.getRoleLists(); // // Vector links = new Vector(); // this.link_count.removeAllElements(); // // Enumeration en = this.nodes.elements(); // while(en.hasMoreElements()){ // ExbpNode n =(ExbpNode)en.nextElement(); // int index = links.indexOf(n.key); // if(index<0){ // links.addElement(n.key); // this.link_count.add(1); // } // else{ // Integer c = (Integer)link_count.elementAt(index); // c++; // } // } // link_list=links; // // return links; } //#kozaki ����`�掞�̈ʒu�̔����� public void setNodesLoc(){ Graphics g = this.getGraphics(); Enumeration en_nodes = this.nodes.elements(); while(en_nodes.hasMoreElements()){ ExbpNode node = en_nodes.nextElement(); if (node != null) { node.adjustLoc(g);//#kozaki 2009/01/20�@paint���\�b�h�̈�{���̂��ߒ��� //node.paint3(g); //node.paint2(g); node.paint(g,this); } } repaint(); } void setNodes(String opt){} public void refreshExbp(){ int num_of_layer = currentLayerNum; int length_of_layer=currentLayerLength; //���S���W��ݒ� int cx=length_of_layer*num_of_layer + WIDTH_MARGIN; int cy=length_of_layer*num_of_layer + HEIGHT_MARGIN; //���̂�����̕`�惁�\�b�h�́CExtendBP�N���X�Őݒ�\�� exbp_node_center.color = ExbpNode.CENTER_COLOR; exbp_node_center.font = new Font("Times", Font.BOLD, (int)((ExbpNode.Font_node_size)*(ExbpNode.Font_node_center ))); exbp_node_center.setLocation(cx,cy); //���ʃm�[�h�̐F�w�� Enumeration chi_en = exbp_node_center.children.elements(); int color = 0; while(chi_en.hasMoreElements()){ ExbpNode chi_node = chi_en.nextElement(); if(color>9){ color-=10; } if(chi_node!=null){ // #hirota 09/11/19 // if(chi_node.getParentHozoNode() != null){ // //System.out.println("** parent_test:"+chi_node.getParentHozoNode().getLabel()); // }else{ // //System.out.println("** parent_test:Error"); // } chi_node.setChildrenColor(ExbpNode.node_color[color]); color++; } } //���ʃm�[�h�̔z�u���� this.setNodesLoc(num_of_layer, length_of_layer, 1,12); setNodesLoc(); // �ʒu������� // nodes.addAll(exbp_node_center.getVisbleChildren()); //#kozaki 2008/08/11�@�o�l���f���p�̃����N�lj� setEdgesForSpringModel(); this.start(); } //#kozaki 2008/08/13�o�l���f���p�̃����N�lj� void setEdgesForSpringModel(){ this.edges.removeAllElements(); System.out.println("�o�l���f���p�̃����N�lj�:currentLayerNum"+currentLayerNum); Enumeration en = this.nodes.elements(); while(en.hasMoreElements()){ ExbpNode n = (ExbpNode)en.nextElement(); if(n.getParent()!=null && n.visible){ //this.addEdge(n.getParent(), n, this.currentLayerLength*3/2, false); this.addEdge(n.getParent(), n, this.getlength(n.getParent(), n), false); } } Vector[] chi_n = new Vector[this.currentLayerNum+1]; // chi_n[0] = this.exbp_node_center.children; #kozaki 2009/02/13�@ROOT��‚���Ƃ��������Ȃ�o�O�C�� chi_n[0] = new Vector(); chi_n[0].addAll(this.exbp_node_center.children); for(int i=0;i=2){ System.out.println("addEdge:Layer=="+i); Enumeration en_chi = chi_n[i].elements(); ExbpNode n0 = (ExbpNode)en_chi.nextElement(); ExbpNode n1 = null; while(en_chi.hasMoreElements()){ n1 = (ExbpNode)en_chi.nextElement(); this.addEdge(n0, n1, this.getlength(n0, n1), false); //System.out.println(" ==>"+n0.getLabel()+":::"+n1.getLabel()); n0 = n1; } ExbpNode n_0 = (ExbpNode)chi_n[i].firstElement(); ExbpNode n_1 = (ExbpNode)chi_n[i].lastElement(); this.addEdge(n_1, n_0, this.getlength(n_1, n_0), false); } } } void setNodesLoc(int num_of_layer,int length_of_layer, double arc, int node_size){ this.nodes.removeAllElements(); this.nodes.addElement(exbp_node_center); //#kozaki 2008/06/26�@�ʒu�����p�̃_�~�[�m�[�h��lj����� if(this.layoutOption==LinkCentricLayout2){ exbp_node_center.setDummyNodes(num_of_layer); } else{ exbp_node_center.removeDummyNodes(); } currentLayerNum = num_of_layer; currentLayerLength = length_of_layer; //���S���W��ݒ� int cx=length_of_layer * num_of_layer + WIDTH_MARGIN; int cy=length_of_layer * num_of_layer + HEIGHT_MARGIN; if (exbp_node_center == null) return; // �G���[��� exbp_node_center.setLocation(cx,cy); //���ʃm�[�h�̔z�u���� //�p�x����̊�ƂȂ�S�Ă̗t�̐��̍��v�����߂� int leaf_num_all = exbp_node_center.getLeafNum(num_of_layer+1); System.out.println("Leaf NUM = "+leaf_num_all); //�e�ʖ��ɔz�u���� //�J�n�_��ێ����邽�߂̕ϐ� double start_arc=0;//Math.PI*3; if(arc<1){ start_arc = (Math.PI-2*arc*Math.PI)/2;//#kozaki 2008/03/25�@��`�̊p�x�ݒ� } double r; // int scale = Integer.parseInt(_extendFrame.jtf_scale.getText()); double rt =Double.parseDouble( this._extendFrame.jtf_rotation.getText()); start_arc=Math.PI * rt; System.out.println("rotation="+rt+" start_arc="+start_arc); //�J�n�_�CLeaf���v�CLayer�����w�肵�Ċe�ʂ̔z�u�����s���I���p�x��Ԃ� Enumeration chi_en = exbp_node_center.getVisbleChildren().elements(); while(chi_en.hasMoreElements()){ ExbpNode node = (ExbpNode) chi_en.nextElement(); r = 2*Math.PI*node.getLeafNum(num_of_layer)/leaf_num_all*arc;//#kozaki 2008/03/25�@��`�̊p�x�ݒ� //#kozaki 2008/06/26�@���C�A�E�g�̐؂�ւ� if(this.layoutOption==LinkCentricLayout || this.layoutOption==LinkCentricLayout2){ setLayerArcNew(node,cx,cy,length_of_layer,start_arc,r,num_of_layer, node_size); } else{ setLayerArc(node,cx,cy,length_of_layer,start_arc,r,num_of_layer, node_size); } start_arc += r; } } //#kozaki�@2008/08/12�@�z�u�����炷���� void setNodesLocRandom(int num_of_layer,int length_of_layer, double arc, int node_size){ //���S���W��ݒ� if (exbp_node_center == null) return; // �G���[��� int cx=exbp_node_center.getCenterPoint().x; int cy=exbp_node_center.getCenterPoint().y; //���ʃm�[�h�̔z�u���� //�p�x����̊�ƂȂ�S�Ă̗t�̐��̍��v�����߂� int leaf_num_all = exbp_node_center.getLeafNum(num_of_layer+1); //�e�ʖ��ɔz�u���� //�J�n�_��ێ����邽�߂̕ϐ� double start_arc=0; if(arc<1){ start_arc = (Math.PI-2*arc*Math.PI)/2;//#kozaki 2008/03/25�@��`�̊p�x�ݒ� } double r; //�J�n�_�CLeaf���v�CLayer�����w�肵�Ċe�ʂ̔z�u�����s���I���p�x��Ԃ� Enumeration chi_en = exbp_node_center.getVisbleChildren().elements(); while(chi_en.hasMoreElements()){ ExbpNode node = (ExbpNode) chi_en.nextElement(); r = 2*Math.PI*node.getLeafNum(num_of_layer)/leaf_num_all*arc;//#kozaki 2008/03/25�@��`�̊p�x�ݒ� //#kozaki 2008/06/26�@���C�A�E�g�̐؂�ւ� if(this.layoutOption==LinkCentricLayout || this.layoutOption==LinkCentricLayout2){ setLayerArcNew(node,cx,cy,length_of_layer,start_arc,r,num_of_layer,node_size); } else{ setLayerArc(node,cx,cy,length_of_layer,start_arc,r,num_of_layer,node_size); } start_arc += r; } } ExbpNode getPick(Point pp){ Enumeration node_en = this.nodes.elements(); while(node_en.hasMoreElements()){ ExbpNode node =node_en.nextElement(); if(node.visible){ if(node.contains(pp.x, pp.y)){ System.out.println("Clicked!!"+node.getLabel()); //exbp_node_pick=node; #kozaki 08/02/14 return node; } } } //exbp_node_pick=null; #kozaki 08/02/14 return null; } //���S�_�C���S����̋����C�z�u����m�[�h�iVector�j���w�肵�ĉ~���ExbpNode��z�u���� void setLayer(Vector layer_nodes,int cx,int cy,int l){ int size = layer_nodes.size(); int i=0; Enumeration wc = layer_nodes.elements(); while(wc.hasMoreElements()){ ExbpNode wnode = (ExbpNode)wc.nextElement(); //Node wnode = (Node)wc.nextElement(); Double dx =new Double(l*java.lang.Math.sin(java.lang.Math.PI*2*i/size)); Double dy =new Double(l*java.lang.Math.cos(java.lang.Math.PI*2*i/size)); wnode.setLocation(cx+dx.intValue(),cy+dy.intValue()); // System.out.print("x="+cx+dx.intValue()); // System.out.println("y="+cy+dy.intValue()); nodes.addElement(wnode); i++; } } // �J�n�_�CLeaf���v�CLayer�����w�肵�Ċe�ʂ̔z�u�����s���I���p�x��Ԃ� void setLayerArc(ExbpNode node,int cx,int cy,int l,double start_arc,double r,int layer_num, int node_size){ Vector arc_nodes = new Vector(); arc_nodes.addElement(node); for(int layer=1;layer<=layer_num;layer++){ Vector arc_nodes2 = new Vector(); int size = arc_nodes.size(); int i=0; Enumeration arc_en = arc_nodes.elements(); while(arc_en.hasMoreElements()){ ExbpNode arc_node = arc_en.nextElement(); //��i�ڂ͏����傫�߂̃t�H���g�ɂ��� if(layer==1){ // #hirota 08/08/19 arc_node.font = new Font("Times", Font.BOLD, (int)(node_size*(ExbpNode.Font_node_layer2))); } else{ arc_node.font = new Font("Times", Font.PLAIN, node_size); } Double dx =new Double(l*layer*java.lang.Math.cos(start_arc+r*i/size+r*0.5/size)); //#kozaki 2008/06/26 Double dy =new Double(l*layer*java.lang.Math.sin(start_arc+r*i/size+r*0.5/size)); //#kozaki 2008/06/26 // Double dx =new Double(l*layer*java.lang.Math.sin(start_arc+r*i/size+r*0.5/size)); // Double dy =new Double(l*layer*java.lang.Math.cos(start_arc+r*i/size+r*0.5/size)); arc_node.setLocation(cx+dx.intValue(),cy+dy.intValue()); // System.out.print("x="+cx+dx.intValue()); // System.out.println("y="+cy+dy.intValue()); nodes.addElement(arc_node); i++; arc_nodes2.addAll(arc_node.getVisbleChildren()); } arc_nodes = arc_nodes2; } } //#kozaki�@2008/06/14�@�z�u�A���S���Y���̉�� // �J�n�_�CLeaf���v�CLayer�����w�肵�Ċe�ʂ̔z�u�����s���I���p�x��Ԃ� void setLayerArcNew(ExbpNode node,int cx,int cy,int l,double start_arc,double r,int layer_num, int node_size){ Vector arc_nodes = new Vector(); arc_nodes.addElement(node); //�eLayer�̃m�[�h�̃��X�g��ێ����� Vector[] layer_nodes = new Vector[layer_num+1]; layer_nodes[0] = new Vector(); layer_nodes[0].addElement(node); for(int layer=0;layer(); int size = layer_nodes[layer].size(); int i=0; Enumeration arc_en = layer_nodes[layer].elements(); while(arc_en.hasMoreElements()){ ExbpNode arc_node = (ExbpNode)arc_en.nextElement(); //��i�ڂ͏����傫�߂̃t�H���g�ɂ��� if(layer==0){ // #hirota 08/08/19 arc_node.font = new Font("Times", Font.PLAIN, (int)(node_size*(ExbpNode.Font_node_layer2))); //arc_node.font=ExbpNode.font_2; }else{ arc_node.font = new Font("Times", Font.PLAIN, node_size); } Double dx =new Double(l*(layer+1)*java.lang.Math.cos(start_arc+r*i/size+r*0.5/size)); Double dy =new Double(l*(layer+1)*java.lang.Math.sin(start_arc+r*i/size+r*0.5/size)); //Double dx =new Double(l*(layer+1)*java.lang.Math.sin(start_arc+r*i/size+r*0.5/size)); //Double dy =new Double(l*(layer+1)*java.lang.Math.cos(start_arc+r*i/size+r*0.5/size)); arc_node.setLocation(cx+dx.intValue(),cy+dy.intValue()); nodes.addElement(arc_node); i++; layer_nodes[layer+1].addAll(arc_node.getVisbleChildren()); } //arc_nodes = arc_nodes2; } // #kozaki �V�����z�u�A���S���Y������ԊO���̂k���������̈ʒu��������̈ʒu�����߂� for(int k=layer_num-2;k>0;k--){//#kozaki 2011/01/26 k=0�̂Ƃ��͏�������O����]�������Ƃ��ɂ��������Ȃ邩��@ if(layer_nodes[k]!=null){ //Enumeration en = layer_nodes[k].elements(); double start0 = start_arc;//�q�m�[�h�������ꍇ�itmp_node�j�����p double center = start_arc + r; Vector tmp_node = new Vector(); for(int index=0; index0){ ExbpNode chi_start = (ExbpNode)node2.getVisbleChildren().firstElement(); ExbpNode chi_end = (ExbpNode)node2.getVisbleChildren().lastElement(); double start = java.lang.Math.atan2(chi_start.getY()-cy, chi_start.getX()-cx); double end = java.lang.Math.atan2(chi_end.getY()-cy, chi_end.getX()-cx); if(start<0){ start +=2*Math.PI; } if(end<0){ end +=2*Math.PI; } center = (start+end)/2; // System.out.println("start: "+chi_start.getLabel()+java.lang.Math.toDegrees(start)); // System.out.print("end :"+chi_end.getLabel()+java.lang.Math.toDegrees(end)+"\n"); // System.out.println("===>> "+java.lang.Math.toDegrees(center)); Double dx =new Double(l*(k+1)*java.lang.Math.cos(center)); Double dy =new Double(l*(k+1)*java.lang.Math.sin(center)); node2.setLocation(cx+dx.intValue(),cy+dy.intValue()); if(tmp_node.size()>0){ double arc = Math.abs(center-start0)/(tmp_node.size()+1); Enumeration arc_en = tmp_node.elements(); int i=1; while(arc_en.hasMoreElements()){ ExbpNode n = arc_en.nextElement(); Double dx2 =new Double(l*(k+1)*Math.cos(start0+arc*i)); Double dy2 =new Double(l*(k+1)*Math.sin(start0+arc*i)); n.setLocation(cx+dx2.intValue(),cy+dy2.intValue()); //System.out.println("TMP"+n.getLabel()+Math.toDegrees(start0+arc*i)); i++; } tmp_node.removeAllElements(); } start0=center; } else{//�q�m�[�h�������Ȃ��ꍇ�́C��ňʒu���������郊�X�g�ɓ��� tmp_node.addElement(node2); } } if(tmp_node.size()>0){//�Ō�ɖ��z�u�̃m�[�h���c���Ă���Ƃ��̏��� double arc = java.lang.Math.abs(start_arc + r-start0)/(tmp_node.size()+1); Enumeration arc_en = tmp_node.elements(); int i=1; //System.out.println("center:"+Math.toDegrees(center)); //System.out.println("start0:"+Math.toDegrees(start0)); while(arc_en.hasMoreElements()){ ExbpNode n = arc_en.nextElement(); Double dx2 =new Double(l*(k+1)*Math.cos(start0+arc*i)); Double dy2 =new Double(l*(k+1)*Math.sin(start0+arc*i)); // Double dx2 =new Double(l*(k+1)*java.lang.Math.cos(start_arc+r/2+arc*i)); // Double dy2 =new Double(l*(k+1)*java.lang.Math.sin(start_arc+r/2+arc*i)); n.setLocation(cx+dx2.intValue(),cy+dy2.intValue()); //System.out.println("TMP:"+n.getLabel()+Math.toDegrees(start0+arc*i)); i++; } } } } /* for(int k=layer_num-2;k>=0;k--){ if(layer_nodes[k]!=null){ Enumeration en = layer_nodes[k].elements(); double start0 = start_arc; Vector tmp_node = new Vector(); while(en.hasMoreElements()){ ExbpNode node2 = (ExbpNode)en.nextElement(); System.out.println(node2.getLabel()); if(node2.children.size()>0){ ExbpNode chi_start = (ExbpNode)node2.children.firstElement(); ExbpNode chi_end = (ExbpNode)node2.children.lastElement(); double start = java.lang.Math.atan2(chi_start.getY()-cy, chi_start.getX()-cx); double end = java.lang.Math.atan2(chi_end.getY()-cy, chi_end.getX()-cx); if(start<0){ start +=2*Math.PI; } if(end<0){ end +=2*Math.PI; } double center = (start+end)/2; // if(java.lang.Math.abs(end-start)>java.lang.Math.PI){ // center = center + java.lang.Math.PI; // } System.out.println("start: "+chi_start.getLabel()+java.lang.Math.toDegrees(start)); System.out.print("end :"+chi_end.getLabel()+java.lang.Math.toDegrees(end)+"\n"); System.out.println("===>> "+java.lang.Math.toDegrees(center)); Double dx =new Double(l*(k+1)*java.lang.Math.cos(//start)); center)); Double dy =new Double(l*(k+1)*java.lang.Math.sin(//start)); //2*java.lang.Math.PI+ center)); // dx = new Double(l*(k+1)*((chi_start.getX()-cx)/(l*(k+2)))); // dy = new Double(l*(k+1)*((chi_start.getY()-cy)/(l*(k+2)))); node2.setLocation(cx+dx.intValue(),cy+dy.intValue()); //node2.label+="*"; if(tmp_node.size()>0){ double arc = java.lang.Math.abs(center-start0)/(tmp_node.size()); Enumeration arc_en = tmp_node.elements(); int i=0; while(arc_en.hasMoreElements()){ ExbpNode n = (ExbpNode)arc_en.nextElement(); Double dx2 =new Double(l*(k+1)*java.lang.Math.cos(start0+arc*i)); Double dy2 =new Double(l*(k+1)*java.lang.Math.sin(start0+arc*i)); //n.setLocation(cx+dx2.intValue(),cy+dy2.intValue()); i++; } tmp_node.removeAllElements(); start0=center; } } else{//�q�m�[�h�������Ȃ��ꍇ�́C��ňʒu���������郊�X�g�ɓ��� tmp_node.addElement(node2); } } if(tmp_node.size()>0){//�Ō�ɖ��z�u�̃m�[�h���c���Ă���Ƃ��̏��� double arc = java.lang.Math.abs(start_arc+r/2-start0)/(tmp_node.size()); Enumeration arc_en = tmp_node.elements(); int i=1; while(arc_en.hasMoreElements()){ ExbpNode n = (ExbpNode)arc_en.nextElement(); Double dx2 =new Double(l*(k+1)*java.lang.Math.cos(start_arc+r/2+arc*i)); Double dy2 =new Double(l*(k+1)*java.lang.Math.sin(start_arc+r/2+arc*i)); //n.setLocation(cx+dx2.intValue(),cy+dy2.intValue()); i++; } } } }*/ } /** * * ���[�g�m�[�h��\�����邩�ǂ�����ݒ肵�܂��B * * @return ���[�g�m�[�h��\�����邩�ǂ�������߂��܂��B */ public boolean isVisibleCenter() { return isVisibleCenter; } /** * * ���[�g�m�[�h��\�����邩�ǂ�����ݒ肵�܂��B * * @param isVisibleCenter ���[�g�m�[�h��\�����邩�ǂ�����ݒ肷��B */ public void setVisibleCenter(boolean isVisibleCenter) { this.isVisibleCenter = isVisibleCenter; } //#kozaki 2008/02/10�@�e�����\�����邩 public void setVisibleInflu(boolean isVisibleInflu) { this.isVisibleInflu = isVisibleInflu; } /** * * �����N��\�����邩�ǂ�����ݒ肵�܂��B * * @return �����N��\�����邩�ǂ�������߂��܂��B */ public boolean isVisibleLink() { return isVisibleLink; } /** * * �����N��\�����邩�ǂ�����ݒ肵�܂��B * * @param isVisibleLink �����N��\�����邩�ǂ�����ݒ肷��B */ public void setVisibleLink(boolean isVisibleLink) { this.isVisibleLink = isVisibleLink; } /** * * ���x����\�����邩�ǂ�����ݒ肵�܂��B * * @return ���x����\�����邩�ǂ�������߂��܂��B */ public boolean isVisibleLevel() { return isVisibleLevel; } /** * * ���x����\�����邩�ǂ�����ݒ肵�܂��B * * @param isVisibleLink ���x����\�����邩�ǂ�����ݒ肷��B */ public void setVisibleLevel(boolean isVisibleLevel) { this.isVisibleLevel = isVisibleLevel; } /** * * ���E���\�����邩�ǂ�����ݒ肵�܂��B * * @return ���E���\�����邩�ǂ�������߂��܂��B */ public boolean isVisibleBorder() { return isVisibleBorder; } /** * * ���E���\�����邩�ǂ�����ݒ肵�܂��B * * @param isVisibleLink ���E���\�����邩�ǂ�����ݒ肷��B */ public void setVisibleBorder(boolean isVisibleBorder) { this.isVisibleBorder = isVisibleBorder; } /** * * �m�[�h���ēo�^���܂��B * * @param node �ēo�^����m�[�h���w�肷��B */ protected void reentryExbpNode(ExbpNode node) { if (node != null && this.nodes.contains(node)) { this.nodes.remove(node); this.nodes.add(node); } } //#kozaki 2008/10/03�@XML�`���̕ʃt�@�C���Ƃ��ă}�b�v��ۑ� public void saveMAPinXML(java.io.File save_file){} public void saveMAPinXML(java.io.File save_file,ExbpNode selected_node){} } class ExbpNode extends Rectangle{ public static String IS_A = "is-a"; public static String IS_A_L = "IS-A"; String label = "label"; ExbpNode parent; Vector children = new Vector(); // Node hozo_node; Object org_node;//#kozaki 2008/10/19�@Hozo�ȊO�ɂ��Ή����邽�� // #hirota 08/08/19 node_size�ύX public Font font = new Font("Times", Font.PLAIN, 12); static int Font_node_size = 12; static double Font_node_center = 1.6; static double Font_node_layer2 = 1.3; // static Font font_1 = new Font("Times", Font.BOLD, 18); // static Font font_2 = new Font("Times", Font.BOLD, 14); // static Font font_3 = new Font("Times", Font.PLAIN, 12); int evaluation = 0;//0:=���L�� int evaluation_1 = 0;//0:=���L�� int evaluation_2 = 0;//0:=���L�� int evaluation_3 = 0;//0:=���L�� int evaluation_4 = 0;//0:=���L�� String evaluation_comment = ""; /* public boolean equals(Object obj) { if (!(obj instanceof ExbpNode)) { return false; } ExbpNode other = (ExbpNode)obj; if(this.org_node==null || other.org_node==null){ return false; } return this.org_node.equals(other.org_node); }*/ static Color[] node_color = { Color.orange, Color.cyan, Color.pink, //#kozaki�@2008/08/18�@���Ԃ�ύX Color.yellow, Color.green, new Color(255,102,255), // Color.magenta, //#kozaki�@2008/08/18�@���Ԃ�ύX Color.lightGray, new Color(255,51,102),//Color.red, // new Color(50,155,255), //Color.blue, // Color.gray }; // #hirota 09/11/19 �T�X�e�i�p�F�ݒ� // �S�[���C���ʐ��E�C�΍�C�]��world�C���C���̑� String[] parent_nodes = {"�S�[��","���ʐ��E","�΍�","�]��world","���","���̑�"}; static Color[] node_color_sus = { Color.orange, // �S�[�� Color.cyan, //�@���ʐ��E Color.pink, //�@�΍� Color.yellow, //�@�]��world Color.green, //�@��� Color.gray //�@���̑� }; public static final Color CENTER_COLOR = new Color(200,200,255); //#kozaki 2008/08/18�@����̐F�ɕύX //public static final Color CENTER_COLOR = new Color(100,0,255); // ���F Color color = Color.yellow; //Font font = new Font("Times", Font.PLAIN, 12); protected String key = ""; protected String opt = "";//#kozaki�@2007/10/28�@�R�}���h���L������ protected boolean isDummy = false;//#kozaki 2008/02/09�@is-a�̃��[�t�ŏ��������邽�߂̃_�~�[�m�[�h�ɐݒ肷�� //#kozaki�@�o�l���f���p double dx; double dy; boolean n_stop=false; boolean fixed; boolean visible = true; //#kozaki 2008/08/15 boolean match = false; //#kozaki 2011/01/25 SeracPath�����p5 boolean highlight = false; //#kozaki�@2009/01/05�@compare����ύX Color highligjtColor = Color.white; boolean link_highlight = false; Color link_highligjtColor = Color.white; boolean isDobule = false;//#kozaki 2009/01/22�@�d��Node�`�F�b�N�p boolean open_sub = true;//#kozaki 2008/10/25 boolean not_focus = false; ArrayList topicColorList = new ArrayList(10); // private int _layer = 0; // #hirota 09/12/17 �����̃p�X�]���p���� public ExbpNode tracepath(ExbpNode _exbpNode,int tensuu, String s){ if(this.parent != null){ if(_exbpNode != null ){ if(this.visible == true){ if(this.label.equals(_exbpNode.label)){ if(this.key.equals(_exbpNode.key) ){ tensuu++; } // System.out.println("*** :"+ this.label + ", �� " + "(" +this.key + ")" + this.parent.label + "tensuu:" + tensuu); String str = " :"+ this.label + "�� "+ "(" +this.key + "):" + this.parent.label+ ", tensuu:"+tensuu; System.out.println(str); this.setColorFont(Color.red,font); this.parent.tracepath(_exbpNode.parent,tensuu,s+"\n"+str); }else{ System.out.println("*** error"); return null; } } } }else{ try{ // PrintWriter out = new PrintWriter(new BufferedWriter( // new FileWriter("./091221-path.txt",true))); PrintWriter out = new PrintWriter(new BufferedWriter( new FileWriter("C:\\�y�ŐV�z�����}�b�v\\091221-path.txt",true))); out.println(s); System.out.println(s); System.out.println("*** OK!!"); out.close(); } catch(Exception e){ e.printStackTrace(); } } return null; } // #ohta 2011/01/15 public void clearHighLightColorList() { this.topicColorList.clear(); } public void addTopicColor(Color clr) { if (!this.topicColorList.contains(clr)) { topicColorList.add(clr); } } public void setHighLight(boolean b, Color clr){ this.highlight=b; if(clr==null){ this.highligjtColor=Color.white; } else{ this.highligjtColor=clr; // // #ohta 2011/01/15 // if (!this.topicColorList.contains(clr)) { // topicColorList.add(clr); // } } } public void setLinkHighLight(boolean b, Color clr){ this.link_highlight=b; if(clr==null){ this.link_highligjtColor=Color.white; } else{ this.link_highligjtColor=clr; } } // #kozaki 2008/10/03�@XML�f�[�^�Ƃ��ĕۑ�����̂ɗ��p���� // #hirota 09/11/19 �I���m�[�h�‚� void SaveInXML(PrintWriter prt,Vector selected_nodes ){} //#kozaki 2008/10/03�@XML�f�[�^�Ƃ��ĕۑ�����̂ɗ��p���� //#kozaki 2010/02/21�@�ύX void SaveInXML(PrintWriter prt){} private String saveEValuation(){ if(this.evaluation!=0){ return ""+this.evaluation_comment+""; } return ""; } //#kozaki�@2008/08/15 void setVisibleWithChildren(boolean b){ this.visible = b; // if(!b){ // this.setBounds(0,0,0,0); // } // Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); node.setVisibleWithChildren(b); } } void setVisible(boolean b){ this.visible = b; } //#kozaki 2009/01/05�@�e�m�[�h���܂߂ĉŽ��ɂ��� void setVisibleTrueWithParent(){ this.visible = true; this.not_focus=false; if(this.parent!=null){ this.parent.open_sub=true; this.parent.setVisibleTrueWithParent(); } } void setMatchTrueWithParent(){ this.match = true; if(this.parent!=null){ this.parent.setMatchTrueWithParent(); } } void clearMatchWithChildren(){ this.match = false; Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); node.clearMatchWithChildren(); } } //#kozaki 2009/01/05�@�e�m�[�h���܂߂ĉŽ��ɂ��� void setVisiblefalseWithParent(){ this.visible = false; this.not_focus=false; if(this.parent!=null){ this.parent.open_sub=false; this.parent.setVisiblefalseWithParent(); } } //#kozaki 2010/07/04�@�e�m�[�h���܂߂ĐF��ς��� void setColorWithParent(Color c){ this.color =c; if(this.parent!=null){ this.parent.setColorWithParent(c); } } //#baba 2011/01/17�@�e�m�[�h���܂߂ăg�s�b�N�F��ς��� void setTopicColorWithParent(Color c){ this.addTopicColor(c); if(this.parent!=null){ this.parent.setTopicColorWithParent(c); } } //#kozaki 2009/02/13�@�m�[�h�̏󋵂ɉ����ĉ��ʃm�[�h��Open/Close��؂�ւ��� void changeOpenSub(){ boolean b=true; if(getVisbleChildren().size()==this.children.size()){ //this.setVisbleChildren(false); b=false; } else if(getVisbleChildren().size()>0){ //this.setVisbleChildren(false); b=false; } // else{ // this.setVisbleChildren(true); // } //this.setVisbleChildren(b); this.visible = true; this.open_sub=b; Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode n =(ExbpNode)en.nextElement(); //if(!n.not_focus){ n.visible=b; //} } } //#kozaki 2008/10/06�@�q�m�[�h�̕\����ύX void setVisbleChildren(boolean b){ this.open_sub=b; setVisibleWithChildren(b); this.visible = true;//�������g�͏�ɕ\������ } void setNotFocusChildren(boolean b){ this.not_focus=b; setNotFocusChildrenWithChildren(b); } void setNotFocusChildrenWithChildren(boolean b){ this.not_focus = b; // if(!b){ // this.setBounds(0,0,0,0); // } // Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); node.setNotFocusChildren(b); } } Vector getVisbleChildren(){ Vector vec = new Vector (); Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode n =(ExbpNode)en.nextElement(); if(n.visible){ vec.addElement(n); } } return vec; } Vector getInVisbleChildren(){ Vector vec = new Vector (); Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode n =(ExbpNode)en.nextElement(); if(!n.visible){ vec.addElement(n); } } return vec; } //#kozaki 2008/02/09�@is-a�̃��[�t�ŏ��������邽�߂̃_�~�[�m�[�h�ɐݒ肷�� void setDummyNode(boolean b){ this.isDummy = b; } // void addChild(ExbpNode chi){ // this.children.addElement(chi); // chi.parent=this; // if(!this.open_sub){ // chi.visible=false; // chi.open_sub=false; // } // } boolean checkUpperPath(ExbpNode chi){ ExbpNode par_node = this.getParent(); if(par_node==null){ return false; } Object org_node = par_node.getOrgNode(); if(org_node!=null){ if(org_node.equals(chi.getOrgNode())){ return true; } else{ return par_node.checkUpperPath(chi); } } return false; } // #hirota 2009/11/24 Any�r���p�����H�H�ً}�p void addChild(ExbpNode chi){ /* Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode node = (ExbpNode) en.nextElement(); if(node.getLabel().equals(chi.getLabel())){ return; } } */ //#kozaki�@2009/11/30�@�J��Ԃ��̉������ if(this.checkUpperPath(chi)){ return; } // ExbpNode par_node2 = this.getParent(); // if(par_node2!=null){ // Object org_node = par_node2.getOrgNode(); // if(org_node!=null){ // if(org_node.equals(chi.getOrgNode())){ // return; // } // } // } this.children.addElement(chi); chi.parent=this; if(!this.open_sub){ chi.visible=false; chi.open_sub=false; } if(chi.getLabel().equals("Any")){ chi.visible=false; } } void removeChild(ExbpNode chi){ this.children.remove(chi); chi.parent=null; } //#hirota 09/11/19 ont��̍ŏ�ʃm�[�h��Ԃ� // Node getParentHozoNode(){} //#kozaki 2008/05/09�@�e�m�[�h�iDummy�������j��Ԃ� ExbpNode getParent(){ if(this.parent==null){ return null; } else if(!this.parent.isDummy){ return this.parent; } else{ return this.parent.getParent(); } } //#kozaki 2008/05/09�@�e�m�[�h�iDummy�������j��Ԃ� ExbpNode getParentNode(ExbpNode target){ if(this.parent==null){ return null; } else if(!this.parent.isDummy && this.parent.equals(target)){ return this.parent; } else{ return this.parent.getParent(); } } //#kozaki 2008/07/31�@���i�ڂ̃m�[�h�ł��邩��Ԃ� public int getLocatedLayer(){ int i=0; for(ExbpNode node=this;node.parent!=null;node=node.parent){ if(!(node.parent==null)){ i++; } // if(!node.getLabel().equals("ROOT")){ // i++; // } } return i; } //#kozaki 2008/05/09�@�ʒi���̎q�m�[�h�iDummy�������j��Ԃ� Vector getChildren(){ Vector vec = new Vector(); Iterator it = this.children.iterator(); while (it.hasNext()) { ExbpNode childNode = it.next(); if(childNode.isDummy){ vec.addAll(childNode.getChildren()); } else{ vec.add(childNode); } } return vec; } //#kozaki 2008/05/09�@�ʒi���̎q�m�[�h�iDummy���܂ށj��Ԃ� //#kozaki2009/01/22�@�s�Ž��̏����lj� Vector getChildrenWithISADummy(boolean skipUnVisvle){ Vector vec = new Vector(); // if(skipUnVisvle && !this.open_sub){ // return vec; // } Iterator it = this.children.iterator(); while (it.hasNext()) { ExbpNode childNode = it.next(); if(childNode.isDummy){ //vec.addAll(childNode.getChildren()); if(childNode.key.equals(ExbpNode.IS_A)||childNode.key.equals(ExbpNode.IS_A_L)){ //if(!skipUnVisvle || childNode.visible){ vec.add(childNode); //} } } else{ //if(!skipUnVisvle || childNode.visible){ vec.add(childNode); //} } } return vec; } //#kozaki 2009/01/04�@Key���w�肵�Ďq�m�[�h��Ԃ� ExbpNode findChildNodeByKey(String key){ Vector chi_nodes = this.getChildExbpNodes(); Enumeration en = chi_nodes.elements(); String[] keys; while(en.hasMoreElements()){ ExbpNode node = (ExbpNode)en.nextElement(); if(node.key.equals(key)){ return node; } //���{���́C�u,��؂�v�̏������K�v // keys = node.key.split(","); // for(int i=0;i"+node.getSubLabel()); } this.setHozoNode(node); this.key = IS_A; Enumeration chi_en = node.childs.elements(); while(chi_en.hasMoreElements()){ Node chi_node = (Node)chi_en.nextElement(); ExbpNode chi = new ExbpNode(chi_node); this.addChild(chi); } }*/ //���ʊT�O�̊܂߂�ExbpNode���쐬�i�F�w�肠��j isa�R�}���h�̂ݏ��� /* ExbpNode(Node node,Color clr){ this(node.getLabel(),0,0,0,0); // #kozaki 2008/08/12 if(clr==null){ this.color=this.CENTER_COLOR; }else{ this.color=clr; } //#kozaki 2008/03/22�@�T�u���ꏈ�� if(mapfactory.isSubLung){ this.setLabel(node.getSubLabel()); System.out.println("�T�u����:"+node.getLabel()+"-->"+node.getSubLabel()); } this.setHozoNode(node); this.key = IS_A; //this.color=clr; Enumeration chi_en = node.childs.elements(); int color_i=0; Color chi_clr = clr; while(chi_en.hasMoreElements()){ if(clr==null){ chi_clr=ExbpNode.node_color[color_i]; color_i++; if(color_i>9){ color_i=0; } } Node chi_node = chi_en.nextElement(); //#kozaki 2008/08/13�@RH�͉��ʊT�O�Ƃ��Ď��o���Ȃ� // if(chi_node instanceof NodeRH){ // continue; // } ExbpNode chi = new ExbpNode(chi_node,chi_clr); this.addChild(chi); } // #kozaki�@2008/08/09�@IS-A�̏���(is-a�Ə������e�́C�قړ���) chi_en = node.extendedChilds.elements(); while(chi_en.hasMoreElements()){ Node chi_node = chi_en.nextElement(); if(clr==null){ chi_clr=ExbpNode.node_color[color_i]; color_i++; if(color_i>9){ color_i=0; } } ExbpNode chi = new ExbpNode(chi_node,chi_clr); this.addChild(chi); } } */ //#kozaki 07/08/30 //���ʊT�O���܂߂�ExbpNode���쐬�i�F�w�肠��j�@Leaf�̏��� /* ExbpNode(Node node,Color clr,String key){ this(node.getLabel(),0,0,0,0); // #kozaki 2008/08/12 if(clr==null){ this.color=this.CENTER_COLOR; }else{ this.color=clr; } // #kozaki 2008/03/29�@�T�u���ꏈ�� if(mapfactory.isSubLung){ this.setLabel(node.getSubLabel()); System.out.println("�T�u����:"+node.getLabel()+"-->"+node.getSubLabel()); } // #kozaki 2008/08/13 if(node instanceof NodeRH){ //this.setHozoNode(((NodeRH)node).getCCNode()); this.setLabel(this.getLabel()+"[RH]"); this.setHozoNode(node);//#kozaki 2008/08/13 // Node cc_node = ((NodeRH)node).getCCNode(); // if(cc_node!=null){ // node =cc_node; // } } else{ this.setHozoNode(node); } this.key = key; //this.color=clr; } */ //#kozaki 07/08/22 //�@slot_role�Ŏw�肵���X���b�g�̃N���X����Ƃ��� /* //�@���ʂ̊T�OExbpNode���쐬����i�F�w�肠��j ExbpNode(Node node,Color clr,BrowsingPanel bp,String[] slot_role, String link_key){ this(node.getLabel(),0,0,0,0); //#kozaki 2008/03/22�@�T�u���ꏈ�� if(mapfactory.isSubLung){ this.setLabel(node.getSubLabel()); } if(node instanceof NodeRH){ //System.out.println("this is NodeRH :" + this.getLabel()); //this.setHozoNode(((NodeRH)node).getCCNode()); this.setLabel(this.getLabel()+"[RH]"); this.setHozoNode(node);//#kozaki 2008/08/13 // Node cc_node = ((NodeRH)node).getCCNode(); // if(cc_node!=null){ // node =cc_node; // } } else{ this.setHozoNode(node); } //#kozaki 2008/08/12 if(clr==null){ this.color=this.CENTER_COLOR; }else{ this.color=clr; } //#kozaki�@2008/03/29�@�o�O��� if(this.getHozoNode()==null){ return; } //slot_role�ł̑I������ String key_role = slot_role[0]; System.out.println("KEY="+key_role); //this.key = key_role; //this.key = link_key;�@//#kozaki 2007/09/07 // // �@���ʊT�O�̒��o // is-a if(key_role.equals(IS_A)){ //#kozaki 2008/02/09�@���̒i�̃R�}���h�񐶐� String[] slot_role2 = slot_role; if(slot_role.length>1){ slot_role2 = new String[slot_role.length-1]; for(int i=0;i chi_en = node.childs.elements(); while(chi_en.hasMoreElements()){ Node chi_node = chi_en.nextElement(); // #kozaki 2008/08/13�@RH�͉��ʊT�O�Ƃ��Ď��o���Ȃ� // if(chi_node instanceof NodeRH){ // continue; // } ExbpNode chi = new ExbpNode(chi_node,clr,bp,slot_role2,"ISA"); chi.key="is-a"; this.addChild(chi); } //#kozaki 2008/02/09�@Isa�̃��[�t�ŏ������� //#kozaki 2008/08/12�@Isa�̃��[�t�����͌Z�킪����Ƃ��Ɍ��� if(node.parent!=null){//#kozaki 2008/08/13�@�o�O��� if(node.childs.size()==0 && node.parent.childs.size()>1){ ExbpNode chi = new ExbpNode(node,clr,bp,slot_role2,"ISA"); chi.setDummyNode(true); this.addChild(chi); } } //#kozaki�@2008/08/09�@IS-A�̏���(is-a�Ə������e�́C�قړ���) chi_en = node.extendedChilds.elements(); while(chi_en.hasMoreElements()){ Node chi_node = chi_en.nextElement(); ExbpNode chi = new ExbpNode(chi_node,clr,bp,slot_role2,"IS-A"); chi.key="IS-A"; this.addChild(chi); } } // // ?��ʊT�O�̒��o // #hirota 08/08/18 else if(key_role.equals("super")){ System.out.println(" - super :"); // #kozaki 2008/02/09�@���̒i�̃R�}���h�񐶐� String[] slot_role2 = slot_role; if(slot_role.length>1){ slot_role2 = new String[slot_role.length-1]; for(int i=0;i0){ makeSlotRelatedExbpNode(this,node,clr,bp,slot_role); key_role=key_role.replaceFirst("!", ""); slot_role[0]=slot_role[0].replaceFirst("!", ""); } //#kozaki 2008/08/09�@�������g���Q�Ƃ��Ă���X���b�g���X�L�b�v���鏈�� while(nodes.contains(node)){ nodes.removeElement(node); } String[] super_node = key_role.split(":"); ExbpNode[] parent_node = new ExbpNode[super_node.length]; parent_node[0]=this; //�֘A�T�O�̊K�w�쐬���� for(int i=1; i"+super_node[i]); String str[] = super_node[i].split("="); if(str.length!=2){ System.out.println("ERROR�F=�̎g�p�@���Ԉ���Ă��܂��D�������u�T�O��=n�i�K�w���j�v�Ƃ��Ă�������"); return; } String super_name=str[0]; int layer_num = Integer.parseInt(str[1]); //parent_node[i-1].key=super_name; int max=1; Node par_node;// = bp.editorPanel.findNode(super_name); //#kozaki 2008/05/08�@�T�u���ꏈ���̏C�� if(mapfactory.isSubLung){ par_node = bp.editorPanel.findNodeWithSubLang(super_name); } else{ par_node = bp.editorPanel.findNode(super_name); } int min= par_node.getParents().size(); //�lj����錳��Node�̃��X�g���擾 Vector addlists = new Vector(); Enumeration chi_en = nodes.elements(); while(chi_en.hasMoreElements()){ Node chi_node = (Node)chi_en.nextElement(); //#kozaki 2008/08/10�@���菈����chi_node.equals(par_node)���lj� if(chi_node.isSubclassOf(par_node)||chi_node.equals(par_node)){ //parent_node[i-1].children.addElement(new ExbpNode(chi_node,clr,"")); addlists.add(chi_node); int m = chi_node.getParents().size(); if(m>max){ max = m; } } } //�lj����郊�X�g����ʂ��珇�ɕ��בւ� Vector add_nodes = new Vector(); for(int k=min; k<=max; k++){ Enumeration add_en = addlists.elements(); while(add_en.hasMoreElements()){ Node add_node = add_en.nextElement(); if(add_node.getParents().size()==k){ add_nodes.add(add_node); } } } //parent_node[i-1].key=super_node[i]; int n=1; int org_c=add_nodes.size()/layer_num; int c=org_c; System.out.println("c="+c); Enumeration chi_en2 = add_nodes.elements(); while(chi_en2.hasMoreElements()){ Node chi_node = chi_en2.nextElement(); System.out.println("n="+n); ExbpNode chi = null; Vector slots = chi_node.findSlotsByClassConst(this.getHozoNode().getLabel()); if(n>org_c*(layer_num-1)){ //�ŏI�i�̏��� System.out.println("�ŏI�i�̏���"); if(i==super_node.length-1){//":"�̏������Ō�̎��́C���̏����Ɉڂ� System.out.println(":�̏������Ō�̎��́C���̏����Ɉڂ�"); //������slot_role�̔z�����‚��炷��������� if(slot_role.length>1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l0 && chi!=null ){ Slot slot = (Slot)slots.firstElement(); if(slot!=null){ chi.key=slot.getRoleName(); if(mapfactry.isSubLung){ chi.key=slot.getSubRole(); } } } if(chi!=null){ chi.opt=key_role; } } nodes.removeAll(addlists); } else{//�i��1�i�̏ꍇ�̊֘A�T�O���� parent_node[i-1].key=super_node[i]; parent_node[i-1].opt=key_role; //#kozaki 2007/10/28 Enumeration chi_en = nodes.elements(); Vector addlists = new Vector(); //#kozaki 2008/03/29�@�o�O����̂���while�����C�� while(chi_en.hasMoreElements()){ Node chi_node = (Node)chi_en.nextElement(); ExbpNode chi = null; Vector slots = chi_node.findSlotsByClassConst(this.getHozoNode().getLabel()); //#kozaki 2008/05/08�@�T�u���ꏈ�� Node par_node; if(mapfactory.isSubLung){ par_node=bp.editorPanel.findNodeWithSubLang(super_node[i]); } else{ par_node=bp.editorPanel.findNode(super_node[i]); } //#kozaki 2008/08/10�@���菈����chi_node.equals(par_node)���lj� if(chi_node.isSubclassOf(par_node)||chi_node.equals(par_node)){ if(i==super_node.length-1){//":"�̏������Ō�̎��́C���̏����Ɉڂ� //������slot_role�̔z�����‚��炷��������� if(slot_role.length>1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l0 && chi!=null ){ Slot slot = (Slot)slots.firstElement(); if(slot!=null){ chi.key=slot.getRoleName(); if(mapfactory.isSubLung){ chi.key=slot.getSubRole(); } } } if(chi!=null){ chi.opt=key_role; } } nodes.removeAll(addlists); } if(i0){ parent_node[i]=parent_node[i-1].children.firstElement(); } else{ parent_node[i]=new ExbpNode("---",0,0,0,0); parent_node[i-1].addChild(parent_node[i]); } } } } // #hirota 08/08/19 �R�}���h���� // // : // (old)���[���w�肠��@�{�@���ʊT�O�w�肠�� // // #kozaki, hirota else if(key_role.startsWith(";")){ //Vector nodes// = bp.findReferringNodes(this.getHozoNode().getLabel()); Vector nodes; // #kozaki 2008/08/11�@�T�u����̎������̃��x���Ō�������΂悢 // if(mapfactory.isSubLung){ // nodes = bp.findReferringNodesWithSub(this.getHozoNode().getSubLabel() ); // } // else{ nodes = bp.findReferringNodes(this.getHozoNode().getLabel()); //nodes = bp.findReferringNodesNonrec(this.getHozoNode().getLabel()); // } // #kozaki 2008/08/09�@�������g���Q�Ƃ��Ă���X���b�g���X�L�b�v���鏈�� while(nodes.contains(node)){ nodes.removeElement(node); } String[] super_node = key_role.split(";"); ExbpNode[] parent_node = new ExbpNode[super_node.length]; parent_node[0]=this; // #hirota 11/29 // node��CC�ɂȂ��Ă���S�̊T�O���w��Ȃ��őS�Ď��o�� if( super_node[1].equals("any")){ // test print Enumeration nodes_en = nodes.elements(); while( nodes_en.hasMoreElements()){ Node node_temp = (Node)nodes_en.nextElement(); //Node�o�^���� if(slot_role.length>1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i"+super_node[i]); String str[] = super_node[i].split("="); if(str.length!=2){ System.out.println("ERROR�F=�̎g�p�@���Ԉ���Ă��܂��D�������u�T�O��=n�i�K�w���j�v�Ƃ��Ă�������"); return; } String super_name=str[0]; int layer_num = Integer.parseInt(str[1]); //parent_node[i-1].key=super_name; // #hirota ����T�O�̉��ʊT�O�w��̂Ƃ��̏��� Node par_node; String str2[] = super_name.split(";"); boolean sub; //���ʊT�O�w�肠��/�Ȃ� if(str2.length!=2){ System.out.println("���ʊT�O�w��@�Ȃ�"); par_node = null; sub=false; }else{ System.out.println("���ʊT�O�w��@����"); String par_node_name=str2[1]; if(mapfactory.isSubLung){ par_node = bp.editorPanel.findNodeWithSubLang(super_name); } else{ par_node = bp.editorPanel.findNode(super_name); } sub=true; } super_name=str2[0]; int max=1; //test if( par_node != null ){ System.out.println(" par_node : " + par_node.getLabel() ); } int min= 0; //�lj����錳��Node�̃��X�g���擾 Vector addlists = new Vector(); Enumeration chi_en = nodes.elements(); while(chi_en.hasMoreElements()){ Node chi_node = (Node)chi_en.nextElement(); // if( chi_node instanceof Node){ // System.out.println("node : " ); // }else if( chi_node instanceof Slot ){ // System.out.println("slot : " ) ; // } System.out.println(" chi_node : " + chi_node.getLabel() ); //if(chi_node.isSubclassOf(par_node)){ if(mapfactory.isSubLung){ if(chi_node.findSlotByRoleWithSubLang(super_name) != null){ // #hirota ���ʊT�O����add if(sub){ if(chi_node.isSubclassOf(par_node)){ addlists.add(chi_node); int m = chi_node.getParents().size(); if(m>max){ max = m; } } } else{ addlists.add(chi_node); int m = chi_node.getParents().size(); if(m>max){ max = m; } } } } else{ if(chi_node.findSlotByRole(super_name) != null){ // #hirota ���ʊT�O����add if(sub){ if(chi_node.isSubclassOf(par_node)){ addlists.add(chi_node); int m = chi_node.getParents().size(); if(m>max){ max = m; } } } else{ addlists.add(chi_node); int m = chi_node.getParents().size(); if(m>max){ max = m; } } } } } //�lj����郊�X�g����ʂ��珇�ɕ��בւ� Vector add_nodes = new Vector(); for(int k=min; k<=max; k++){ Enumeration add_en = addlists.elements(); while(add_en.hasMoreElements()){ Node add_node = (Node)add_en.nextElement(); if(add_node.getParents().size()==k){ add_nodes.add(add_node); } } } //parent_node[i-1].key=super_node[i]; int n=1; int org_c=add_nodes.size()/layer_num; int c=org_c; System.out.println("c="+c); Enumeration chi_en2 = add_nodes.elements(); while(chi_en2.hasMoreElements()){ Node chi_node = (Node)chi_en2.nextElement(); System.out.println("n="+n); if(n>org_c*(layer_num-1)){ //�ŏI�i�̏��� System.out.println("�ŏI�i�̏���"); if(i==super_node.length-1){//":"�̏������Ō�̎��́C���̏����Ɉڂ� System.out.println(":�̏������Ō�̎��́C���̏����Ɉڂ�"); //������slot_role�̔z�����‚��炷��������� if(slot_role.length>1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l1){ String[] slot_role2 = new String[slot_role.length-1]; for(int l=0;l0){ parent_node[i]=parent_node[i-1].children.firstElement(); } else{ parent_node[i]=new ExbpNode("---",0,0,0,0); parent_node[i-1].addChild(parent_node[i]); } } } } } // // ? depend-on // // �@�� // #hirota 11/26 ���݂̎��_��Node�̂Ƃ��ANode�̃X���b�g��RH��\�� else if(key_role.equals("any-h")){ System.out.println(" * any-RH :: " ); // #hirota new // // //�p�����Ă���X���b�g��Ώۂɂ��� // if(inh){ // // System.out.println(" : inheri yes"); // // // ���̊T�O�Œ�`���ꂽ�A���ꉻ����Ă��Ȃ��X���b�g���`�F�b�N // Enumeration test = node.getAllSlots().elements(); // while(test.hasMoreElements()){ // // Slot slot = (Slot)test.nextElement(); // // // // �lj� // // 11/26 RH�󔒂̎��A���[�������g�� // String rh_label =""; // if( slot.getRHname().equals("") ){ // rh_label= ((Slot)slot).getRoleName(); // } // else{ // rh_label= ((Slot)slot).getRHname() ; // } // // // // Node�@�o�^���� // if(slot_role.length>1){ // String[] slot_role2 = new String[slot_role.length-1]; // for(int i=0;i1){ // String[] slot_role2 = new String[slot_role.length-1]; // for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i-1){ if(key_role.indexOf(role_name)>-1 || key_role.equals("any")){ isMatch = true; if(par_slot.equals(slot)){ match_key = role_name; } else{ match_key = role_name+"("+slot.getRoleName()+")"; if(mapfactory.isSubLung){ match_key = role_name+"("+slot.getSubRole()+")"; } } break; } // if(key_role.indexOf(par_slot.getRoleName())>-1){ // isMatch = true; // if(par_slot.equals(slot)){ // match_key = par_slot.getRoleName(); // } // else{ // match_key = par_slot.getRoleName()+"("+ // slot.getRoleName()+")"; // } // break; // } } //#kozaki�@2008/08/12�@���̒i��ExbpNode����������ύX if(isMatch || key_role.equals("any")){ if(slot.isOrClassConst()){ List orClassConstList = slot.getClassConstNodeList(); for (int i = 0; i < orClassConstList.size(); i++) { Node slot_node = (Node) orClassConstList.get(i); if(slot!=null && slot_node!=null){ //#kozaki 2008/08/16�@CC�������N���X�̎��͕\�����Ȃ� //if(!match_cc_nodes.contains(slot_node)){ //if(!match_data.contains(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key)){ if(!match_data.contains(slot_node.getLabel())){ match_data.add(slot_node.getLabel()); //match_data.add(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key); match_slots.add(slot); match_cc_nodes.add(slot_node); match_keys.add(match_key); } else{//�ʂ�Key�Ń}�b�`�����Ƃ��ɂ́Cmatch_key���X�V int index = match_data.indexOf(slot_node.getLabel()); //int index = match_cc_nodes.indexOf(slot_node); String key = (String)match_keys.elementAt(index); if(key.indexOf(match_key)<0){ key += ","+match_key; match_keys.remove(index); match_keys.add(index, key); } } } } }else{ Node slot_node = (Node)bp.editorPanel.hzeditor.findClassConstNode(slot.getClassConst()); //#kozaki�@2008/08/12�@���T�O�Ή� if(slot_node==null){ if(slot.getClassConst().startsWith("#")){ slot_node = (Node)bp.editorPanel.hzeditor.findClassConstNode(slot.getClassConst().substring(1)); } } if(slot!=null && slot_node!=null){ // #kozaki 2008/08/16�@CC�������N���X�̎��͕\�����Ȃ� //if(!match_cc_nodes.contains(slot_node)){ //if(!match_data.contains(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key)){ if(!match_data.contains(slot_node.getLabel())){ match_data.add(slot_node.getLabel()); //match_data.add(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key); match_slots.add(slot); match_cc_nodes.add(slot_node); match_keys.add(match_key); } else{//�ʂ�Key�Ń}�b�`�����Ƃ��ɂ́Cmatch_key���X�V int index = match_data.indexOf(slot_node.getLabel()); //int index = match_cc_nodes.indexOf(slot_node); String key = (String)match_keys.elementAt(index); if(key.indexOf(match_key)<0){ key += ","+match_key; match_keys.remove(index); match_keys.add(index, key); } } } } } } Vector rh_nodes = new Vector(); for(int i=0;i-1 ){ if(key_role.indexOf(role_name)>-1 || key_role.equals("any")){ isMatch = true; if(par_slot.equals(slot)){ match_key = role_name; } else{ match_key = role_name+"("+slot.getRoleName()+")"; if(mapfactory.isSubLung){ match_key = role_name+"("+slot.getSubRole()+")"; } } break; } // if(key_role.indexOf(par_slot.getRoleName())>-1){ // isMatch = true; // if(par_slot.equals(slot)){ // match_key = par_slot.getRoleName(); // } // else{ // match_key = par_slot.getRoleName()+"("+ // slot.getRoleName()+")"; // } // break; // } } //#kozaki�@2008/08/12�@���̒i��ExbpNode����������ύX if(isMatch || key_role.equals("any")){ if(slot.isOrClassConst()){ List orClassConstList = slot.getClassConstNodeList(); for (int i = 0; i < orClassConstList.size(); i++) { Node slot_node = (Node) orClassConstList.get(i); if(slot!=null && slot_node!=null){ //#kozaki 2008/08/16�@CC�������N���X�̎��͕\�����Ȃ� //if(!match_cc_nodes.contains(slot_node)){ //if(!match_data.contains(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key)){ if(!match_data.contains(slot_node.getLabel())){ match_data.add(slot_node.getLabel()); //match_data.add(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key); match_slots.add(slot); match_cc_nodes.add(slot_node); match_keys.add(match_key); } else{//�ʂ�Key�Ń}�b�`�����Ƃ��ɂ́Cmatch_key���X�V int index = match_data.indexOf(slot_node.getLabel()); //int index = match_cc_nodes.indexOf(slot_node); String key = (String)match_keys.elementAt(index); if(key.indexOf(match_key)<0){ key += ","+match_key; match_keys.remove(index); match_keys.add(index, key); } } } } }else{ Node slot_node = (Node)bp.editorPanel.hzeditor.findClassConstNode(slot.getClassConst()); //#kozaki�@2008/08/12�@���T�O�Ή� if(slot_node==null){ if(slot.getClassConst().startsWith("#")){ slot_node = (Node)bp.editorPanel.hzeditor.findClassConstNode(slot.getClassConst().substring(1)); } } if(slot!=null && slot_node!=null){ // #kozaki 2008/08/16�@CC�������N���X�̎��͕\�����Ȃ� //if(!match_cc_nodes.contains(slot_node)){ //if(!match_data.contains(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key)){ if(!match_data.contains(slot_node.getLabel())){ match_data.add(slot_node.getLabel()); //match_data.add(slot.getRoleName()+"<=>"+slot_node.getLabel()+"@"+match_key); match_slots.add(slot); match_cc_nodes.add(slot_node); match_keys.add(match_key); } else{//�ʂ�Key�Ń}�b�`�����Ƃ��ɂ́Cmatch_key���X�V int index = match_data.indexOf(slot_node.getLabel()); //int index = match_cc_nodes.indexOf(slot_node); String key = (String)match_keys.elementAt(index); if(key.indexOf(match_key)<0){ key += ","+match_key; match_keys.remove(index); match_keys.add(index, key); } } } } } } Vector rh_nodes = new Vector(); for(int i=0;i1){ slot_role2 = new String[slot_role.length-1]; for(int l=0;l cc_nodes = new Vector(); while(en.hasMoreElements()){ Slot slot =(Slot)en.nextElement(); if(slot.isOrClassConst()){ cc_nodes.addAll(slot.getClassConstNodeList()); } else if(slot.getClassConstNode()!=null){ cc_nodes.add(slot.getClassConstNode()); } } //�֘A����Node�̎擾 Enumeration en2 = cc_nodes.elements(); Vector related_nodes = new Vector(); Vector added_nodes = new Vector(); while(en2.hasMoreElements()){ Node cc_node = (Node)en2.nextElement(); if(cc_node.getLabel().equals("Any")){ continue; } related_nodes = bp.findReferringNodes(cc_node.getLabel()); Enumeration chi_en = related_nodes.elements(); while(chi_en.hasMoreElements()){ Node chi_node = (Node)chi_en.nextElement(); if(chi_node.isSubclassOf(par_node)||chi_node.equals(par_node)){ if(!added_nodes.contains(chi_node.getLabel())){ added_nodes.add(chi_node.getLabel()); ExbpNode chi; if(slot_role2!=null){ chi = new ExbpNode(chi_node,clr,bp,slot_role2,super_name); } else{ chi = new ExbpNode(chi_node,clr,super_name); } par_exbpnode.addChild(chi); chi.key="<"+cc_node.getLabel()+">"; chi.opt="<"+super_name+">"; } } } } } //#kozaki 2008/08/12�@�N���X�����H�鏈����Ɨ� private void makeExbpNodeCC(ExbpNode par_exbpnode, //�e�ƂȂ�ExbpNode Slot slot, //�H��ΏۂƂȂ�X���b�g Node slot_node, //�N���X����Ƃ��ĎQ�Ƃ��Ă���m�[�h Node node, //�H��X���b�g�����ƒm�[�h String key_role, //�H��R�}���h String match_key, //��v�����R�}���h�i��ʃX���b�g�̏����p�j String[] slot_role, //�������̃R�}���h Color clr, //�m�[�h�̐F BrowsingPanel bp ){ //#kozaki 2008/02/09 Any���N���X����̎��̓X�L�b�v���鏈�� if(slot.getClassConst().startsWith("Any")){ slot_node = null; } //#kozaki 2008/08/09�@�������g���Q�Ƃ��Ă���X���b�g���X�L�b�v���鏈�� if(slot_node==node){ slot_node = null; } if(slot_node!=null){ //System.out.println("�������[�v::check"+slot_node.getLabel()); //slot_role�̔z�����‚��炷���� if(slot_role.length>1){ String[] slot_role2 = new String[slot_role.length-1]; for(int i=0;i nodes = new Vector(); nodes.addElement(this); for(int i=1;i<=layer;i++){ Enumeration en = nodes.elements(); Vector nodes2 = new Vector(); while(en.hasMoreElements()){ ExbpNode node = en.nextElement(); //Leaf�������琔���P�J�E���g���� �D�������ŏI�w�ii==layer�j�Ȃ炷�ׂăJ�E���g if(node.getVisbleChildren().isEmpty() || i==layer){ leaf_num++; //System.out.println("Leaf:::"+node.getLabel()); } else{ nodes2.addAll(node.getVisbleChildren()); } } //���̒i�ɏ������ڍs���邽�߃f�[�^��n�� nodes = nodes2; } return leaf_num; } /* static void setColors(){ node_color[0]=Color.yellow; node_color[1]=Color.orange; node_color[2]=Color.magenta; node_color[3]=Color.cyan; node_color[4]=Color.blue; node_color[5]=Color.green; node_color[6]=Color.pink; node_color[7]=Color.red; //node_color[]=Color.darkGray; node_color[8]=Color.lightGray; node_color[9]=Color.gray; }*/ void setColorFont(Color c,Font f){ color=c; font=f; } void setChildrenColor(Color c){ this.color=c; Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode chi = (ExbpNode)en.nextElement(); chi.setChildrenColor(c); } } void setChildrenVisible(boolean v){ Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode chi = (ExbpNode)en.nextElement(); chi.setVisbleChildren(v); } } void setRestrictedViewByTopic(ExtendBP exbp){ this.setVisible(false); for(int i=0;i topic_colors = new ArrayList(); for(int i=0;i 1) { // System.out.println(highLightColorList.get(1)); float[] dist = new float[topic_colors.size()]; //float[] dist ={0.0f,0.3f,0.6f,1.0f}; //Color[] colors = {Color.RED, Color.WHITE, Color.BLUE, Color.GREEN}; for (int i = 0;i < topic_colors.size() ; i++) { dist[i] = ((float)i )/ ((float)topic_colors.size()-1); }; Color[] colors = (Color[])topic_colors.toArray(new Color[0]); LinearGradientPaint gradient = new LinearGradientPaint( x+width/4, y+height/4, x+width*3/4, y+height*3/4, dist, colors, MultipleGradientPaint.CycleMethod.NO_CYCLE ); g2.setPaint(gradient); } if(MapFactory.isGrayView){ g2.setColor(Color.white); g2.fillRect(this.x, this.y,this.width,this.height); } else{ g2.fillRect(this.x, this.y,this.width,this.height); } g2.setPaint(defaultP); if(this.highlight==true){ //BasicStroke wideStroke = new BasicStroke(3.0f); float dash[] = {10.0f, 3.0f}; BasicStroke wideStroke = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); g2.setStroke(wideStroke); //g2.setColor(Color.red); g2.setColor(this.highligjtColor); } else{ BasicStroke wideStroke = new BasicStroke(1.0f); g2.setStroke(wideStroke); g2.setColor(Color.black); } g2.drawRect(this.x, this.y,this.width,this.height); g2.setColor(Color.black); g.setFont(font); //�]���L��ς݂́C������Ԃ�����i�b�菈���j if(this.evaluation!=0){ g2.setColor(Color.red); } if(this.evaluation==-1){ g2.setColor(Color.orange); } //#kozaki 2008/08/16 if(this.children.size()!=this.getVisbleChildren().size()){ g.drawString( label+" [+]", x + 2, y +fm.getAscent()+2); } else{ g.drawString( label, x + 2, y +fm.getAscent()+2); } } void paint2(Graphics g){ //#kozaki 2008/02/09�@���[�t�����p�̃_�~�[�m�[�h�͕`�悵�Ȃ� if(this.isDummy)return; //Font font = new Font("Times", Font.PLAIN, 12); Graphics2D g2 = (Graphics2D)g; //Stroke defaultS = g2.getStroke(); Paint defaultP = g2.getPaint(); //BasicStroke wideS = new BasicStroke(3.0f); FontMetrics fm = g.getFontMetrics(font); setSize(new Dimension(fm.stringWidth(label) +5, fm.getHeight() + 5)); g2.setPaint(new GradientPaint(x+width/4, y+height/4, color, x+width*3/4, y+height*3/4,Color.white, false)); if (this.topicColorList.size() == 1) { g2.setPaint(new GradientPaint(x+width/4, y+height/4, topicColorList.get(0), x+width*3/4, y+height*3/4,Color.white, false)); } else if (this.topicColorList.size() > 1) { // System.out.println(highLightColorList.get(1)); float[] dist = new float[topicColorList.size()]; //float[] dist ={0.0f,0.3f,0.6f,1.0f}; //Color[] colors = {Color.RED, Color.WHITE, Color.BLUE, Color.GREEN}; for (int i = 0;i < topicColorList.size() ; i++) { dist[i] = ((float)i )/ ((float)topicColorList.size()-1); }; Color[] colors = (Color[])topicColorList.toArray(new Color[0]); LinearGradientPaint gradient = new LinearGradientPaint( x+width/4, y+height/4, x+width*3/4, y+height*3/4, dist, colors, MultipleGradientPaint.CycleMethod.NO_CYCLE ); g2.setPaint(gradient); } if(MapFactory.isGrayView){ g2.setColor(Color.white); g2.fillRect(this.x, this.y,this.width,this.height); } else{ g2.fillRect(this.x, this.y,this.width,this.height); } g2.setPaint(defaultP); if(this.highlight==true){ //BasicStroke wideStroke = new BasicStroke(3.0f); float dash[] = {10.0f, 3.0f}; BasicStroke wideStroke = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); g2.setStroke(wideStroke); //g2.setColor(Color.red); g2.setColor(this.highligjtColor); } else{ BasicStroke wideStroke = new BasicStroke(1.0f); g2.setStroke(wideStroke); g2.setColor(Color.black); } g2.drawRect(this.x, this.y,this.width,this.height); g2.setColor(Color.black); g.setFont(font); //�]���L��ς݂́C������Ԃ�����i�b�菈���j if(this.evaluation!=0){ g2.setColor(Color.red); } if(this.evaluation==-1){ g2.setColor(Color.orange); } //#kozaki 2008/08/16 if(this.children.size()!=this.getVisbleChildren().size()){ g.drawString( label+" [+]", x + 2, y +fm.getAscent()+2); } else{ g.drawString( label, x + 2, y +fm.getAscent()+2); } } //#kozaki 2008/02/10�@�n�C���C�g�\���̕`��i�m�[�h�p�j void paintHilighit(Graphics g, Color h_color){ if(this.isDummy)return; //Font font = new Font("Times", Font.PLAIN, 12); Graphics2D g2 = (Graphics2D)g; //Stroke defaultS = g2.getStroke(); Paint defaultP = g2.getPaint(); //BasicStroke wideS = new BasicStroke(3.0f); FontMetrics fm = g.getFontMetrics(font); setSize(new Dimension(fm.stringWidth(label) +5, fm.getHeight() + 5)); g2.setPaint(new GradientPaint(x+width/4, y+height/4, color, x+width*3/4, y+height*3/4,Color.white, false)); if(MapFactory.isGrayView){ g2.setColor(Color.white); g2.fillRect(this.x, this.y,this.width,this.height); } else{ g2.fillRect(this.x, this.y,this.width,this.height); } g2.setPaint(defaultP); g2.setColor(Color.black); g.setFont(font); //�]���L��ς݂́C������Ԃ�����i�b�菈���j if(this.evaluation!=0){ g2.setColor(Color.red); } if(this.evaluation==-1){ g2.setColor(Color.orange); } g.drawString( label, x + 2, y +fm.getAscent()+2); BasicStroke wideStroke = new BasicStroke(3.0f); g2.setStroke(wideStroke); g2.setColor(h_color); g2.drawRect(this.x, this.y,this.width,this.height); if(this.highlight==true){ //BasicStroke wideStroke = new BasicStroke(3.0f); float dash[] = {10.0f, 3.0f}; wideStroke = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); g2.setStroke(wideStroke); //g2.setColor(Color.red); g2.setColor(this.highligjtColor); } g2.drawRect(this.x, this.y,this.width,this.height); } //#kozaki 2008/02/10�@�n�C���C�g�\���̕`��i�����N�p�j void paintHilighitLink(Graphics g, Color h_color){ if(this.parent==null){ return; } //#kozaki 2008/05/09�@Dummy��2�i�ȏ�̎��̏��� ExbpNode parentNode = this.getParent(); // ExbpNode parentNode = this.parent; // if(parentNode.isDummy){ // parentNode=parentNode.parent; // if(parentNode==null){ // return; // } // } int px = parentNode.x + parentNode.width / 2; int py = parentNode.y + parentNode.height / 2; int cx = this.x + this.width / 2; int cy = this.y + this.height / 2; Graphics2D g2 = (Graphics2D)g; BasicStroke wideStroke = new BasicStroke(3.0f); g2.setStroke(wideStroke); g2.setColor(h_color); g2.drawLine(px, py, cx, cy); int sx = (px + cx) / 2; int sy = (py + cy) / 2; g.setFont(ExtendBP.fontLink); g.setColor(Color.red); g.drawString(this.key, sx+5, sy); } void adjustLoc(Graphics g){ if(this.isDummy)return; FontMetrics fm = g.getFontMetrics(font); setSize( new Dimension(fm.stringWidth(label) +5, fm.getHeight() + 5)); //this.setLocation(this.x-this.width/2, this.y-this.height/2); int nx = this.x-this.width/2; if (nx < 0) nx = 0; this.setLocation(nx, this.y); } /* #kozaki 2009/01/20�@paint2(Graphics g)�ֈ�{�� void paint3(Graphics g){ //#kozaki 2008/02/09�@���[�t�����p�̃_�~�[�m�[�h�͕`�悵�Ȃ� if(this.isDummy)return; //Font font = new Font("Times", Font.PLAIN, 12); Graphics2D g2 = (Graphics2D) g; //Stroke defaultS = g2.getStroke(); Paint defaultP = g2.getPaint(); //BasicStroke wideS = new BasicStroke(3.0f); FontMetrics fm = g.getFontMetrics(font); setSize( new Dimension(fm.stringWidth(label) +5, fm.getHeight() + 5)); //this.setLocation(this.x-this.width/2, this.y-this.height/2); int nx = this.x-this.width/2; if (nx < 0) nx = 0; this.setLocation(nx, this.y); //g.setColor(color); //g.fillRect(this.x, this.y,this.width,this.height); g2.setPaint(new GradientPaint(x+width/4, y+height/4, color, x+width*3/4, y+height*3/4,Color.white, false)); g2.fillRect(this.x, this.y,this.width,this.height); g2.setPaint(defaultP); BasicStroke wideStroke = new BasicStroke(1.0f); g2.setStroke(wideStroke); g2.setColor(Color.black); g2.drawRect(this.x, this.y,this.width,this.height); //g.setColor(Color.black); //g.drawRect(this.x, this.y,this.width,this.height); g.setFont(font); g.drawString( label, x + 2, y +fm.getAscent()+2); }*/ void setLabel(String str){ this.label=str; } protected String getLabel(){ return this.label; } // �q�m�[�h���擾���܂� protected Vector getChildExbpNodes() { return children; } //#koazaki 2008/08/11�@�m�[�h�̒��S���W��Ԃ� public Point getCenterPoint(){ int px = this.x + this.width / 2; int py = this.y + this.height / 2; return new Point(px,py); } // #kozaki 2007/10/28�@�I�������m�[�h�ɂ�����p�X��Ԃ� public String getPath(){ String path="["+this.getLabel()+"]"; for(ExbpNode n = this ; n.parent!=null ; n=n.parent ) { path="["+n.parent.getLabel()+"]"+ "\n-"+ n.key +"->"+path; } return path; } //#kozaki�@2008/02/10�@�I�������m�[�h�Ɏ���p�X�������\�� public void painthilightPath(Graphics g,Color h_color){ if(this.parent==null){ return; } this.paintHilighitLink(g, h_color); for(ExbpNode n = this.parent ; n.parent!=null ; n=n.parent ) { if(!n.isDummy){ n.paintHilighitLink(g, h_color); n.paintHilighit(g, h_color); } } } //#kozaki�@2008/02/10�@�I�������m�[�h�Ɏ���p�X�������\�� public void paintInfluencePath(ExtendBP exbp,Graphics g,Color color){ paintHilighit(g, color); // Vector childs = new Vector(); // Iterator it = this.children.iterator(); // while (it.hasNext()) { // ExbpNode childNode = (ExbpNode) it.next(); // if(childNode.isDummy){ // childs.addAll(childNode.children); // } // else{ // childs.add(childNode); // } // } //#kozaki 2008/05/09�@Dummy��2�i�ȏ�̎��̏������C�� Vector childs = this.getChildren(); Iterator it = childs.iterator(); while (it.hasNext()) { ExbpNode childNode = it.next(); if(exbp.nodes.contains(childNode) && childNode.visible){ childNode.paintHilighitLink(g, color); childNode.parent.paintHilighit(g, color); childNode.paintInfluencePath(exbp,g,color); } } } //#kozaki 2008/06/26�@�`�撲���p�̃_�~�[�m�[�h���Z�b�g���� public void setDummyNodes(int num_of_layer){ //�q�m�[�h�������ꍇ�C�K�w�������_�~�[�m�[�h���q�ɑ��� if(this.children.size()==0){ ExbpNode parent=this; ExbpNode dummy; for(int i=0;i it = this.children.iterator(); while (it.hasNext()) { ExbpNode childNode = it.next(); childNode.setDummyNodes(num_of_layer-1); } } } //#kozaki 2008/06/26�@�`�撲���p�̃_�~�[�m�[�h���������� public void removeDummyNodes(){ if(this.children.size()>0){ Iterator it = this.children.iterator(); Vector remove_nodes= new Vector(); while (it.hasNext()) { ExbpNode childNode = it.next(); if(childNode.isDummy && childNode.getLabel().equals("dummy_for_layout")){ remove_nodes.addElement(childNode); } else{ childNode.removeDummyNodes(); } } if(remove_nodes.size()>0){ this.children.removeAll(remove_nodes); } } } //#kozaki 2008/06/26�@���ׂẴ_�~�[�m�[�h���������� public void removeDummyNodesAll(){ if(this.children.size()>0){ Iterator it = this.children.iterator(); Vector remove_nodes= new Vector(); while (it.hasNext()) { ExbpNode childNode = it.next(); if(childNode.isDummy){ remove_nodes.addElement(childNode); } else{ childNode.removeDummyNodes(); } } if(remove_nodes.size()>0){ this.children.removeAll(remove_nodes); } } } //#kozaki 2011/01/256�@�s�Ž��̃m�[�h���������� public void removeUnmatchNodes(){ if(this.children.size()>0){ for (int i=0;ichildNode:"+childNode.getLabel()+":Match="+childNode.match); if(childNode.match){ childNode.removeUnmatchNodes(); } else{ children.remove(i); i--; //System.out.println(">>>>>Removed"); } } Iterator it3 = children.iterator(); while (it3.hasNext()) { ExbpNode chiNode = it3.next(); //System.out.println("===chiNode:"+chiNode.getLabel()+":Match="+chiNode.match); } } } // /** // * // * ���C���K�w�����擾���� // * // * @return ���C���K�w����߂��܂��B // */ // public int getLayer() { // return _layer; // } // // /** // * // * ���C���K�w����ݒ肷�� // * // * @param _layer ���C���K�w����ݒ肷��B // */ // public void setLayer(int layer) { // this._layer = layer; // } } //�R�}���hTree�쐬�p�̃R�}���h�Ǘ��pExbpNode class ExbpNodeTemp extends ExbpNode{ String command; ExbpNodeTemp(String lbl){ super(lbl); } public ExbpNodeTemp(ExbpNode exbpnode, String cmd) { this(exbpnode.getLabel()); this.command=cmd; this.setOrgNode(exbpnode.getOrgNode()); } Vector getCopyChildren(){ Vector copy_children = new Vector(); Enumeration en = this.children.elements(); while(en.hasMoreElements()){ ExbpNode chi = (ExbpNode)en.nextElement(); //ExbpNode copy= new ExbpNode(chi.getLabel()); copy_children.add(chi.copy()); } return copy_children; } //#kozaki�@�킴�ƈ�v������ɂ��ݒ肵�Ă��� public boolean equals(Object obj) { if (!(obj instanceof ExbpNodeTemp)) { return false; } ExbpNodeTemp other = (ExbpNodeTemp)obj; //�R�}���h�𖳎����Ĕ�r�ł���悤�ȉB���I�v�V���� if("*".equals(this.command)){ return other.label == this.label && other.org_node == this.org_node; } return other.label == this.label && other.org_node == this.org_node && other.command == this.command; } } // BrowsingGP���̃}�E�X���X�i�[�̃N���X class ExbpMouseListener implements MouseListener, MouseMotionListener { ExtendBP _exbp; public final int WHEEL_SCROLL_RATE = 50; // �}�E�X�z�C�[���̃X�N���[���� public final int MOVE_RATE = 1; // �}�E�X�z�C�[���̃X�N���[���� private Point _tmpPoint = new Point(); private Toolkit _toolkit; private Image _imageHandOpen = null; private Image _imageHandClose = null; private Image _imageDanger = null; private static final int HAND_OPEN = 0; private static final int HAND_CLOSE = 1; private boolean isMouseDragged = false; // �}�E�X���h���b�N����Ă��邩�ǂ��� private boolean isMouseExited = false; // �}�E�X���O��Ă��邩�ǂ��� ExbpNode exbpnode; //#kozaki�@2008/08/11�@�I�𒆂̃m�[�h Point press_point; // �R���X�g���N�^ protected ExbpMouseListener(ExtendBP bpgp) { super(); _exbp = bpgp; // _toolkit = Toolkit.getDefaultToolkit(); // _imageHandOpen = _toolkit.getImage(this.getClass().getResource("handopen_ss.gif")); // _imageHandClose = _toolkit.getImage(this.getClass().getResource("handclose_ss.gif")); // _imageDanger = _toolkit.getImage(this.getClass().getResource("danger_s.gif")); } // �}�E�X���h���b�N����Ă��邩�ǂ�����ݒ肷�� private void setMouseDragged(boolean isDragged) { isMouseDragged = isDragged; } // �}�E�X���O��Ă��邩�ǂ�����ݒ肷�� private void setMouseExited(boolean isExited) { isMouseExited = isExited; } // �X�e�[�^�X�o�[�ɕ\������ /* private void dispPointStatus(Point pt) { // �X�e�[�^�X�o�[�ɕ\������ //_bpGraphicPanel.bp.editorPanel.hzeditor._hzMainFrame.setStatusBarPosition(_tmpPoint); double dsize = (double) 100.0 / _bpGraphicPanel.bp.editorPanel.hzeditor.getViewSize(); int tx = (int) ((pt.getLocation().x + _bpGraphicPanel.bp.SCB_horz.getValue()) * dsize); int ty = (int) ((pt.getLocation().y + _bpGraphicPanel.bp.SCB_vert.getValue()) * dsize); //System.out.println(_bpGraphicPanel.bp.editorPanel.hzeditor.getViewSize() + " : " + dsize + " : (" + tx + ", " + ty + ") : (" + pt.getLocation().x + ", " + pt.getLocation().y + ")"); _tmpPoint.setLocation(tx, ty); _bpGraphicPanel.bp.editorPanel.hzeditor._hzMainFrame.setStatusBarPosition(_tmpPoint); }*/ // �}�E�X���h���b�O�����Ƃ��̏��� public void mouseDragged(MouseEvent e) { Point pp = e.getPoint(); if(exbpnode!=null && !exbpnode.equals(_exbp.exbp_node_center)){ exbpnode.x += pp.x - press_point.x ; exbpnode.y += pp.y - press_point.y ; press_point = pp; } else{ Point viewPoint = _exbp._extendFrame.jsp_exbp.getViewport().getViewPosition(); Point cntPoint = e.getPoint(); cntPoint.translate(-press_point.x, -press_point.y); viewPoint.translate(-cntPoint.x, -cntPoint.y); _exbp.scrollRectToVisible(new Rectangle(viewPoint, _exbp._extendFrame.jsp_exbp.getViewport().getSize())); } _exbp.repaint(); } public void mouseMoved(MouseEvent e) { } public void mouseClicked(MouseEvent e) { // Point pp = e.getPoint(); // if((e.isMetaDown() || e.isControlDown())){ // System.out.println("_exbp._popupMenu.show(_exbp, pp.x, pp.y);"); // if(exbpnode!=null){ // _exbp._popupMenu.setPopupMenu(exbpnode); // } // _exbp._popupMenu.show(_exbp, pp.x, pp.y); // } } public void mouseClicked2(MouseEvent e) { Point pp = e.getPoint(); ExbpNode old_pick = exbpnode; ExbpNode new_pick = this._exbp.getPick(pp); if(new_pick!=exbpnode){ _exbp.mapfactory.selectedClear(); } exbpnode = new_pick; if(new_pick!=null){ System.out.println( new_pick.getLabel()+":Match="+ new_pick.match) ; } if(exbpnode!=null){ Path path = (Path)exbpnode.getOrgNode(); int num = exbpnode.getLocatedLayer(); System.out.println("setSPARQL num==>"+num); try { this._exbp.getMapFactory().spBuilder.setSPARQL(path,num); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } //this._exbp.getPick(pp); // if(exbpnode!=null){ // if(exbpnode.evaluation!=0){ // System.out.println("�����]����"+exbpnode.evaluation); // System.out.println("�킩��₷����"+exbpnode.evaluation_1); // System.out.println("�����̍Č����E�Ó����E�K�ؐ���"+exbpnode.evaluation_2); // System.out.println("���Ր��E�ԗ����E�����"+exbpnode.evaluation_3); // System.out.println("���z�E�����x���i�h���j��"+exbpnode.evaluation_4); // System.out.println("�R�����g��"+exbpnode.evaluation_comment); // } // } // _exbp._popupMenu.setVisible(false); if(e.isShiftDown()){ if(exbpnode!=null){ //#kozaki�@2008/02/14�@�Q�‚ߑI�������m�[�h�Ɏ���p�X�������\�� this._exbp.paint2ndHighlit(exbpnode); return; } } else if(exbpnode!=null){ this._exbp.exbp_node_pick=exbpnode; //#kozaki 2008/02/14 // �ŏ�ʂɎ����Ă��� this._exbp.reentryExbpNode(exbpnode); // OE�̕`��y�C���ɑI����Ԃɔ��f // if(exbpnode.getHozoNode()!=null){ // _exbp.mapfactory.selected(exbpnode); //// if(this._exbp._hzeditor!=null){ //// this._exbp._hzeditor.WCEditor.browsingPanel.Jump(exbpnode.getHozoNode()); //// } // } // // 09/11/5 #hirota �ʃE�C���h�E�\�� // if(exbpnode.getOrgNode() instanceof Node){ // _exbp.mapfactory.minibp.setNode((Node)exbpnode.getOrgNode()); // }else if(exbpnode.getOrgNode() instanceof NodeRH){ // _exbp.mapfactory.minibp.setNode( ((NodeRH)exbpnode.getOrgNode()) ); // } // fin //#kozaki 2007/10/28�@�I�������m�[�h�ɂ�����p�X��\�� if(e.isControlDown()){ JOptionPane.showMessageDialog(_exbp, exbpnode.getPath()); } System.out.println(exbpnode.getPath()); //this._exbp.repaint(); // Graphics g = this._exbp.getGraphics(); // g.setColor(Color.red); // g.drawRect(exbpnode.x-1, exbpnode.y-1, exbpnode.width+2, exbpnode.height+2); // g.drawRect(exbpnode.x-2, exbpnode.y-2, exbpnode.width+4, exbpnode.height+4); // g.drawRect(exbpnode.x, exbpnode.y, exbpnode.width, exbpnode.height); // �E�N���b�N if(e.isMetaDown() || e.isControlDown()){ // ExtendBPPopupMenu newPopupMenu = new ExtendBPPopupMenu(_exbp, exbpnode); // newPopupMenu.setVisible(false); // newPopupMenu.show(_exbp, pp.x, pp.y); } else if(exbpnode.equals(old_pick) && e.getClickCount()>1){//�_�u���N���b�N���� //System.out.println("Dobule Clike!! ::"+exbpnode.getLabel()); /*if(exbpnode.equals(this._exbp.exbp_node_center)){ //#kozaki �o�O���ł�̂łƂ肠�����������O�����y�v�����z } else *///if(exbpnode.getChildren().size()==exbpnode.getVisbleChildren().size()){ /*if(exbpnode.open_sub){ exbpnode.setVisbleChildren(false); //System.out.println("exbpnode.setVisbleChildren(false)::"+exbpnode.getLabel()); //System.out.println("--->Children Size = "+exbpnode.children.size()); }else{ exbpnode.setVisbleChildren(true); //System.out.println("exbpnode.setVisbleChildren(true)::"+exbpnode.getLabel()); //System.out.println("--->Children Size = "+exbpnode.children.size()); }*/ //#kozaki 2009/02/13�@�T�u�m�[�h�̊J�‚̃��\�b�h��ύX exbpnode.changeOpenSub(); _exbp.repaint(); this._exbp._extendFrame.RefreshExbp(); } }else{ this._exbp.exbp_node_pick=null; //#kozaki 2008/02/14 // this._exbp.repaint(); } this._exbp.repaint(); boolean skip=false; //#kozaki 2008/10/28�@�N���b�N�������_�ŃR�}���hTree���N���A //if(exbpnode!=null){ //_exbp.cmd_dialog.setCommandOptions(exbpnode); //#kozaki 2009/01/08�@�X���b�h�����ɕύX �������ʂ�Ԃ��Ƃ��ɂ͏������X�L�b�v���� // if(exbpnode==null){ // if(_exbp.cmd_dialog.thread_waitng){ // _exbp.cmd_dialog.selected_exbp=null; // }else{ // _exbp.cmd_dialog.resetCommandOptions(); // } // } // else if(exbpnode.equals(_exbp.cmd_dialog.selected_exbp)){ // //return; // } // else{ // if(_exbp.cmd_dialog.selected_exbp!=null){ // if(_exbp.cmd_dialog.all_node.isSelected() && // exbpnode.getLocatedLayer()==_exbp.cmd_dialog.selected_exbp.getLocatedLayer()){ // skip = true; // } // } // // if(!skip){ // if(_exbp.cmd_dialog.thread_waitng){ // _exbp.cmd_dialog.setCommandOptionsForNext(exbpnode); // }else{ // _exbp.cmd_dialog.setCommandOptionsAsThread(exbpnode); // } // } // } // �E�N���b�N if((e.isMetaDown() || e.isControlDown())){ //System.out.println("_exbp._popupMenu.show(_exbp, pp.x, pp.y);"); // if(exbpnode!=null){ // _exbp._popupMenu.setPopupMenu(exbpnode); // _exbp._popupMenu.show(_exbp, pp.x, pp.y); // } // else{ // _exbp._popupMenu.show(_exbp, pp.x, pp.y); // } } // if(exbpnode==null || _exbp.cmd_dialog.selected_node_only.isSelected()){ // _exbp.cmd_dialog.setCommandOptions(exbpnode); // } // else if(exbpnode.equals(_exbp.cmd_dialog.selected_exbp)){ // return; // } // else if(_exbp.cmd_dialog.selected_exbp==null){ // if(_exbp.cmd_dialog.thread_waitng){ // _exbp.cmd_dialog.setCommandOptionsForNext(exbpnode); // }else{ // _exbp.cmd_dialog.setCommandOptionsAsThread(exbpnode); // } // }else if(exbpnode.getLocatedLayer()!=_exbp.cmd_dialog.selected_exbp.getLocatedLayer()){ // if(_exbp.cmd_dialog.thread_waitng){ // _exbp.cmd_dialog.setCommandOptionsForNext(exbpnode); // }else{ // _exbp.cmd_dialog.setCommandOptionsAsThread(exbpnode); // } // } //} //this._exbp.repaint();�@#kozaki�b�� } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } // �}�E�X�������ꂽ�Ƃ��̃C�x���g public void mousePressed(MouseEvent e) { press_point = e.getPoint(); mouseClicked2(e); } // �}�E�X�𗣂����Ƃ��̃A�N�V���� public void mouseReleased(MouseEvent e) { //System.out.println("mouseReleased ..."); /* if (exbpnode != null && !exbpnode.equals(_exbp.exbp_node_center)) { // exbpnode.x = e.getX(); // exbpnode.y = e.getY(); // //pick.fixed = pickfixed; exbpnode = null; } _exbp.repaint(); e.consume();*/ } // �}�E�X���z�C�[�������Ƃ��̃A�N�V���� /* public void mouseWheelMoved (MouseWheelEvent e) { // System.out.println("MouseWheel Moved ..."); int amount = e.getWheelRotation(); try { // Ctrl�L�[��������Ă���΁A���X�N���[���i�ʏ�A�c�X�N���[���j if(e.isControlDown()) { _bpGraphicPanel.bp.SCB_horz.setValue( _bpGraphicPanel.bp.SCB_horz.getValue() + amount * WHEEL_SCROLL_RATE); } else { _bpGraphicPanel.bp.SCB_vert.setValue( _bpGraphicPanel.bp.SCB_vert.getValue() + amount * WHEEL_SCROLL_RATE); } } catch (NullPointerException ne) { // �������Ȃ� } finally { } }*/ public void mouseWheelMoved(MouseWheelEvent arg0) { } } // end BPMouseListener /* class RoleLists_old { Vector roles = new Vector(); RoleLists(){ } Vector getRoleLists(){ return roles; } void addRole(String role){ if(roles.contains(role)){ return; } else{ roles.add(role); } } void clearRoles(){ roles.removeAllElements(); } }*/ //#kozaki 2008/10/25�@�q�b�g����Role���i�Ȃǁj�ƃq�b�g�����܂Ƃ߂ĊǗ�����悤�Ɋg�� class RoleLists { Vector roles = new Vector(); Vector hit_num = new Vector(); RoleLists(){ } Vector getRoleLists(){ return roles; } Vector getHitNumLists(){ return hit_num; } //#kozaki�@2009/01/22 �lj�������TRUE��Ԃ� boolean addRole(String role){ if(roles.contains(role)){ int index = roles.indexOf(role); Integer num = hit_num.elementAt(index); Integer new_num =new Integer((num.intValue())+1); hit_num.set(index,new_num); //hit_num.removeElement(num); //System.out.println("addRole++:::"+role); return false; } else{ roles.add(role); hit_num.add(new Integer(1)); return true; } } void clearRoles(){ roles.removeAllElements(); hit_num.removeAllElements(); } } //class ChangeViewFrame extends JFrame {} // #hirota 09/5/14 �lj� #kozaki�@2009/05/26�@�ύX //class ChangeViewFrameRole_at extends JFrame {} //#kozaki 2010/07/04 //class ChangeViewFrameByTopic extends JFrame{} //#kozaki 2011/01/26 //class ChangeViewFrameTopicColor extends JFrame{} //class ChangeViewFrameRole extends JFrame {} // #kozaki�@2009/05/27�@�ύX //class MatrixViewFrame extends JFrame {} //#kozaki 2010/01/25 //class ChangeViewFrameClass_at extends JFrame {}