Without using the Scene Builder, implement an application using JavaFX that stacks the cannon balls.The cannon balls are name-colored.The requirements for this assignment are listed below:
The cannon balls are to be painted with one of these colors:
The cannon balls are drawn with the black solid-line strokes with the width specified by the user.
The application will have a menu bar on top with two menus, File and Setup.
The File menu has the following menu items.
Serializeâ€¦ – When selected, the user is prompted for a file path to serialize the data.Then the pyramid settings and cannon balls settings (as described below) are serialized to disk.
Deserializeâ€¦ – When selected, the user is prompted for the file to deserialize.Then the current pyramid settings and cannon balls settings are replaced with the settings from this file.
A menu separator.
Save to Databaseâ€¦ – When selected, current pyramid settings and cannon balls settings are written to the MySQL database.
Load From Databaseâ€¦ – When selected, the application will retrieve the list of pyramid names from the MySQL database and present this list to the user.The user will select the pyramid name.Using this pyramid name, the application will replace the current pyramid settings and the cannon balls settings with the settings associated with the selected pyramid name from the MySQL database.
A menu separator.
Exit – When selected, it will terminate the application.
The Setup menu has two menu items:
Configure Pyramidâ€¦ – When selected, this menu item will display the below dialog.The user can specify the name of the pyramid, the height of the pyramid, and the stacking order (LeftJustified, Center, RightJustified) of the cannon balls.The default values are:
Configure Cannon Ballsâ€¦ – When selected, this menu item will display the below dialog.The user will be able to specify the radius in pixels to draw each cannon ball, the color of the cannon balls, and the stroke width in pixels to draw a back solid-line around each cannon balls.The default values are:
The settings for the pyramid and cannon balls must be defined separately.In other words, there must be separate classes defined for the pyramid settings and cannon ball settings.
The cannon balls are drawn in the drawing panel.They are stacked on each other based on the specified stacking order.
The drawing panel is scrollable.The horizontal and vertical scroll bars will appear as needed.
There is the status message/bar which displays the pyramid height and the stacking order.
Sample screen shots are included below.
Here are some helpful sample queries for this assignment:
For additional information about Structured Query Language (SQL) syntax and tutorials, refer to the web-site below.
The database schema is described below:
The database name is:cannon_balls.
There are two tables:
pyramid_settings â€“ This is the parent table.Its table definition is shown below.
cannon_ball_settings â€“ This is the child table.It inherits the values associated with the primary key values of the pyramid_settings table.Its table definition is shown below.
// Insert a new record in the pyramid_settings table.
insert into pyramid_settings (pyramid_name, height, stacking_order)
values (‘National University Pyramid’, 1, ‘RightJustified’);
// Insert a new record in the cannon_ball_settings
insert into cannon_ball_settings (pyramid_settings_id, radius, stroke_width, color_name)
values (3, 50, 2, “BROWN”);
// Select all records from the pyramid_settings table.
select * from pyramid_settings;
// Retrieve all pyramid names.
select pyramid_name from pyramid_settings;
// Select all records from the cannon_ball_settings table.
select * from cannon_ball_settings;
// Update the values in the pyramid_settings table where the pyramid name is â€œpeter_pyramidâ€.
set height = 5, stacking_order = ‘LeftJustified’
where pyramid_name = ‘peter_pyramid’;
// Delete a record from the pyramid_settings table with the pyramid name â€œpeter_pyramidâ€.
delete from pyramid_settings where pyramid_name = ‘peter_pyramid’;
NOTES: This is an individual programming assignment for the Final Exam. You are encouraged to exchange ideas.However, collaboration, discussion, exchanging code, or any form of plagiarism is allowed. If violated, zero points shall be awarded to all parties involved.
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post javafx programming code appeared first on Custom Nursing Help.