Back to index

moin  1.9.0~rc2
Public Member Functions | Private Attributes
CH.ifa.draw.util.CommandButton Class Reference

A Command enabled button. More...

Inheritance diagram for CH.ifa.draw.util.CommandButton:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.util.CommandButton:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CommandButton (Command command)
 Initializes the button with the given command.
void actionPerformed (ActionEvent e)
 Executes the command.

Private Attributes

Command fCommand

Detailed Description

A Command enabled button.

Clicking the button executes the command.

See also:
Command

Definition at line 19 of file CommandButton.java.


Constructor & Destructor Documentation

Initializes the button with the given command.

The command's name is used as the label.

Definition at line 28 of file CommandButton.java.

                                          {
       super(command.name());
       fCommand = command;
       addActionListener(this);
    }

Here is the call graph for this function:


Member Function Documentation

void CH.ifa.draw.util.CommandButton.actionPerformed ( ActionEvent  e) [inline]

Executes the command.

If the command's name was changed as a result of the command the button's label is updated accordingly.

Definition at line 39 of file CommandButton.java.

                                               {
        fCommand.execute();
        if (!getLabel().equals(fCommand.name()) ) {
            setLabel(fCommand.name());
        }
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 22 of file CommandButton.java.


The documentation for this class was generated from the following file: