Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

TracerouteDialog Class Reference

Inheritance diagram for TracerouteDialog::

ActionListener List of all members.

Public Methods

 TracerouteDialog (ActionListener action_listener)
void actionPerformed (ActionEvent event)

Private Attributes

ActionListener action_listener
Dialog traceroute
Button button_ok
Button button_cancel
TextField left_field
String left_name
TextField right_field
String right_name
Frame dummy

Detailed Description

Traceroute dialog. For each route both source node and destination node must be defined, otherwise route is not uniquely indentifiable.

Definition at line 1164 of file Simulation.java.


Constructor & Destructor Documentation

TracerouteDialog::TracerouteDialog ( ActionListener action_listener ) [inline]
 

Default constructor. Reference to network panel is required.

Parameters:
action_listener   Reference to action listener.

Definition at line 1199 of file Simulation.java.

01200     {
01201         this.action_listener = action_listener;
01202 
01203         dummy = new Frame();
01204         traceroute = new Dialog(dummy, "Pra\u0107enje paketa");
01205         button_ok = new Button("U redu");
01206         button_cancel = new Button("Odustani");
01207         left_field = new TextField("ime", 30);
01208         right_field = new TextField("ime", 30);
01209 
01210         Label left_label = new Label("Po\u010detni \u010dvor", Label.RIGHT);
01211         Label right_label = new Label("Kona\u010dni \u010dvor", Label.RIGHT);
01212 
01213         traceroute.setLayout(new BorderLayout());
01214         traceroute.setLayout(new GridLayout(3,2));
01215         traceroute.add(left_label);
01216         traceroute.add(left_field);
01217         traceroute.add(right_label);
01218         traceroute.add(right_field);
01219         traceroute.add(button_ok);
01220         traceroute.add(button_cancel);
01221 
01222         right_field.addActionListener(this);
01223         left_field.addActionListener(this);
01224         button_ok.addActionListener(this);
01225         button_cancel.addActionListener(this);
01226 
01227         traceroute.pack();
01228         traceroute.setResizable(false);
01229         traceroute.show();
01230     }


Member Function Documentation

void TracerouteDialog::actionPerformed ( ActionEvent event ) [inline]
 

Action handler. Wait for OK or Cancel button and then reads input and terminates dialog.

Definition at line 1236 of file Simulation.java.

01237     {
01238         Object source = event.getSource();
01239 
01240         /*  left_field event */
01241         if (source == left_field)
01242             {
01243                 left_name = left_field.getText();
01244             }
01245         /*  right_field event */
01246         if (source == right_field)
01247             {
01248                 right_name = right_field.getText();
01249             }
01250         /*  capacity event */
01251         if (source == button_ok)
01252             {
01253                 left_name = left_field.getText();
01254                 right_name = right_field.getText();
01255                 traceroute.dispose();
01256                 action_listener.actionPerformed(new ActionEvent(this, 1, "OK"));
01257             }
01258         /*  button_cancel event */
01259         if (source == button_cancel)
01260             {
01261                 traceroute.dispose();
01262                 action_listener.actionPerformed(new ActionEvent(this, 0, "Cancel"));
01263             }
01264     }


Member Data Documentation

ActionListener TracerouteDialog::action_listener [private]
 

Action listener.

Definition at line 1169 of file Simulation.java.

Button TracerouteDialog::button_cancel [private]
 

Traceroute Cancel button.

Definition at line 1178 of file Simulation.java.

Button TracerouteDialog::button_ok [private]
 

Traceroute OK button.

Definition at line 1175 of file Simulation.java.

Frame TracerouteDialog::dummy [private]
 

Dummy frame required to aviod null-parent exception.

Definition at line 1193 of file Simulation.java.

TextField TracerouteDialog::left_field [private]
 

Left node name field.

Definition at line 1181 of file Simulation.java.

String TracerouteDialog::left_name [private]
 

Left node name.

Definition at line 1184 of file Simulation.java.

TextField TracerouteDialog::right_field [private]
 

Right node name field.

Definition at line 1187 of file Simulation.java.

String TracerouteDialog::right_name [private]
 

Right node name.

Definition at line 1190 of file Simulation.java.

Dialog TracerouteDialog::traceroute [private]
 

Traceroute dialog box.

Definition at line 1172 of file Simulation.java.


The documentation for this class was generated from the following file:
Generated at Thu Jun 28 03:04:24 2001 for Cyclops Network Simulator by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001