Answered step by step
Verified Expert Solution
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 below
JMenultem
JMenultem
JMenultem
JMenu sub menu right
JMenultem
JMenultem
JMenultem
JCheckBoxMenultem selectable
JCheckBoxMenultem selectable
JCheckBoxMenultem selectable
JMenu
JMenu
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 patterns 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started