Presentation is loading. Please wait.

Presentation is loading. Please wait.

GTECH 731 Lab Session 6 10/12/10 Quiz Review Lab 5 Review Lab 6 Intro.

Similar presentations


Presentation on theme: "GTECH 731 Lab Session 6 10/12/10 Quiz Review Lab 5 Review Lab 6 Intro."— Presentation transcript:

1 GTECH 731 Lab Session 6 10/12/10 Quiz Review Lab 5 Review Lab 6 Intro

2 QUIZ REVIEW

3 Lab 5 – Object Orientation Created stand-alone, hierarchical Geometry Class Geometry Point Line LineString Each class has member variables Sub-classes share common elements from “Geometry” String “sName” and method “Draw” Have unique member variables to distinguish from other classes Point has “X” and “Y” variables Line has “start” and “end” Point objects LineString has “List” of Points Each class has methods Each class can draw itself Line and LineString have LineLength methods

4 Lab 6 – Basics of Object Oriented Create Self-contained classes (i.e., Geometry or other. Traffic?) Member variables (current state) Methods (actions, abilities) To access, create object by “instantiating” Class within Form To make your program work as you want it to, you manipulate objects as needed in Form code Instantiate objects in MouseDown or MouseUp event handlers depending on object Assign X,Y coordinates in MouseDown or MouseUp event handlers Call “Draw” method from picture box “Paint” handler Geometry.Geometry curShape = null; Geometry.Line myLine = new Geometry.Line(); Geometry.Point myPoint = new Geometry.Point();

5 Lab 6 – Overview Create interactive program using Geometry objects Create logic in Form that will allow you to add Points, Lines and LineLists Choose some mechanism to determine which object is being added at any given moment i.e., ComboBox, Button, Radio Button Logic will add particular object depending on state of selection object Will create a “shape layer” to hold objects of Geometry class Loop through “Shape Layer” list using each objects “Draw” method to redraw all objects Not step-by-step process as previous labs Have all the objects you need Know where certain functions should happen (i.e., MouseUp event handler) Think about what should happen with objects when mouse is clicked Have workable, sample code to build from


Download ppt "GTECH 731 Lab Session 6 10/12/10 Quiz Review Lab 5 Review Lab 6 Intro."

Similar presentations


Ads by Google