In a medium saucepan over low heat, mix the egg, sugar, flour, 1/2 can pineapple, margarine and vanilla extract. Slowly cook and stir until thickened. Pour into an 8x8 inch dish. Mix in the whipped topping. Chill in the refrigerator 1 hour, or until firm.
Dissolve the orange flavored gelatin mix in boiling water. Stir in remaining water. Chill in the refrigerator 1 hour, or until thick but not firm.
Mix bananas and remaining pineapple into the gelatin. Spread on top of the mixture in the dish. Chill in the refrigerator 3 hours, or until firm.