Back to index

moin  1.9.0~rc2
DuplicateCommand.java
Go to the documentation of this file.
00001 /*
00002  * @(#)DuplicateCommand.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.standard;
00007 
00008 import java.util.*;
00009 import CH.ifa.draw.util.*;
00010 import CH.ifa.draw.framework.*;
00011 
00015 public class DuplicateCommand extends FigureTransferCommand {
00016 
00022     public DuplicateCommand(String name, DrawingView view) {
00023         super(name, view);
00024     }
00025 
00026     public void execute() {
00027         FigureSelection selection = fView.getFigureSelection();
00028 
00029         fView.clearSelection();
00030 
00031         Vector figures = (Vector)selection.getData(FigureSelection.TYPE);
00032         insertFigures(figures, 10, 10);
00033         fView.checkDamage();
00034     }
00035 
00036     public boolean isExecutable() {
00037         return fView.selectionCount() > 0;
00038     }
00039 
00040 }
00041 
00042