Back to index

moin  1.9.0~rc2
Public Member Functions | Protected Member Functions | Protected Attributes
CH.ifa.draw.standard.DuplicateCommand Class Reference

Duplicate the selection and select the duplicates. More...

Inheritance diagram for CH.ifa.draw.standard.DuplicateCommand:
Inheritance graph
[legend]
Collaboration diagram for CH.ifa.draw.standard.DuplicateCommand:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Protected Member Functions

void deleteSelection ()
 Deletes the selection from the drawing.
void copySelection ()
 Copies the selection to the clipboard.
void insertFigures (Vector figures, int dx, int dy)
 Inserts a vector of figures and translates them by the given offset.

Protected Attributes

DrawingView fView

Detailed Description

Duplicate the selection and select the duplicates.

Definition at line 15 of file DuplicateCommand.java.


Constructor & Destructor Documentation

CH.ifa.draw.standard.DuplicateCommand.DuplicateCommand ( String  name,
DrawingView  view 
) [inline]

Constructs a duplicate command.

Parameters:
namethe command name
viewthe target view

Definition at line 22 of file DuplicateCommand.java.

                                                           {
        super(name, view);
    }

Member Function Documentation

void CH.ifa.draw.standard.FigureTransferCommand.copySelection ( ) [inline, protected, inherited]

Copies the selection to the clipboard.

Definition at line 41 of file FigureTransferCommand.java.

                                   {
        FigureSelection selection = fView.getFigureSelection();
        Clipboard.getClipboard().setContents(selection);
    }

Here is the caller graph for this function:

void CH.ifa.draw.standard.FigureTransferCommand.deleteSelection ( ) [inline, protected, inherited]

Deletes the selection from the drawing.

Definition at line 33 of file FigureTransferCommand.java.

                                     {
       fView.drawing().removeAll(fView.selection());
       fView.clearSelection();
    }

Here is the caller graph for this function:

Executes the command.

Implements CH.ifa.draw.util.Command.

Definition at line 26 of file DuplicateCommand.java.

                          {
        FigureSelection selection = fView.getFigureSelection();

        fView.clearSelection();

        Vector figures = (Vector)selection.getData(FigureSelection.TYPE);
        insertFigures(figures, 10, 10);
        fView.checkDamage();
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void CH.ifa.draw.standard.FigureTransferCommand.insertFigures ( Vector  figures,
int  dx,
int  dy 
) [inline, protected, inherited]

Inserts a vector of figures and translates them by the given offset.

Definition at line 50 of file FigureTransferCommand.java.

                                                                 {
        FigureEnumeration e = new FigureEnumerator(figures);
        while (e.hasMoreElements()) {
            Figure figure = e.nextFigure();
            figure = fView.add(figure);
            fView.addToSelection(figure);
        }
        fView.moveSelection(dx,dy);
    }

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 36 of file DuplicateCommand.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

DrawingView CH.ifa.draw.standard.FigureTransferCommand.fView [protected, inherited]

Definition at line 18 of file FigureTransferCommand.java.


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