Back to index

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

Copy the selection to the clipboard. More...

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

List of all members.

Public Member Functions

 CopyCommand (String name, DrawingView view)
 Constructs a copy 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

Copy the selection to the clipboard.

See also:
Clipboard

Definition at line 16 of file CopyCommand.java.


Constructor & Destructor Documentation

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

Constructs a copy command.

Parameters:
namethe command name
viewthe target view

Definition at line 23 of file CopyCommand.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:

void CH.ifa.draw.standard.CopyCommand.execute ( ) [inline, virtual]

Executes the command.

Implements CH.ifa.draw.util.Command.

Definition at line 27 of file CopyCommand.java.

                          {
        copySelection();
    }

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 31 of file CopyCommand.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: