[Javanetsim-cvs] javaNetSim/guiUI LinkProperties.java,1.1,1.2
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2005-11-19 16:55:49
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4295/guiUI Modified Files: LinkProperties.java Log Message: Index: LinkProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LinkProperties.java 19 Nov 2005 16:16:32 -0000 1.1 --- LinkProperties.java 19 Nov 2005 16:55:37 -0000 1.2 *************** *** 226,230 **** }); ! txtProp.setEnabled(false); final GridBagConstraints gridBagConstraints_3 = new GridBagConstraints(); gridBagConstraints_3.fill = GridBagConstraints.HORIZONTAL; --- 226,230 ---- }); ! txtProp.setEnabled(true); final GridBagConstraints gridBagConstraints_3 = new GridBagConstraints(); gridBagConstraints_3.fill = GridBagConstraints.HORIZONTAL; *************** *** 278,283 **** //String str = Sim.disconnectLink(NodeName, Interface); //SBox.removeLine(str); ! //controller.addToConsole(NodeName +"'s link on interface "+Interface+" has been disconnected!\n"); ! } --- 278,292 ---- //String str = Sim.disconnectLink(NodeName, Interface); //SBox.removeLine(str); ! ! ///!!!!!!!!!!!!!!! ! // !!!!!!!!!!!!!!!!!! ! // *TODO*: security from FOOLS ! String SC = txtProp.getText(); ! double scoeff = Double.valueOf(SC.trim()).doubleValue(); ! String lnk = Sim.getLinkName(NodeName, Interface); ! if(lnk!=null){ ! Sim.SetLinkProb(lnk, scoeff); ! controller.addToConsole("Setting sieving coefficient for " + NodeName +"'s link on interface "+Interface+" by " + SC + ".\n"); ! } } *************** *** 327,334 **** cmbInterface.setEnabled(true); ! } catch (Exception e) { //This should never happen e.printStackTrace(); } } --- 336,345 ---- cmbInterface.setEnabled(true); ! selectInterface(); ! } catch (Exception e) { //This should never happen e.printStackTrace(); } + } *************** *** 344,349 **** try{ String lnk = Sim.getLinkName(NodeName, Interface); ! //txtProp.setText(Sim.getLinkProb(lnk)); ! }catch(Exception e){ } } --- 355,360 ---- try{ String lnk = Sim.getLinkName(NodeName, Interface); ! if(lnk!=null) txtProp.setText(Double.valueOf(Sim.GetLinkProb(lnk)).toString()); ! }catch(Exception e){ System.out.println(e.toString()); } } |