[Javanetsim-cvs] javaNetSim/guiUI MainScreen.java, 1.44, 1.45 MenuBar.java, 1.6, 1.7 SimulationTool
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-10-12 17:26:32
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11183/guiUI Modified Files: MainScreen.java MenuBar.java SimulationToolBar.java SplashWindow.java Log Message: Index: SplashWindow.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SplashWindow.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SplashWindow.java 8 Nov 2005 04:04:29 -0000 1.1.1.1 --- SplashWindow.java 12 Oct 2006 17:26:26 -0000 1.2 *************** *** 52,56 **** --- 52,58 ---- ClassLoader cl = this.getClass().getClassLoader(); JLabel l = new JLabel(new ImageIcon(cl.getResource(filename))); + JLabel v = new JLabel(core.Version.CORE_VERSION + ", copyright(¿) " + core.Version.YEARS); getContentPane().add(l, BorderLayout.CENTER); + getContentPane().add(v, BorderLayout.AFTER_LAST_LINE); pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); *************** *** 76,80 **** public void run() { try { ! Thread.sleep(pause); SwingUtilities.invokeAndWait(closerRunner); } catch (Exception e) { --- 78,82 ---- public void run() { try { ! Thread.sleep(pause); SwingUtilities.invokeAndWait(closerRunner); } catch (Exception e) { Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** MainScreen.java 12 Oct 2006 15:21:24 -0000 1.44 --- MainScreen.java 12 Oct 2006 17:26:26 -0000 1.45 *************** *** 716,720 **** Sandbox.setLayer(tempSwitch,3,0); ! JOptionPane.showMessageDialog(this,"Switch protocols are not yet implemented within the core of the system","Not Implemented",JOptionPane.WARNING_MESSAGE); isDirty = true; --- 716,720 ---- Sandbox.setLayer(tempSwitch,3,0); ! //JOptionPane.showMessageDialog(this,"Switch protocols are not yet implemented within the core of the system","Not Implemented",JOptionPane.WARNING_MESSAGE); isDirty = true; *************** *** 2049,2054 **** ! ! if(strClassName.contains("GuiHub")){ deviceType = 1; --- 2049,2053 ---- ! if(strClassName.contains("GuiHub")){ deviceType = 1; *************** *** 2066,2069 **** --- 2065,2084 ---- GUInodeTable.put(strNodeName,tempHub); + }else if(strClassName.contains("GuiSwitch")){ + + deviceType = 1; + + Sim.addSwitch(strNodeName); + + GuiSwitch tempSwitch = new GuiSwitch(strNodeName,this); + + tempSwitch.setNodeLocation(pnt); + + Sandbox.add(tempSwitch); + + Sandbox.setLayer(tempSwitch,3,0); + + GUInodeTable.put(strNodeName,tempSwitch); + }else if(strClassName.contains("GuiPC")){ Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MenuBar.java 12 Oct 2006 16:14:14 -0000 1.6 --- MenuBar.java 12 Oct 2006 17:26:26 -0000 1.7 *************** *** 54,58 **** private JMenuItem mnuRouter = new JMenuItem("Router ..."); private JMenuItem mnuHub = new JMenuItem("Hub ..."); ! // private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); //Tools submenu --- 54,58 ---- private JMenuItem mnuRouter = new JMenuItem("Router ..."); private JMenuItem mnuHub = new JMenuItem("Hub ..."); ! private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); //Tools submenu *************** *** 96,99 **** --- 96,100 ---- mnuRouter.setAccelerator(KeyStroke.getKeyStroke("ctrl R")); mnuHub.setAccelerator(KeyStroke.getKeyStroke("ctrl H")); + mnuSwitch.setAccelerator(KeyStroke.getKeyStroke("ctrl W")); mnuClearConsole.setAccelerator(KeyStroke.getKeyStroke("F3")); *************** *** 123,127 **** mnuAdd.add(mnuRouter); mnuAdd.add(mnuHub); ! //mnuAdd.add(mnuSwitch); mnuSimulation.add(mnuTools); --- 124,128 ---- mnuAdd.add(mnuRouter); mnuAdd.add(mnuHub); ! mnuAdd.add(mnuSwitch); mnuSimulation.add(mnuTools); *************** *** 256,269 **** //Add action listener to new switch ! /* mnuSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.setAllHighlightsOff(); ! JOptionPane.showMessageDialog(null,"Sorry switches are not yet implemented.","Switch Dialog Message", ! JOptionPane.INFORMATION_MESSAGE); ! //controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! */ //Add action listener to exit --- 257,268 ---- //Add action listener to new switch ! mnuSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.setAllHighlightsOff(); ! controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! //Add action listener to exit Index: SimulationToolBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SimulationToolBar.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SimulationToolBar.java 8 Nov 2005 04:04:29 -0000 1.1.1.1 --- SimulationToolBar.java 12 Oct 2006 17:26:26 -0000 1.2 *************** *** 48,52 **** private JButton btnNewPC = new JButton(new ImageIcon(cl.getResource("images/simulation/PC_small.gif"))); private JButton btnNewRouter = new JButton(new ImageIcon(cl.getResource("images/simulation/router_small.gif"))); ! //private JButton btnNewSwitch = new JButton(new ImageIcon(cl.getResource("images/simulation/switch_small.gif"))); private JButton btnNewHub = new JButton(new ImageIcon(cl.getResource("images/simulation/hub_small.gif"))); private JButton btnNewLink = new JButton(new ImageIcon(cl.getResource("images/simulation/link.gif"))); --- 48,52 ---- private JButton btnNewPC = new JButton(new ImageIcon(cl.getResource("images/simulation/PC_small.gif"))); private JButton btnNewRouter = new JButton(new ImageIcon(cl.getResource("images/simulation/router_small.gif"))); ! private JButton btnNewSwitch = new JButton(new ImageIcon(cl.getResource("images/simulation/switch_small.gif"))); private JButton btnNewHub = new JButton(new ImageIcon(cl.getResource("images/simulation/hub_small.gif"))); private JButton btnNewLink = new JButton(new ImageIcon(cl.getResource("images/simulation/link.gif"))); *************** *** 82,86 **** btnNewRouter.setToolTipText("Creats a new Router"); btnNewLink.setToolTipText("Creates a new Link between two nodes"); ! //btnNewSwitch.setToolTipText("Creates a new Switch"); btnNewHub.setToolTipText("Creates a new Hub"); --- 82,86 ---- btnNewRouter.setToolTipText("Creats a new Router"); btnNewLink.setToolTipText("Creates a new Link between two nodes"); ! btnNewSwitch.setToolTipText("Creates a new Switch"); btnNewHub.setToolTipText("Creates a new Hub"); *************** *** 89,93 **** btnNewRouter.setBorderPainted(false); btnNewLink.setBorderPainted(false); ! //btnNewSwitch.setBorderPainted(false); btnNewHub.setBorderPainted(false); --- 89,93 ---- btnNewRouter.setBorderPainted(false); btnNewLink.setBorderPainted(false); ! btnNewSwitch.setBorderPainted(false); btnNewHub.setBorderPainted(false); *************** *** 120,134 **** //Set action listener for Switch toolbar item ! /* btnNewSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ ! JOptionPane.showMessageDialog(null,"Sorry switches are not yet implemented.","Switch Dialog Message", ! JOptionPane.INFORMATION_MESSAGE); ! //setHighlightsOff(); //Clean out any buttons that may have been highlighted previously. ! //highlightButton(btnNewSwitch, true); ! //controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! */ btnNewLink.addActionListener(new ActionListener(){ --- 120,132 ---- //Set action listener for Switch toolbar item ! btnNewSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ ! setHighlightsOff(); //Clean out any buttons that may have been highlighted previously. ! highlightButton(btnNewSwitch, true); ! controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! btnNewLink.addActionListener(new ActionListener(){ *************** *** 144,149 **** this.add(btnNewPC); this.add(btnNewRouter); - //this.add(btnNewSwitch); this.add(btnNewHub); this.add(btnNewLink); } --- 142,147 ---- this.add(btnNewPC); this.add(btnNewRouter); this.add(btnNewHub); + this.add(btnNewSwitch); this.add(btnNewLink); } *************** *** 195,199 **** btnNewPC.setBackground(deactivatedColor); btnNewRouter.setBackground(deactivatedColor); ! //btnNewSwitch.setBackground(deactivatedColor); btnNewHub.setBackground(deactivatedColor); btnNewLink.setBackground(deactivatedColor); --- 193,197 ---- btnNewPC.setBackground(deactivatedColor); btnNewRouter.setBackground(deactivatedColor); ! btnNewSwitch.setBackground(deactivatedColor); btnNewHub.setBackground(deactivatedColor); btnNewLink.setBackground(deactivatedColor); |