Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

DeleteNodeDialog Class Reference

Inheritance diagram for DeleteNodeDialog::

ActionListener List of all members.

Public Methods

 DeleteNodeDialog (ActionListener action_listener)
void actionPerformed (ActionEvent event)

Private Attributes

ActionListener action_listener
Dialog delete_node
Button button_ok
Button button_cancel
TextField node_field
String node_name
Frame dummy

Detailed Description

Delete node dialog. If node with given name does not exist, amazingly, nothing happenes.

Definition at line 1069 of file Simulation.java.


Constructor & Destructor Documentation

DeleteNodeDialog::DeleteNodeDialog ( ActionListener action_listener ) [inline]
 

Default constructor. Reference to network panel is required.

Parameters:
action_listener   Reference to action listener.

Definition at line 1098 of file Simulation.java.

01099     {
01100         this.action_listener = action_listener;
01101 
01102         dummy = new Frame();
01103         delete_node = new Dialog(dummy, "Obri\u0161i \u010dvor");
01104         button_ok = new Button("U redu");
01105         button_cancel = new Button("Odustani");
01106         node_field = new TextField("ime", 30);
01107 
01108         Label node_label = new Label("Ime \u010dvora", Label.RIGHT);
01109 
01110         delete_node.setLayout(new BorderLayout());
01111         delete_node.setLayout(new GridLayout(2,2));
01112         delete_node.add(node_label);
01113         delete_node.add(node_field);
01114         delete_node.add(button_ok);
01115         delete_node.add(button_cancel);
01116 
01117         node_field.addActionListener(this);
01118         button_ok.addActionListener(this);
01119         button_cancel.addActionListener(this);
01120 
01121         delete_node.pack();
01122         delete_node.setResizable(false);
01123         delete_node.show();
01124     }


Member Function Documentation

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

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

Definition at line 1130 of file Simulation.java.

01131     {
01132         Object source = event.getSource();
01133 
01134         /*  node_field event */
01135         if (source == node_field)
01136             {
01137                 node_name = node_field.getText();
01138             }
01139         /*  button_ok event */
01140         if (source == button_ok)
01141             {
01142                 node_name = node_field.getText();
01143                 delete_node.dispose();
01144                 action_listener.actionPerformed(new ActionEvent(this, 1, "OK"));
01145             }
01146         /*  button_cancel event */
01147         if (source == button_cancel)
01148             {
01149                 delete_node.dispose();
01150                 action_listener.actionPerformed(new ActionEvent(this, 0, "Cancel"));
01151             }
01152     }


Member Data Documentation

ActionListener DeleteNodeDialog::action_listener [private]
 

Action listener.

Definition at line 1074 of file Simulation.java.

Button DeleteNodeDialog::button_cancel [private]
 

Add node Cancel button.

Definition at line 1083 of file Simulation.java.

Button DeleteNodeDialog::button_ok [private]
 

Add node OK button.

Definition at line 1080 of file Simulation.java.

Dialog DeleteNodeDialog::delete_node [private]
 

Add node dialog box.

Definition at line 1077 of file Simulation.java.

Frame DeleteNodeDialog::dummy [private]
 

Dummy frame required to aviod null-parent exception.

Definition at line 1092 of file Simulation.java.

TextField DeleteNodeDialog::node_field [private]
 

Node name field.

Definition at line 1086 of file Simulation.java.

String DeleteNodeDialog::node_name [private]
 

Node name.

Definition at line 1089 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