Advertisement
AishaAli

Untitled

Nov 19th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2. /*
  3. @(#)DuplicateCommand.java 5.2
  4. */
  5.  
  6. package CH.ifa.draw.standard;
  7.  
  8. import java.util.*;
  9. import CH.ifa.draw.util.*;
  10. import CH.ifa.draw.framework.*;
  11.  
  12. public class DuplicateCommand extends FigureTransferCommand {
  13.  
  14. public DuplicateCommand(String name, DrawingView view) {
  15. super(name, view);
  16. }
  17.  
  18. public void execute() {
  19. FigureSelection selection = fView.getFigureSelection();
  20.  
  21. fView.clearSelection();
  22.  
  23. Vector figures = (Vector)selection.getData(FigureSelection.TYPE);
  24. insertFigures(figures, 10, 10);
  25. fView.checkDamage();
  26. }
  27.  
  28. public boolean isExecutable() {
  29. return fView.selectionCount() > 0;
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement