Package commands

Class CmdBringToFront

  • All Implemented Interfaces:
    Command

    public class CmdBringToFront
    extends java.lang.Object
    implements Command
    Class that represent command to bring some shape to the front.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()
      Get index of shape, remove it from that place and add it to the last place.
      void unexecute()
      Remove shape from last place and return it to the previous (original) position.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • shape

        private Shape shape
      • size

        private int size
      • index

        private int index
    • Constructor Detail

      • CmdBringToFront

        public CmdBringToFront​(DrawingModel model,
                               Shape shape,
                               int size)
    • Method Detail

      • execute

        public void execute()
        Get index of shape, remove it from that place and add it to the last place.
        Specified by:
        execute in interface Command
      • unexecute

        public void unexecute()
        Remove shape from last place and return it to the previous (original) position.
        Specified by:
        unexecute in interface Command