User Interface with Java Tutorial 2 - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

User Interface with Java Tutorial 2

Description:

Need to store the poll open/close information. Need to store the update ... Promulgate events to other interested listeners. Only Translation handles events! 5 ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 16
Provided by: robert306
Category:

less

Transcript and Presenter's Notes

Title: User Interface with Java Tutorial 2


1
User Interface with JavaTutorial 2
  • CSPP 51041
  • Summer 2003
  • 530PM,July 31th
  • Ryerson 251

2
Todays Topics
  • A Voting System
  • PTA architecture
  • Java Swing
  • Event multicast and custom events
  • Observer and MVC patterns

3
Application
  • Need to store votes and candidate information
  • Vector
  • Hashtable
  • Need to store the poll open/close information
  • Need to store the update rate information
  • Use Timer to trigger the update ActionEvent

4
Translation
  • Listen to multiple events from multi-sources
  • System events
  • ActionEvent
  • ChangeEvent
  • Custom events
  • CandidateEvent
  • VoteEvent
  • TrackingEvent
  • Aggregate Application as a variable
  • Promulgate events to other interested listeners
  • Only Translation handles events!

5
Presentation
  • Contain multiple objects
  • Polling booth objects (1..n)
  • Tracking station objects (1..n)
  • Control Panel (1)
  • Each object listens to several events from
    Translation

6
Presentation Polling Booth
  • Initial state
  • State with candidate added (disabled)
  • State with candidate added (enabled)

7
Presentation Tracking Station
  • Initial state
  • State with candidate(s) voted

8
Presentation Control Panel
  • Initial state
  • Open state
  • Close state

9
Composite Event Multicast Model
10
ActionEvent Model 1
  • ActionEvents from ControlPanel
  • Open_Poll
  • Close_Poll
  • Application function called at Translation
  • Do sth to open poll or close poll
  • ActionEvent re-fired at Translation

11
ActionEvent Model 2
  • ActionEvents from ControlPanel
  • Remove_Candidate
  • Reset_Candidate
  • Update
  • Application function called at Translation
  • Remove candidates
  • Reset votes
  • TrackingEvent fired at Translation
  • ActionEvent fired at Translation for
    Remove_Candidate

12
ActionEvent Model 3
  • ActionEvent from application
  • Update
  • Fired by timer
  • TrackingEvent fired at Translation

13
ChangeEvent Model
  • ChangeEvent from ControlPanel
  • Change_Updaterate
  • Application function called at Translation
  • Stop timer if rate60
  • Start timer otherwise
  • ActionEvent(Update) fired if timer started

14
CandidateEvent Model
  • CandidateEvents from ControlPanel
  • Add_Candidate
  • Application function called at Translation
  • CandidateEvent re-fired at Translation
  • PollBooth adds new button

15
VoteEvent Model
  • VoteEvent from PollBooth
  • Vote
  • Application function called at Translation
  • TrackingEvent fired at Translation if updaterate
    0
Write a Comment
User Comments (0)
About PowerShow.com