- package cn.edu.nju.software.grapheditor.cmd;
- import java.awt.Point;
- import cn.edu.nju.software.grapheditor.Drawing;
- import cn.edu.nju.software.grapheditor.shape.Shape;
- public class ColorCmd extends Command{
- public void executeClick(Point p, Drawing dwg) {
- Shape shape=dwg.getFrontmostContainer(p);
- if(shape!=null){
- shape.setColor(dwg.currentColor);
- }
- }
- }