Back to index

moin  1.9.0~rc2
BringToFrontCommand.java
Go to the documentation of this file.
00001 /*
00002  * @(#)BringToFrontCommand.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.standard;
00007 
00008 import java.util.*;
00009 import CH.ifa.draw.util.Command;
00010 import CH.ifa.draw.framework.*;
00011 
00018 public class BringToFrontCommand
00019        extends Command {
00020 
00021     private DrawingView fView;
00022 
00028     public BringToFrontCommand(String name, DrawingView view) {
00029         super(name);
00030         fView = view;
00031     }
00032 
00033     public void execute() {
00034        FigureEnumeration k = new FigureEnumerator(fView.selectionZOrdered());
00035        while (k.hasMoreElements()) {
00036             fView.drawing().bringToFront(k.nextFigure());
00037         }
00038         fView.checkDamage();
00039     }
00040 
00041     public boolean isExecutable() {
00042         return fView.selectionCount() > 0;
00043     }
00044 }
00045 
00046