Back to index

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

Common base clase for commands that transfer figures between a drawing and the clipboard. More...

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

List of all members.

Public Member Functions

abstract void execute ()
 Executes the command.
boolean isExecutable ()
 Tests if the command can be executed.
String name ()
 Gets the command name.

Protected Member Functions

 FigureTransferCommand (String name, DrawingView view)
 Constructs a drawing command.
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

Common base clase for commands that transfer figures between a drawing and the clipboard.

Definition at line 16 of file FigureTransferCommand.java.


Constructor & Destructor Documentation

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

Constructs a drawing command.

Parameters:
namethe command name
viewthe target view

Definition at line 25 of file FigureTransferCommand.java.

                                                                   {
        super(name);
        fView = view;
    }

Member Function Documentation

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:

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:

abstract void CH.ifa.draw.util.Command.execute ( ) [pure virtual, inherited]
void CH.ifa.draw.standard.FigureTransferCommand.insertFigures ( Vector  figures,
int  dx,
int  dy 
) [inline, protected]

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:

boolean CH.ifa.draw.util.Command.isExecutable ( ) [inline, inherited]
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 18 of file FigureTransferCommand.java.


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