[Javanetsim-cvs] javaNetSim/guiUI MainScreen.java,1.31,1.32 SNMPSendDataDialog.java,1.1,1.2
Status: Beta
Brought to you by:
darkkey
From: QweR <qw...@us...> - 2006-02-22 20:04:41
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3906/guiUI Modified Files: MainScreen.java SNMPSendDataDialog.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MainScreen.java 22 Feb 2006 17:40:51 -0000 1.31 --- MainScreen.java 22 Feb 2006 20:04:27 -0000 1.32 *************** *** 3077,3081 **** String port = JOptionPane.showInputDialog(this, "Port:", "Set SNMP agent listening on port.", JOptionPane.QUESTION_MESSAGE); if(port!=null){ ! String password = JOptionPane.showInputDialog(this, "Password:","Set SNMP password for agent", JOptionPane.QUESTION_MESSAGE); if(password!=null) { try{ --- 3077,3081 ---- String port = JOptionPane.showInputDialog(this, "Port:", "Set SNMP agent listening on port.", JOptionPane.QUESTION_MESSAGE); if(port!=null){ ! String password = JOptionPane.showInputDialog(this, "Community name:","Set SNMP community name for agent", JOptionPane.QUESTION_MESSAGE); if(password!=null) { try{ Index: SNMPSendDataDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SNMPSendDataDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SNMPSendDataDialog.java 9 Feb 2006 23:18:24 -0000 1.1 --- SNMPSendDataDialog.java 22 Feb 2006 20:04:27 -0000 1.2 *************** *** 131,144 **** private void initGUI() { try { ! setSize(350, 225); backpanel = new JPanel(); ! backpanel.setMinimumSize(new Dimension(200, 10)); this.getContentPane().add(backpanel, BorderLayout.CENTER); GridBagLayout backpanelLayout = new GridBagLayout(); ! backpanel.setPreferredSize(new java.awt.Dimension(264, 213)); backpanelLayout.columnWeights = new double[] {}; ! backpanelLayout.columnWidths = new int[] {100,150}; backpanelLayout.rowWeights = new double[] {0.0}; ! backpanelLayout.rowHeights = new int[] {5,5,5,5}; backpanel.setLayout(backpanelLayout); --- 131,144 ---- private void initGUI() { try { ! setSize(500, 225); backpanel = new JPanel(); ! //backpanel.setMinimumSize(new Dimension(400, 100)); this.getContentPane().add(backpanel, BorderLayout.CENTER); GridBagLayout backpanelLayout = new GridBagLayout(); ! //backpanel.setPreferredSize(new Dimension(800, 200)); backpanelLayout.columnWeights = new double[] {}; ! backpanelLayout.columnWidths = new int[] {100,100,250}; backpanelLayout.rowWeights = new double[] {0.0}; ! backpanelLayout.rowHeights = new int[] {5,5,5,5,5}; backpanel.setLayout(backpanelLayout); *************** *** 185,194 **** txtVariables = new JTextField(); txtVariables.setEnabled(true); ! backpanel.add(txtVariables, new GridBagConstraints(1,3,1,1,0.0,1.0,GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); // ***** Password ***** lblPassword = new JLabel(); ! lblPassword.setText("Password"); backpanel.add(lblPassword, new GridBagConstraints(0,4,1,1,0.0,1.0,GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); --- 185,194 ---- txtVariables = new JTextField(); txtVariables.setEnabled(true); ! backpanel.add(txtVariables, new GridBagConstraints(1,3,2,1,0.0,1.0,GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); // ***** Password ***** lblPassword = new JLabel(); ! lblPassword.setText("Community name"); backpanel.add(lblPassword, new GridBagConstraints(0,4,1,1,0.0,1.0,GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); *************** *** 238,242 **** } else if(txtPassword.getText()==null || txtPassword.getText().compareTo("")==0) { ! lblError.setText("Enter password!"); lblError.setVisible(true); } --- 238,242 ---- } else if(txtPassword.getText()==null || txtPassword.getText().compareTo("")==0) { ! lblError.setText("Enter community name!"); lblError.setVisible(true); } *************** *** 247,262 **** String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! ((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText()); this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! ((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText()); this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! ((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText()); this.dispose(); } --- 247,268 ---- String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); ! } this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); ! } this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); ! } this.dispose(); } *************** *** 290,294 **** if(var_value.length==1) { String vari = deleteSpaces(var_value[0]); ! vars.add(vari); } else if(var_value.length==2) { --- 296,302 ---- if(var_value.length==1) { String vari = deleteSpaces(var_value[0]); ! if(var_value[0].compareTo("")!=0) { ! vars.add(vari); ! } } else if(var_value.length==2) { |