Assignment 2 – 80 marks

 

Deadline: Thursday, 26th June, 11:59 pm.

Develop a GUI based program of LUMS Art Gallery. For this you have to develop three GUIs: LUMS Art Gallery, Add Painting, Search Painting. For a working version of what you are supposed to make, download from here, or copy from j:/cs293m02. Read all the following instructions before starting the assignment:

 

-         For the LUMS Art Gallery GUI, if Add Painting button is pressed, then this GUI disappears, and the GUI for Add Painting appears. Same for Search Painting button.

-         In both Add Painting GUI, when Back button is pressed, and in Search Painting GUI, when Back menu option is selected, the GUI disappears, and the LUMS Art Gallery GUI is shown.

  

-         The colors used in designing these GUIs have RGB values (204,245,211) – background color, and (0,128,0) – text color.

-         The font for headings used is 40-point Serif.

-         The image file used “logo.jpg” can be downloaded here, or from j:/cs293m02 (download in same folder as the .jar file downloaded above).

-         The initial sizes of each GUI are: LUMS Art Gallery (500 x 250), Add Painting (500 x 300), Search Painting (500 x 500).

-         The LUMS Art Gallery GUI is not resizable. The other two GUIs are. (In the sample GUIs provided, all the GUIs have been made non-resizable. However, in your assignment, only the LUMS Art Gallery GUI should be non-resizable.)

 

 

-         Handle window-closing event in all GUIs. Also, currently, the only events generated are by (i) the buttons in the LUMS Art Gallery GUI, (ii) the Back button in Add Painting GUI, (iii) the menu options in Search Painting GUI, and (iv) the List Options in Search Painting GUI (if All is selected, the search string text field cannot be written on. If any other option is selected, the user can write on the text field).

  

-         This gallery has paintings from only those artists whose name is in the Add Painting GUI’s drop down list. So you can hard code that.

-         The price text field in Add Painting GUI should have ‘$’ written in it by default.

-         At one time only one painting style could be selected in the Add Painting GUI.

-         At one time only one search criteria could be selected in the Search Painting GUI. 

 

-         For this assignment, you may need to use some setter functions not discussed in class. These could be found from the drop-down lists you get in java editors or on the following:

o       http://java.sun.com/j2se/1.3/docs/api/javax/swing/JButton.html

o       http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTextField.html

-         To learn how to add menus to your GUI, look at the code for menus at pg 651 in Dietel 3rd edition. The menu created by this code is much complex than the one required in the assignment. Or look at the code on pg 665 Dietel 3rd edition, that shows how to add a menu to a frame.

 

 

Grading –

 

-         On top of each GUI class, include 2-3 lines of comments telling the basic design idea you used. E.g. for this GUI, I added a heading label in the north, the labels and text field in a grid and then in center, and the exit button in flow layout then in south of the container.

-         LUMS Art Gallery GUI: showing logo, adding buttons, event handling on pressing buttons, how similar* [5+2+4+10 = 21 marks].

-         Add Painting GUI: adding all components, back-button event handling, how similar* [12+2+10 = 25 marks].

-         Search Painting GUI: adding all components, menu options event handling, search list event handling (specified in instructions above), how similar* [10+4+4+10 = 28 marks].

-    Handle window-closing event in the three GUIs in 3 different ways. [6 marks]. (One of the way has a disadvantage as discussed in class, but implement it anyway for this assignment.)

 

* In this grading scheme, ‘how similar’ tests how similar the GUI you have created appears compared to the assigned GUI. Also, while designing the GUI, use of layout managers is required.

 

Screen Shot  -

(LUMS Art Gallery screen shot provided so that you know what to make even if .jpg file is not stored in the same folder.)