Starting from:

$30

CSc 221: Software Design Laboratory Assignment 5


Please note:

    • This is an individual assignment; please do your own work. Sharing and/or copying code in part or whole with/from others will result in a grade of 0 and disciplinary actions for all involved parties. If you run into problems and have done your best to solve them, please talk to me during office hours or by e-mail.

    • There is a 25% grade deduction for every day the assignment is late unless prior permission is granted.

Preamble

This assignment relies on JavaFX and serialization. You are given an existing JavaFX application, and asked to add several new features. The final application is shown in Figure 1.

Note: starting with version 9, JavaFX is longer packaged with the JDK. Java 8 users can start using JavaFX right away after downloading the proper plugin for their IDE. For later Java versions, refer to the instructions shown during class or in the tutorial “Getting Started with JavaFX” here https://openjfx.io/openjfx-docs/#introduction.

Follow these steps to setup up the assignment’s project. At this point, I assume your IDE has the JavaFX library and plugin.

    1. Using your IDE, create a new JavaFX project. This will create several , , and/or files. Run the project and ensure that there are no exceptions and that a blank window appears on your screen.

    2. Delete any,, orfiles under the project’s SRC folder. Make sure no packages are left over.

    3. Copy the given files to your project’s folder. You must maintain the directory (package) structure; do not modify the package, folder, or file names. The results should be similar to those shown in

    4. Run the project. Ensure that a new window launches as shown in Figure 2.

At this point, I assume that your able to see the existing JavaFX application (Figure 3). Many of the new features are an extension to existing ones. Study the current implementation and update accordingly.

1.    (30pts) GUI Features

 (5pts) Title: make the title of the window    5 –

    • (5pts) Drawing Colors: add an additional drawing color:

 (5pts) Drawing Size: add an additional drawing size:

        ◦ (10pts) Background Slider: add one label and a slider for changing the Blue RGB of the drawing background. The min and max values are 0 and 255 respectively.

        ◦ (5pts) Button: add a new button with the title ""

    2. (70pts) Events:

        ◦ (5pts) Draw circles using the new color

        ◦ (5pts) Draw circles using the new size

        ◦ (20pts) The background updates when the new slider (blue) changes value (i.e. dragged left and right). The process is similar to that followed by the provided and sliders.
        ◦ (40pts) Save as XML:

            ▪ (5pts) Show a file open dialog box which allows for the selection of an XML file. For simplicity, please set the initial directory to ". ". An example maybe found in Chapter 15 slides 72–88.

            ▪ (10pts) Using regular expressions, make sure the file (1) starts with an upper case letter, (2) followed by 4 or more alpha or numeric characters, (3) followed by the extension " ".
            ▪ If the filename does not pass validation, print an error message.

Assignment 5 – CSc 221 – CCNY
1
The City College of New York
Department of Compute Science

CSc 221: Software Design Laboratory


    • (25pts) If the filename passes validation, write all drawn circles to the selected XML file. One way to achieve this process by:

        1. Create a POJO class (e.g. 5. ) with four members , y coordinates, , and . The , , and are of type . The member should be of type .

        2. For every drawn circle, create an instance of type  5

        3. Use..write the instance.

What to submit:

Please compress the following files and upload a single compressed file to blackboard:

    1. Assignment5.xml

    2. A5_Controller.java

    3. Main.java

    4. Newly added class(es) for the XML serialization procedure

Figures:




















Figure 1: Final result    Figure 2: SRC folder




















Figure 3: Initial state of the application

Assignment 5 – CSc 221 – CCNY    2
The City College of New York
Department of Compute Science

CSc 221: Software Design Laboratory

































































Assignment 5 – CSc 221 – CCNY    3

More products