Back to index

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

Delete the selection and move the selected figures to the clipboard. More...

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

List of all members.

Public Member Functions

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

Delete the selection and move the selected figures to the clipboard.

See also:
Clipboard

Definition at line 18 of file CutCommand.java.


Constructor & Destructor Documentation

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

Constructs a cut command.

Parameters:
namethe command name
viewthe target view

Definition at line 25 of file CutCommand.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.CutCommand.execute ( ) [inline, virtual]

Executes the command.

Implements CH.ifa.draw.util.Command.

Definition at line 29 of file CutCommand.java.

                          {
        copySelection();
        deleteSelection();
        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 35 of file CutCommand.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: