Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A developer is trying populate a GUI window menu from a file that contains a menu hierarchy. The menu may contain three different types of

A developer is trying populate a GUI window menu from a file that contains a menu hierarchy.
The menu may contain three different types of items as explained below:
Plain text items: These are menu items that only contain a text label. When clicked on,
this item performs a programmable simple action such as popping up a new input
window.
Selectable items: Selectable items changes their label when clicked by the user. Each
selectable item is independent from the rest of the menu items, their selection does not
affect other items.
Nested menu items: Nested menu items can be in plain text or in selectable format.
When clicked, it behaves in a different way than both the other item types and pops out
a submenu defined in the hierarchy file. The orientation of the submenu display is also
indicated in the hierarchy file.
A sample menu and its related hierarchy file is provided below (indentation defines the
hierarchy levels):
MenuBars
JMenu 1[below]
JMenultem 1
JMenultem 2
JMenultem 3
JMenu sub menu [right]
JMenultem 4
JMenultem 5
JMenultem 6
JCheckBoxMenultem 1[selectable]
JCheckBoxMenultem 2[selectable]
JCheckBoxMenultem 3[selectable]
JMenu 2
JMenu 3
Assuming the orientation of the menu bars are done automatically (horizontal for the first level,
vertical for the rest), you are asked to provide an object oriented design that can handle the
menu hierarchy defined above.
a. State the design pattern(s) that would be useful in your design
b. Provide a UML class diagram in full (including properties, functions, relations, etc.) to
support the functionality defined above.
c. Imagine you are asked to support grouping items in the menu. A group of items can
contain any kind of menu item but the group itself is not a new item type (it is not plain
text, clickable or nested). Modify your design and provide a new class diagram.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

3. Do information providers also make decisions? Explain.

Answered: 1 week ago