[Javanetsim-cvs] javaNetSim/guiUI GuiNode.java, 1.1.1.1, 1.2 MainScreen.java, 1.47, 1.48 RunCMD.jav
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-10-26 15:04:46
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18179/guiUI Modified Files: GuiNode.java MainScreen.java RunCMD.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** MainScreen.java 26 Oct 2006 13:36:54 -0000 1.47 --- MainScreen.java 26 Oct 2006 15:04:38 -0000 1.48 *************** *** 643,648 **** GuiHub tempHub = new GuiHub(result,this); ! ! tempHub.setNodeLocation(inPoint); GUInodeTable.put(result,tempHub); --- 643,648 ---- GuiHub tempHub = new GuiHub(result,this); ! ! tempHub.setNodeLocation(inPoint); GUInodeTable.put(result,tempHub); *************** *** 3356,3359 **** --- 3356,3410 ---- } + + public String getNodeTooltipText(String inNodeName){ + //core.protocolsuite.tcp_ip.ProtocolStack PS = Sim.getTCPProtocolStack(inNodeName); + + String htmlText = "<html>"; + + try{ + //DataLinkLayerDevice dev = Sim.getNode(inNodeName); + Vector VectorMasterList = Sim.getAllNodeInformation(inNodeName); + /*ArrayList aryColumnNames = new ArrayList(); + aryColumnNames.add("Name"); + aryColumnNames.add("Gateway"); + aryColumnNames.add("Interface Name"); + aryColumnNames.add("MAC Address"); + aryColumnNames.add("IP Address"); + aryColumnNames.add("Subnet Mask"); + aryColumnNames.add("Link Name");*/ + + + Vector vec1 = (Vector) VectorMasterList.get(0); + + htmlText = htmlText + "Name: " + vec1.get(0) + "<br>"; + htmlText = htmlText + "Default Gateway: " + vec1.get(1) + "<br>"; + + htmlText = htmlText + "<table border='0' cellpadding='1' cellspacing='5'>"; + + htmlText = htmlText + "<tr><td>Interface</td><td>MAC</td><td>IP</td><td>Netmask</td><td>Link To</td></tr>"; + + for(int i=0; i<VectorMasterList.size(); i++){ + htmlText = htmlText + "<tr>"; + Vector vecInterfaceInfo = (Vector) VectorMasterList.get(i); + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(2) + "</td>"; + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(3) + "</td>"; + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(4) + "</td>"; + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(5) + "</td>"; + String lnk = (String) vecInterfaceInfo.get(6); + lnk = lnk.replaceAll("-TO-" + inNodeName,""); + lnk = lnk.replaceAll(inNodeName + "-TO-",""); + htmlText = htmlText + "<td>" + lnk + "</td>"; + htmlText = htmlText + "</tr>"; + } + + htmlText = htmlText + "</table>"; + + }catch(Exception e){} + + //System.out.println(htmlText); + + return htmlText + "</html>"; + } + /** Index: GuiNode.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiNode.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** GuiNode.java 8 Nov 2005 04:04:25 -0000 1.1.1.1 --- GuiNode.java 26 Oct 2006 15:04:38 -0000 1.2 *************** *** 292,296 **** //because of the abstract class MouseListener and MouseMotionListener needs them public void dropActionChanged(DragSourceDragEvent e) {} ! public void mouseMoved(MouseEvent e){} public void mouseClicked(MouseEvent e){} public void mouseExited(MouseEvent e) {} --- 292,298 ---- //because of the abstract class MouseListener and MouseMotionListener needs them public void dropActionChanged(DragSourceDragEvent e) {} ! public void mouseMoved(MouseEvent e){ ! this.setToolTipText(controller.getNodeTooltipText(strNodeName)); ! } public void mouseClicked(MouseEvent e){} public void mouseExited(MouseEvent e) {} Index: RunCMD.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/RunCMD.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunCMD.java 3 Mar 2006 02:28:34 -0000 1.3 --- RunCMD.java 26 Oct 2006 15:04:38 -0000 1.4 *************** *** 246,250 **** else if((m=Pattern.compile(" +del +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.removeRoute(m.group(1)); ! out+="Route to " + tokens[2] + "removed.\n"; } else{ --- 246,250 ---- else if((m=Pattern.compile(" +del +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.removeRoute(m.group(1)); ! out+="Route to " + tokens[2] + " removed.\n"; } else{ |