类 AddShapeCommand

java.lang.Object
com.example.graphics.command.AddShapeCommand
所有已实现的接口:
Command

public class AddShapeCommand extends Object implements Command
Command for adding a shape to a collection. This is an implementation of the Command pattern.
  • 字段详细资料

    • shapes

      private final List<Shape> shapes
    • shape

      private final Shape shape
  • 构造器详细资料

    • AddShapeCommand

      public AddShapeCommand(List<Shape> shapes, Shape shape)
      Constructor for the AddShapeCommand
      参数:
      shapes - the collection of shapes to modify
      shape - the shape to add
  • 方法详细资料

    • execute

      public void execute()
      从接口复制的说明: Command
      Execute the command
      指定者:
      execute 在接口中 Command
    • undo

      public void undo()
      从接口复制的说明: Command
      Undo the command
      指定者:
      undo 在接口中 Command