1 object-oriented programming (java), unit 24 stand in final project description kirk scott

41
1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

Upload: roger-morton

Post on 14-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

1

Object-Oriented Programming (Java), Unit 24 Stand InFinal Project Description

Kirk Scott

Page 2: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

2

Page 3: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

Bar-Tailed Godwit Migration

3

Page 4: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

Bar-Tailed Godwit

4

Page 5: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

Beak Feeding Adaptations

5

Page 6: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

CS 222 Final Programming Project, 130 Points Total

• ***Note that each student will be given layout specifications that differ in the number of cups and seeds, and whether the board is oriented horizontally or vertically on the screen.

• Your version of the final programming assignment has to conform to the specifications you are given.

6

Page 7: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

What's old:

• Your version of Togiz Kumalak should have a main frame that does not include the game board, with a menu including options to create a subframe and exit the application.

• Your version of Togiz Kumalak should have a subframe that does include the game board, with a menu including options to restart, load, save, and close the subframe.

7

Page 8: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• The structure of the frames and the menu options in the frames are a review of topics that were covered up through unit 23.

• You can just carry over code that you wrote before.

• Notice that the contents of the listeners for the menu items for the subframe will have to be changed.

8

Page 9: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• Your version of Togiz Kumalak should also have a text area recording the moves that have been made.

• This was introduced in unit 22, and to a large extent this can also just be carried along in the new code.

9

Page 10: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

What's new:

• Overall, your new version of Togiz Kumalak should have cups which are represented by instances of the JTextField class.

• The cups should have instances of the JButton class associated with them, and clicking one of these buttons should cause the corresponding cup to be played.

• Also, the text fields/buttons for the cups should be labeled on the screen with instances of the JLabel class.

10

Page 11: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• The visual components of the new application should be arranged using an instance of the GridLayout class for whatever panel contains the application components.

• There are other aspects of the new version which are not visual in nature.

11

Page 12: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• The specific parts of the assignment which will be noted when black box testing, and the points associated with them are listed below.

• The different graded items are listed in an order which you might find convenient to follow when working on the implementation.

12

Page 13: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

1. 40 points.

• Your version of Togiz Kumalak should have cups represented by text fields, identified by labels, and playable by clicking a button.

• The various components should appear in a neat rectangular layout.

• Since black box testing is used, I won't literally know if you used a grid layout, but only a crazy person would try to accomplish this without it.

• (This is material from units 25 and 26.)

13

Page 14: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• 1.a. The cups should be represented by text fields. 10 points

• 1.b. The cups should have matching labels. 10 points

• 1.c. The cups should have matching buttons for play. 10 points

• 1.d. The application should have a rectangular layout. 10 points

14

Page 15: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• If your implementation does not successfully do point 1, you are ineligible for any of the following points.

15

Page 16: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

2. 30 points.

• Your version of Togiz Kumalak should have all of these features which are based on previous work:

• 2.a. The game should still play correctly. This includes both moving and capturing seeds, as well has alternating active sides of the board. Note that the functionality is worth points separately from simply including (potentially non-functional) buttons as listed in question 2. 10 points 16

Page 17: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• 2.b. The application should be based on a main frame and a subframe. 10 points

• 2.c. It should have a JTextField that has the moves recorded in it. 10 points

17

Page 18: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• If your implementation does not successfully do point 2, you are ineligible for any of the following points.

18

Page 19: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

3. 30 points.

• Your version of Togiz Kumalak should have a subframe with a menu including options to restart, load, save, and close the subframe.

• The listeners for restart, load, and save will have to be changed from their previous versions in order to support the new form of the cups and board.

• The load and save options should make use of file choosers.

• (Note that this is a review of a topic that was covered up through unit 23.) 19

Page 20: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• 3.a. The subframe menu should have a restart option. 10 points

• 3.b. The subframe menu load and save options both have to work—when black box testing it's impossible to tell which is faulty if the functionality doesn’t work. 20 points total

20

Page 21: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

4. 10 points.

• Although not critical to the way Togiz Kumalak works, your version should include this aspect, which is based on the concept of focus:

• If you hit the enter key in one of the text fields representing a cup, the cursor (focus) should move to the next cup.

21

Page 22: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• This should be set up so that you could go all the way around the board this way (in play order).

• Once you understand this, it turns out to be a very simple addition to the code. (This is material from unit 27.)

• 4.a. The application should pass focus from cup to cup. 10 points

22

Page 23: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

5. 20 points.

• Your version of Togiz Kumalak should be playable by using keystrokes as well as clicking buttons.

• It is possible to do this using the ideas from unit 22.

• (If so, you should add the method requestFocus() to your bag of tricks.)

• It is also possible to do this using the new material from unit 28.

23

Page 24: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• In general, the application should be keeping track of whose turn it is, and all that's necessary is for the user to specify the desired cup by entering a keystroke like '1', '2', etc., or if following the model from unit 28, a combination of keystrokes, like 'CTRL+1'.

• It is necessary to let me know what keystroke convention I am supposed to use when testing your code. 24

Page 25: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• 5.a. Although this is only one part, it may require a significant effort to get it to work correctly, so it is worth double, 20 points. If your program accepts keystrokes and then button clicks, but after that the keystrokes are inactivated, that's worth 10 points.

• A full 20 points will be given if you can alternate seamlessly between keystrokes and button clicks. 25

Page 26: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• Notice that you do not have to create a UML diagram for your solution.

• Following the screenshots of the application, UML diagrams are given for a working solution to the problem.

• You are not obligated to follow the design given by those diagrams.

• Also, depending on the specific layout of the version you have been given, that design may not be entirely appropriate. 26

Page 27: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• The UML diagrams are given for two reasons.

• 1. They might help you design your own solution.

• 2. Whether they are helpful as a guide to writing a solution or not, they serve as notice to you of the complexity of project.

27

Page 28: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• It is important for you to have a grasp of the complexity involved so that you start working on a solution right away and don't put it off too long.

• Having the UML diagrams as a guide might save you from having to massively redesign or recode your project if you run into trouble.

28

Page 29: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• On the other hand, the diagrams might not save you from that eventuality.

• You should understand that large-scale problems like that are possible, and budget the time for them in case they happen.

29

Page 30: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• When you hand in your final code, it should not be a guessing game on my part as to which parts of the assignment you did.

• You have to tell me up front which of the 11 subpoints above I should be looking for when grading.

30

Page 31: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• If you didn't do one or didn't get one to work, it would be a great courtesy if you let me know so that I won't be looking for things that don't exist.

• Also, as noted under point 5, you need to let me know what keystroke convention to use if you did that part.

• The grading checkoff sheet is appended at the end of this document for your reference. 31

Page 32: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• These screenshots show what my solution to the problem looked like.

32

Page 33: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

This is the main frame:

33

Page 34: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

This is the subframe:

34

Page 35: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

• UML diagrams for a solution are given on the following overheads.

35

Page 36: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

36

WariV12

JFrame WariFrame WindowCloser

JMenuBar

JMenu

JMenuItem JMenuItem

MakeSubFrameListener ExitListener

WariSubFrameJFrame

1

1

1

1

11

1 11

«interface»WindowAdapter

«interface»ActionListener

«interface»ActionListener

Page 37: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

37

JFrame

WariSubFrame

JFileChooser

JMenuBar Container BoardV12

JPanelJMenu

JMenuItemJMenuItem JMenuItem JMenuItem

CloseListener RestartListener SaveListener LoadListener

1

11

1

111

1

1 1

1

1 1 1 1

ActionListener ActionListener ActionListener ActionListener

Page 38: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

38

BoardV12

JPanel

JPanel

JPanelJPanel JPanel JPanel

JLabel JLabel

1

1

1 1 1 1

1

1 1

1

JPanel

1

JPanel

JPanel

1

JScrollPane

JTextArea

1

1

KeyHandler«interface»KeyAdapter

JPanel GridLayout

CupV12

1

14

JTextField

JButtonJLabel

1 12112

1

1

12

1

BorderLayout 1

GridLayout

GridLayoutGridLayout

Page 39: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

39

CupV12

JTextField JButton

1 1

1

-nextCup

TextFieldListener ButtonListener«interface»ActionListener

«interface»ActionListener

1* 1

Page 40: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

40

Page 41: 1 Object-Oriented Programming (Java), Unit 24 Stand In Final Project Description Kirk Scott

41

The End