Back to index

moin  1.9.0~rc2
SendToBackCommand.java
Go to the documentation of this file.
00001 /*
00002  * @(#)SendToBackCommand.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 SendToBackCommand extends Command {
00016 
00017     private DrawingView fView;
00018 
00024     public SendToBackCommand(String name, DrawingView view) {
00025         super(name);
00026         fView = view;
00027     }
00028 
00029     public void execute() {
00030        FigureEnumeration k = new ReverseFigureEnumerator(fView.selectionZOrdered());
00031        while (k.hasMoreElements()) {
00032             fView.drawing().sendToBack(k.nextFigure());
00033         }
00034         fView.checkDamage();
00035     }
00036 
00037     public boolean isExecutable() {
00038         return fView.selectionCount() > 0;
00039     }
00040 
00041 }
00042 
00043