Class TranslationYCommand

    • Field Detail

      • oldLength

        protected int oldLength
      • newLength

        protected int newLength
      • resize

        protected boolean resize
    • Constructor Detail

      • TranslationYCommand

        public TranslationYCommand​(CommandManager commandManager,
                                   ArrayList<Element> elements)
        Constructor
        Parameters:
        commandManager - - The command manager
        elements - - The array list for the elements
    • Method Detail

      • move

        public void move​(int y)
        Move elements by (0, y). This method can be called repeatedly as long as the translation has not been committed. The elements are actually moved, so change events are propagated.
      • resizeIfNecessary

        public void resizeIfNecessary​(ViewWorkAround view)
      • doCancel

        protected void doCancel()
        Undo the translation. All elements are moved back to their original position. The translation can only be cancelled as long as it has not been committed.
        Overrides:
        doCancel in class TranslationCommand