Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

DeleteLineDialog Class Reference

Inheritance diagram for DeleteLineDialog::

ActionListener List of all members.

Public Methods

 DeleteLineDialog (ActionListener action_listener)
void actionPerformed (ActionEvent event)

Private Attributes

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

Detailed Description

Delete line dialog. For each line both node ends must be defined, otherwise line is not uniquely indentifiable.

Definition at line 957 of file Simulation.java.


Constructor & Destructor Documentation

DeleteLineDialog::DeleteLineDialog ( ActionListener action_listener ) [inline]
 

Default constructor. Reference to network panel is required.

Parameters:
action_listener   Reference to action listener.

Definition at line 992 of file Simulation.java.

00993     {
00994         this.action_listener = action_listener;
00995 
00996         dummy = new Frame();
00997         delete_line = new Dialog(dummy, "Obri\u0161i liniju");
00998         button_ok = new Button("U redu");
00999         button_cancel = new Button("Odustani");
01000         left_field = new TextField("ime", 30);
01001         right_field = new TextField("ime", 30);
01002 
01003         Label left_label = new Label("Lijevi \u010dvor", Label.RIGHT);
01004         Label right_label = new Label("Desni \u010dvor", Label.RIGHT);
01005 
01006         delete_line.setLayout(new BorderLayout());
01007         delete_line.setLayout(new GridLayout(3,2));
01008         delete_line.add(left_label);
01009         delete_line.add(left_field);
01010         delete_line.add(right_label);
01011         delete_line.add(right_field);
01012         delete_line.add(button_ok);
01013         delete_line.add(button_cancel);
01014 
01015         right_field.addActionListener(this);
01016         left_field.addActionListener(this);
01017         button_ok.addActionListener(this);
01018         button_cancel.addActionListener(this);
01019 
01020         delete_line.pack();
01021         delete_line.setResizable(false);
01022         delete_line.show();
01023     }


Member Function Documentation

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

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

Definition at line 1029 of file Simulation.java.

01030     {
01031         Object source = event.getSource();
01032 
01033         /*  left_field event */
01034         if (source == left_field)
01035             {
01036                 left_name = left_field.getText();
01037             }
01038         /*  right_field event */
01039         if (source == right_field)
01040             {
01041                 right_name = right_field.getText();
01042             }
01043         /*  capacity event */
01044         if (source == button_ok)
01045             {
01046                 left_name = left_field.getText();
01047                 right_name = right_field.getText();
01048                 delete_line.dispose();
01049                 action_listener.actionPerformed(new ActionEvent(this, 1, "OK"));
01050             }
01051         /*  button_cancel event */
01052         if (source == button_cancel)
01053             {
01054                 delete_line.dispose();
01055                 action_listener.actionPerformed(new ActionEvent(this, 0, "Cancel"));
01056             }
01057     }


Member Data Documentation

ActionListener DeleteLineDialog::action_listener [private]
 

Action listener.

Definition at line 962 of file Simulation.java.

Button DeleteLineDialog::button_cancel [private]
 

Add line Cancel button.

Definition at line 971 of file Simulation.java.

Button DeleteLineDialog::button_ok [private]
 

Add line OK button.

Definition at line 968 of file Simulation.java.

Dialog DeleteLineDialog::delete_line [private]
 

Add line dialog box.

Definition at line 965 of file Simulation.java.

Frame DeleteLineDialog::dummy [private]
 

Dummy frame required to aviod null-parent exception.

Definition at line 986 of file Simulation.java.

TextField DeleteLineDialog::left_field [private]
 

Left node name field.

Definition at line 974 of file Simulation.java.

String DeleteLineDialog::left_name [private]
 

Left node name.

Definition at line 977 of file Simulation.java.

TextField DeleteLineDialog::right_field [private]
 

Right node name field.

Definition at line 980 of file Simulation.java.

String DeleteLineDialog::right_name [private]
 

Right node name.

Definition at line 983 of file Simulation.java.


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