indexing description: "[ Command for setting rectangle properties. ]" date: "$Date$" revision: "$Revision$" class RESIZE_RECTANGLE inherit COMMAND create make feature -- Initialization make is -- creation procedure. do end feature {HISTORY} -- Access execute (args: TUPLE) is -- resize a RETANGLE object -- args.item (1) :: rectangle: RECTANGLE -- args.item (2) :: point_a_before: EM_VECTOR -- args.item (3) :: point_b_before: EM_VECTOR -- args.item (4) :: point_a_after: EM_VECTOR -- args.item (5) :: point_b_after: EM_VECTOR local v1, v2, v3, v4: EM_VECTOR_2D do execute_successful := False if args.count = 5 then rectangle ?= args.item (1) v1 ?= args.item (2) v2 ?= args.item (3) v3 ?= args.item (4) v4 ?= args.item (5) if rectangle /= Void and v1 /= Void and v2 /= Void and v3 /= Void and v4 /= Void then create point_a_before.make_from_other (v1) create point_b_before.make_from_other (v2) create point_a_after.make_from_other (v3) create point_b_after.make_from_other (v4) rectangle.set_new_true_size (point_a_after, point_b_after) rectangle.set_changed rectangle.recreate_collidable execute_successful := True end end end undo (args: TUPLE) is -- Undo command require else rectangle_not_void: rectangle /= Void do rectangle.set_new_true_size (point_a_before, point_b_before) rectangle.set_changed rectangle.recreate_collidable execute_successful := False undo_successful := True redo_successful := False end redo (args: TUPLE) is -- Redo command require else rectangle_not_void: rectangle /= Void do rectangle.set_new_true_size (point_a_after, point_b_after) rectangle.set_changed rectangle.recreate_collidable execute_successful := False undo_successful := False redo_successful := True end name: STRING is "resize rectangle" -- The name of the current command feature -- Implementation rectangle: RECTANGLE -- reference to the rectangle point_a_before, point_b_before, point_a_after, point_b_after: EM_VECTOR_2D -- backups end