Package commands

Class CmdUpdateSquare

  • All Implemented Interfaces:
    Command

    public class CmdUpdateSquare
    extends java.lang.Object
    implements Command
    Class that represent command for update existing square from the draw.
    • Field Detail

      • oldState

        private Square oldState
      • newState

        private Square newState
      • originalState

        private Square originalState
    • Constructor Detail

      • CmdUpdateSquare

        public CmdUpdateSquare​(Square oldState,
                               Square newState)
    • Method Detail

      • execute

        public void execute()
        Update square.
        Specified by:
        execute in interface Command
      • unexecute

        public void unexecute()
        Undo previous updating and return square to the original values.
        Specified by:
        unexecute in interface Command