Back to index

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

Command to group the selection into a GroupFigure. More...

Inheritance diagram for CH.ifa.draw.figures.GroupCommand:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.figures.GroupCommand:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GroupCommand (String name, DrawingView view)
 Constructs a group command.
void execute ()
 Executes the command.
boolean isExecutable ()
 Tests if the command can be executed.
String name ()
 Gets the command name.

Private Attributes

DrawingView fView

Detailed Description

Command to group the selection into a GroupFigure.

See also:
GroupFigure

Definition at line 18 of file GroupCommand.java.


Constructor & Destructor Documentation

CH.ifa.draw.figures.GroupCommand.GroupCommand ( String  name,
DrawingView  view 
) [inline]

Constructs a group command.

Parameters:
namethe command name
viewthe target view

Definition at line 27 of file GroupCommand.java.

                                                       {
        super(name);
        fView = view;
    }

Member Function Documentation

void CH.ifa.draw.figures.GroupCommand.execute ( ) [inline, virtual]

Executes the command.

Implements CH.ifa.draw.util.Command.

Definition at line 32 of file GroupCommand.java.

                          {
        Vector selected = fView.selectionZOrdered();
        Drawing drawing = fView.drawing();
        if (selected.size() > 0) {
            fView.clearSelection();
            drawing.orphanAll(selected);

            GroupFigure group = new GroupFigure();
            group.addAll(selected);
            fView.addToSelection(drawing.add(group));
        }
        fView.checkDamage();
    }

Here is the caller graph for this function:

Tests if the command can be executed.

Reimplemented from CH.ifa.draw.util.Command.

Definition at line 46 of file GroupCommand.java.

                                  {
        return fView.selectionCount() > 0;
    }
String CH.ifa.draw.util.Command.name ( ) [inline, inherited]

Gets the command name.

Definition at line 53 of file Command.java.

                         {
        return fName;
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 20 of file GroupCommand.java.


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