[Javanetsim-cvs] javaNetSim/guiUI MainScreen.java, 1.48, 1.49 SetTCPIPPropertiesDialog.java, 1.2, 1
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-10-26 17:06:16
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13119/guiUI Modified Files: MainScreen.java SetTCPIPPropertiesDialog.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** MainScreen.java 26 Oct 2006 15:04:38 -0000 1.48 --- MainScreen.java 26 Oct 2006 17:06:11 -0000 1.49 *************** *** 69,72 **** --- 69,74 ---- import java.util.ArrayList; + import java.util.Date; + import java.util.Enumeration; *************** *** 231,235 **** ! --- 233,241 ---- ! private JLabel statusBar; ! ! private Timer statusTimer = new Timer(); ! ! *************** *** 317,320 **** --- 323,328 ---- StandardToolBar StandardToolBar = new StandardToolBar(this); + + statusBar = new JLabel(); SimToolBar = new SimulationToolBar(this); *************** *** 367,373 **** pContentPane.add(pSplit); ! ! ! //setup frame --- 375,383 ---- pContentPane.add(pSplit); ! ! pContentPane.add(statusBar, BorderLayout.PAGE_END); ! ! statusBar.setText(" "); ! //setup frame *************** *** 393,397 **** ! /** --- 403,433 ---- ! public class clearStatusTask extends TimerTask ! { ! private JLabel lbl; ! ! public clearStatusTask (JLabel lbl) ! { ! this.lbl = lbl; ! ! } ! ! ! public void run() ! { ! lbl.setText(" "); ! } ! } ! ! public void setStatus(String status){ ! Date d = new Date(); ! statusBar.setText(d.toString() + ": " + status); ! ! statusTimer.cancel(); ! statusTimer = null; ! statusTimer = new Timer(); ! statusTimer.schedule(new clearStatusTask(statusBar),4000); ! } ! /** *************** *** 1083,1086 **** --- 1119,1124 ---- public void printNetworkStart(){ + + setStatus("Starting network transfer..."); pnlConsole.append("**************************************************************************************************************** \n"); *************** *** 1909,1912 **** --- 1947,1952 ---- isDirty=false; + + setStatus("Simulation was saved succesfully."); }catch(IOException e){ Index: SetTCPIPPropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SetTCPIPPropertiesDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SetTCPIPPropertiesDialog.java 12 Oct 2006 15:21:24 -0000 1.2 --- SetTCPIPPropertiesDialog.java 26 Oct 2006 17:06:11 -0000 1.3 *************** *** 50,53 **** --- 50,54 ---- import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; + import java.awt.event.KeyListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; *************** *** 317,320 **** --- 318,331 ---- } }); + txtDefaultGW.addKeyListener(new KeyListener() { + public void keyTyped(KeyEvent e) {} + public void keyReleased(KeyEvent e) {} + public void keyPressed(KeyEvent e) { + int key = e.getKeyCode(); + if (key == KeyEvent.VK_ENTER) { + setDefaultGW(); + } + } + }); txtDefaultGW.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { *************** *** 371,375 **** } ! if(NodeName != null && DefaultGWAddress != null){ Sim.setDefaultGateway(NodeName,DefaultGWAddress); controller.addToConsole(NodeName +"'s Default Gateway Address has been set to " + DefaultGWAddress +"\n"); --- 382,386 ---- } ! if(NodeName != null){ Sim.setDefaultGateway(NodeName,DefaultGWAddress); controller.addToConsole(NodeName +"'s Default Gateway Address has been set to " + DefaultGWAddress +"\n"); *************** *** 527,532 **** private void setDefaultGW(){ String GW = txtDefaultGW.getText(); ! if(!GW.equalsIgnoreCase("Enter Default Gateway")){ ! if(!Simulation.validateDecIP(GW)){ lblError.setText("Invalid Default Gateway Address"); lblError.setForeground(Color.RED); --- 538,543 ---- private void setDefaultGW(){ String GW = txtDefaultGW.getText(); ! if(!GW.equalsIgnoreCase("Enter Default Gateway")){ ! if(!Simulation.validateDecIP(GW) && !GW.equals("")){ lblError.setText("Invalid Default Gateway Address"); lblError.setForeground(Color.RED); *************** *** 536,540 **** }else{ lblError.setVisible(false); ! DefaultGWAddress = txtDefaultGW.getText(); ErrorFlag = false; } --- 547,553 ---- }else{ lblError.setVisible(false); ! GW = txtDefaultGW.getText(); ! if(GW.equals("")) GW = null; ! DefaultGWAddress = GW; ErrorFlag = false; } |