GEOG178/258 Week8 - GitHub Pages

14
GEOG 178/258 Week 8: Model Viewer Controller: MVC mike johnson

Transcript of GEOG178/258 Week8 - GitHub Pages

Page 1: GEOG178/258 Week8 - GitHub Pages

GEOG 178/258Week 8:

Model Viewer Controller: MVC

mike johnson

Page 2: GEOG178/258 Week8 - GitHub Pages

Model View Controller

Page 3: GEOG178/258 Week8 - GitHub Pages

Model View Controller

Abstraction of Reality

How our model is communicated

How our model is updated:(timestep or user input)

Page 4: GEOG178/258 Week8 - GitHub Pages

1) What are we trying to model? (Movement, physical process, behavior…?)

2) What is the abstraction we are interested in?

3) How will we represent the pieces in the most basic form (think back to the ‘essence’ of the object)

4) What classes can we inherit and which need to be built?

Model View Controller

Page 5: GEOG178/258 Week8 - GitHub Pages

1) How will results communicated? (Map, plot, text…)

2) What aspects of the model are we interested in as ‘results’

Model View Controller

Page 6: GEOG178/258 Week8 - GitHub Pages

1) How will the model run? (timesteps, user input, single case…)

Model View Controller

Page 7: GEOG178/258 Week8 - GitHub Pages

Member Variables

PaintComponent

Listeners

Model View Controller

Page 8: GEOG178/258 Week8 - GitHub Pages

Model View Controller: Signature

ViewModel Controller

Page 9: GEOG178/258 Week8 - GitHub Pages

Model View Controller: Code

View

Model

Controller

Page 10: GEOG178/258 Week8 - GitHub Pages

Model View Controller: Visual

View

Model

Controller

Page 11: GEOG178/258 Week8 - GitHub Pages

Model View Controller: Homework

Model View Controller

Page 12: GEOG178/258 Week8 - GitHub Pages

Model:POIs: Have names, and can be visited (Extend PointBuffer?)Paths: Can visit POIs and be reset (PolyLine)

Viewer: Map (campus.png; g.drawImage())POI (w and w/o names) (g.fillOval(x,y))Path (d.drawLine(x1,y1,x2,y2)

Controller: Clicks let you draw new points, and name existing points (MouseListener)Path can be reset (ActionListener?)

HW MVC

Page 13: GEOG178/258 Week8 - GitHub Pages

In Class Examples

Page 14: GEOG178/258 Week8 - GitHub Pages

Homework