Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Designing Graphical ObjectsDesigning Graphical Objects The ‘divide.

Similar presentations


Presentation on theme: "March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Designing Graphical ObjectsDesigning Graphical Objects The ‘divide."— Presentation transcript:

1 March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Designing Graphical ObjectsDesigning Graphical Objects The ‘divide and conquer’ strategyThe ‘divide and conquer’ strategy

2 March 2005 2R. Smith - University of St Thomas - Minnesota Divide and Conquer How do you solve a big problem?How do you solve a big problem? How do we build a big program?How do we build a big program?

3 March 2005 3R. Smith - University of St Thomas - Minnesota Breaking up a GUI into pieces Take an example…Take an example… What pieces make sense?What pieces make sense? What do the pieces do?What do the pieces do?

4 March 2005 4R. Smith - University of St Thomas - Minnesota Bagel House Example: Chapter 7 Order CalculatorOrder Calculator Choose type/flavor of bagel’Choose type/flavor of bagel’ –Radio Buttons Choose ToppingsChoose Toppings –Check Boxes Choose type of CoffeeChoose type of Coffee –Radio Buttons Push “Calculate” or “Exit”Push “Calculate” or “Exit” –Should generate an order for the bagel jockey –Should generate a cost for the register clerk

5 March 2005 5R. Smith - University of St Thomas - Minnesota Design Questions What objects do we need?What objects do we need? –What do the classes ‘extend’? How do the objects relate to panels?How do the objects relate to panels? What do the Constructors do?What do the Constructors do? Do we need Getters and/or Setters?Do we need Getters and/or Setters?

6 March 2005 6R. Smith - University of St Thomas - Minnesota Hierarchies are your Friend Top Level – the window itselfTop Level – the window itself –This is the window’s own instance Next level – individual panelsNext level – individual panels –Welcome (on top/north region) –Bagels (west) –Toppings (center) –Buttons (south) Bottom level – items within a panelBottom level – items within a panel –They exist within their panel objects

7 March 2005 7R. Smith - University of St Thomas - Minnesota Possible Object Classes Ordering WindowOrdering Window –Include any ‘simple’ frames Classes to collect complicated dataClasses to collect complicated data –Extend JPanel –Getters will extract order/cost information Answers computed when “Calculate” pressedAnswers computed when “Calculate” pressed –The only real ‘event’ –Calls ‘getters’ of other classes to get the information

8 March 2005 8R. Smith - University of St Thomas - Minnesota That’s it. Questions?Questions? Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Designing Graphical ObjectsDesigning Graphical Objects The ‘divide."

Similar presentations


Ads by Google