indexing description: "[ Command for moving image panes. ]" date: "$Date$" revision: "$Revision$" class MOVE_IMAGE_PANE inherit COMMAND create make feature -- Initialization make is -- creation procedure. do end feature {HISTORY} -- Access execute (args: TUPLE) is -- move multiple image panes -- args.item (1) :: image_panes: DS_LINKED_LIST [IMAGE_PANE] -- args.item (2) :: move_vector: EM_VECTOR_2D local v: EM_VECTOR_2D cursor: DS_LINKED_LIST_CURSOR [IMAGE_PANE] p: DS_LINKED_LIST [IMAGE_PANE] do execute_successful := False if args.count = 2 then p ?= args.item (1) v ?= args.item (2) -- copy pane references to image_panes create image_panes.make create cursor.make (p) from cursor.start until cursor.off loop image_panes.force_last (cursor.item) cursor.forth end if image_panes /= Void and v /= Void and (v.x /= 0 or v.y /= 0) then dx := v.x dy := v.y create cursor.make (image_panes) from cursor.start until cursor.off loop cursor.item.set_true_x_y (cursor.item.true_x + dx, cursor.item.true_y + dy) cursor.forth end execute_successful := True end end end undo (args: TUPLE) is -- Undo command require else image_panes_not_void: image_panes /= Void local cursor: DS_LINKED_LIST_CURSOR [IMAGE_PANE] do create cursor.make (image_panes) from cursor.start until cursor.off loop cursor.item.set_true_x_y (cursor.item.true_x - dx, cursor.item.true_y - dy) cursor.forth end execute_successful := False undo_successful := True redo_successful := False end redo (args: TUPLE) is -- Redo command require else image_panes_not_void: image_panes /= Void local cursor: DS_LINKED_LIST_CURSOR [IMAGE_PANE] do create cursor.make (image_panes) from cursor.start until cursor.off loop cursor.item.set_true_x_y (cursor.item.true_x + dx, cursor.item.true_y + dy) cursor.forth end execute_successful := False undo_successful := False redo_successful := True end name: STRING is "move image panes" -- The nama of the current command feature -- Implementation image_panes: DS_LINKED_LIST [IMAGE_PANE] -- backup of the list of image panes dx, dy: DOUBLE -- movement vector end