• No results found

Actual Solution Approach

Implementation Approach

5.2 Actual Solution Approach

5.2.1 Project Setup

The project was initiated as a two separate project. First one was created in the Net-Beans for JavaFX with Scenebuilder support and second project in the Spring Tools Suite for its database with JPA and Hibernate support.

I was focusing on controllers and views to give them the right functionality. The Base Netbeans project was duplicated where I created another project named Hazard. I started developing the Base and Hazard application separately where each project was created to have its own JAR file. This was working great whereby clicking on the Hazard button the Base app executed the JAR file.

Then into the each Netbeans project was integrated a Spring layer. This brought a lot of problems. At first, it took more time then I accept to marge Spring project into NetBeans.

After many trials and errors, I did open the project in Netbeans previously created in STS and copypasted controllers with views.

The problem was solved, but now it took about 10 seconds to boot up a JAR file. Thus, when I start and app, click on the Hazard button, returned to the Base app, then there was a 10-second gap between a click and opening frame. Also, the second JAR file couldnt be executed if the previous instance of Spring is running. This was patched by closing the instance before the new one was called, but it looks even worse in the user perspective. So now, when I clicked on the button the frame disappeared, then for the ten seconds nothing happens and another frame jumped up on the screen.

This arose questions: if I will do some modification in a project A to test it with project B then both must be compiled, how I will debug them? How I will observe behaviour in the console?

Each plugin was meant to be a separate JAR file thus; Base, Module Manager, Hazard,

Project Implementation 30

To Do Now, Calendar and Systray would be created as a project; developed, tested, debugged and executed separately. Plus there still will be an aesthetic delay when switching between each module.

For those reasons, there were created 2 scenes with 2 controllers where only one instance of Sping is running and Spring Application Context is passed into the controllers. Each plugin is now placed into the separate package for easier implementation debug and testing and each module was turned into the Scene instead of a project. User doesnt have to wait when switching between the modules.

Figure 5.3: Packages

5.2.2 Data collection

One of the desired criteria was having a dataset of all possible hazards for the Community Centre. I was planning to leave it on the very end of the project and use dummy data for testing and user will receive an application where can be added hazards manually.

During the meetings, the administrator prioritized this dataset, thus I decided to do it as a next step. Firstly a row text was copypasted from the BeSmart.ie into the text file.

The extracted data contained unwanted text, lines, spaces and characters. For that reason an extra project was set, which cleans the text file. To the dataset was added some more categories of Bingo, Catering, Theatre and Pest control hazards which took

Project Implementation 31

extra time to make the customer happy. By this decision, I put the project at risk, but on another hand, this dataset was handy for testing in the later stage.

5.2.3 Database - Dataset plugin

A testing Spring project with JUnit test was created for this purpose, which was able to create a database and tables from collected data. It includes an SQLite, JPA and Hibernate. I was able to test and debug the database layer before implementation. Later on, it was used as a feature for the Module Manager plugin.

5.2.4 View For Each Plugin - Skeleton

For each module (Base, Module Manager, Hazard, Hazard Settings, Calendar) was de-signed separate scene in the SceneBuilder and controller was generated in the Netbeans.

I made the Hazard scene first, made that responsive and test it. A copy was made and other scenes were modified from this copy. Modules are executed from the Base application and (closed) return to the Base when the back button is clicked. All scenes were placed into the project and tested if they can be entered and exited.

5.2.5 Main - Base application

Thinking of the future work I was trying to create a scalable application thus the Base acts as an envelope (a launcher) for installed plugins. When a new feature will be installed in the Module Manager a new button appears in the Base to enter the plugin.

Figure 5.4: Base Application

5.2.6 Hazard Application

This application was developed to allow a user evaluating hazards and setting a reminder for each Hazard. In the first version, the Hazard evaluation with setting reminders was

Project Implementation 32

in the same place which was difficult to use and hard to navigate for a user. Also from the developer perspective, there was the same problem. It was difficult to crating multiple expanding, shrinking ListViews and adding, removing from them. Thus after the meeting with the user where usability was discussed, we found that there can be another section providing evaluation (setting hazards) and the current section will be used for setting reminder only. In different words: in one part the user can view Hazards and Events, in the second part, a user can do an evaluation to set which Hazards are Applicable / Not Applicable at the moment.

5.2.6.1 Previous Design

Figure 5.5: Hazard - previous design

User can filter Categories (moved to Hazard Settings) User can filter categories by clicking on the left buttons:

- Applicable Categories: when this button is clicked the filtered content to Categories which are applicable for the facility is displayed e.g. there is a solid fuel pizza oven on the premise thus oven hazard is selected as applicable.

- Not Applicable Category: when this button is clicked a filtered Categories are displayed e.g. in the list is Microwave Oven Category, which is not in present on the facility at the moment but maybe bought in the near future. For that reason, the checkbox is not selected thus this category is marked as Not Applicable.

- Not Checked Categories: when dataset of Hazards is populated, then all Categories are set to Not Checked. User can decide if this category applies or not at the moment.

- All Categories: provides unfiltered content of all categories.

Setting applicable / not applicable (moved to Hazard Settings)

- User can a Category as Applicable: user can expand a Category by clicking on the category and click on the checkbox to mark Category as applicable

Project Implementation 33

- User can set Hazard applicable /not applicable: by clicking on the checkbox.

Each click change applicable to not applicable and vice versa. (Category must be set as applicable)

Figure 5.6: Above: Category marked as Applicable Below: not checked Hazard

- User can set Category Not Applicable: user can expand and set Category Not Applicable. Following Hazards become disable.

Setting applicable Hazard of Not applicable Category or Not checked Category cannot be done to not allow the user to make an error e.g. user can not set a reminder to buy a bin for broken glass where Broken Glass / Crockery Category is not selected.

Figure 5.7: Above: Category marked as Not Applicable Below: not checked disabled Hazard

When any checkbox is clicked the save button appears in the header. (In new version the save is done automatically when checkbox is clicked.)

- user can save the work: by clicking on the save button

Project Implementation 34

User can Add New Category (moved to Hazard Settings)

- Click on Add new category. The form 5.12 appears and the button Add new category is set disable.

- User can fill the form. When have all TextBoxes filled the button save appears on the top. When save button s clicked the new category is saved. Category created by users contains the Edit button.

Figure 5.8: Custom Category Can Be Edited

User can Edit custom Hazard (moved to Hazard Settings) - user can select a Category

- scroll to the bottom of a category to the desired Hazard - click on button edit. The delete button appears

- edit the info - edit comment

- click on the save button on the top

User can Add/Edit comment (moved to Hazard Settings) - user can select a Category

- scroll to the bottom of a category to the desired Hazard

- click on button edit. The delete button appears (only for Hazard created by user) - edit Info (editable only for Hazard created by the user)

- edit comment

- click the save button on the top

User can delete a custom comment (moved to Hazard Settings) - user can select a Category

- scroll to the bottom of a category to the desired Hazard - click on button edit. The delete button appears

- click on the delete button. The Hazard block become disabled and delete button turns to undo button

- click on save

Project Implementation 35

5.2.6.2 Actual Design

The actual design seems to be much better, because a user may do an evaluation of Haz-ard just once at beginning or time to time thus this options were moved to the HazHaz-ard Settings. Now the design is more lightweight were users can see only applicable Hazards selected during evaluation. This decision was very welcome by Administrator however took a lot of working time with sleepless nights to redesign half of the project, but the application will be used the most and from now is more user friendly.

User can see all applicable hazards

Figure 5.9: Hazard app without events

This part was implemented at last. For illness, I was ten days behind in implementation phase thus this part is just minimalistic to show a demo. The FIGURE 5.9 displays all hazards at the moment, but more filters will be implemented soon like:

Project Implementation 36

- user can display Hazards with Active Reminder - it shows to the user only Hazards which aren’t done

- user can display Hazards with History - it displays any hazard which has the Tasks done

There will be also two date pickers in the left bottom corner to display Hazard with Events in range.

User can set Reminder for Hazard - User can reminder - by click on a hazard

- Set date of even - when the event appears into To Do Now - Set a short message - which appears in To Do Now

- Set a description - a long text where users can be as descriptive as they can or they can leave it blank

- Cancel or Save

Figure 5.10: Hazard app event setting

User can view Tasks - user can see both completed and not completed Reminders User can complete Tasks - beside completing Active Events from To Do list a user can click on the checkbox to complete any Task. Even those which didnt appears in To Do Now.

User can edit Task - by clicking at not completed Task the form 5.10 appears. User can modify any field e.g. change date and save.

Project Implementation 37

Figure 5.11: Hazard app with events

5.2.7 Hazard Settings

User can reach the settings by clicking at the Settings button. This section is for evaluating Hazards. User can select from the downloaded dataset which Hazards are Applicable or Not Applicable for current business.

Two panels are used here. Left one displays Categories and corresponding Hazards on the left.

User can filter Categories Applicable/Not Applicable/Not checked It can be done by clicking on the buttons it the left panel.

User can set Category and Hazard applicable / not applicable

When a user clicks on the category in the middle panel then a list of hazards of this category is listed on the right. User can click on the checkboxes and select which hazards are applicable for its business. e.g. there is no Cellar Hatch in the premises, thus will

Project Implementation 38

click on the checkbox twice to make it unselected. The whole Cellar Hatch category and Hazards belongs to this category will be no longer visible in any other applications.

User will be unable to set reminders or tasks for those Hazards.

User can Add New Category

- Click on Add New Category. The form appears and the button ”Add New Category”

will be sat disable

- User can fill the form. When all textboxes have filled the button save appears on the top. (placing the save and cancel button on the bottom of the form would be more consistent, thus there is difference between old and new version)

When save button is clicked the new category is saved. Category created by a user is displayed with the Edit button.

Figure 5.12: Adding Custom Category Wireframe

Edit custom category

- User can click on the edit button of custom category. The text will become editable and button delete appears instead of edit button

- when user modify any text than the button save and cancel button appears on the bottom of the form - user can save or cancel the changes

Project Implementation 39

Delete custom category

- User can click on the edit button of custom category. The text will become editable and button delete appears instead of edit button

- user can click on the delete button - the whole category will become disable including hazards (in the right panel) and on the bottom of the form appears

[cancel] and [delete]

When delete is clicked, the category with all its Hazards will be deleted. Cancel will return the user to the form (edit mode).

Add new custom Hazard

- user can scroll in the middle panel and click on the category where wants to add a new hazard e.g. Broken Glass / Crockery

- click add Broken Glass / Crockery Hazard button

- when button in category Add ¡category name¿ hazard is clicked

- it will prompt the user to fill Hazard Info and comment. The checkbox is in default mode [-] Not checked

The user can cancel or save new Hazard

Edit custom Hazard

- User click on a category to displays its Hazards

- User can click on the edit button of Hazard - The text will become editable and button delete appears instead of edit button

- when user modify any text than the button save and cancel button appears on the bottom of the form - user can save or cancel the changes

Delete custom category

- User can click on the edit button of Hazard - The text will become editable and button delete appears instead of edit button

- user can click on the delete button

- the Hazard Form appeared and two [cancel] [delete] buttons will be disabled

- When delete is clicked, the Hazard will be deleted. Cancel will return the user to the form (edit mode)

Project Implementation 40

Figure 5.13: Actual Hazard Settings design - Evaluating Hazards

5.2.8 Module Manager

The idea of plugins/add-ons/datasets is: When the user receives an application would like to have a way to populate data. Also, the dataset is extracted from BeSmart.ie web pages and it is a combination of 3 different businesses. e.g. Community Centre, Cinema, Theater and Pest Control. This is the dataset which Administrator looking for and saves a lot of time to the user. There is also a possibility that this app will be used by different non-profiting business like GAA pitch where a different dataset is needed.

Project Implementation 41

Figure 5.14: Module Manager - all modules available

User can install a Module - by clicking on the button, this turns to yellow and a progress bar is shown. After install is done the button becomes disable and text with the colour changed.

Figure 5.15: Loading Dataset

When a dataset is installed it will reflect in To Do Now. The Task is set into the To-Do List and on the To Do Now button appears number.

This Task will be completed automatically when all Hazards and Categories are set either Applicable or Not Applicable in the Hazard Settings.

Project Implementation 42

Figure 5.16: Installed Plugins In Module Manager

5.2.9 To Do Now

Each Scene contains the To Do Now button which opens the right panel with a list of buttons. When a user clicks on the button from the list, the program will redirect to the right Scene. If the dataset is installed and the button is clicked, the application will close an actual Scene and opens Hazard Setting were the not checked hazards will be filtered and shown. This task can be resolved by setting them all Applicable or Not Applicable.

If the task was set by Hazard, and button form To Do List is clicked the application will open the Hazards and filter to just single Hazard. The task can be viewed and completed.

User can display To Do List - by clicking on To Do Now button

User can be redirected to another app - by clicking the button in To Do List User can solve To Do - When a user completes a task in To Do List e.g. all Hazards are set Applicable or Not Applicable, The task will be removed from the list and the number on the button will be updated.

Project Implementation 43

Figure 5.17: Hazard Settings - evaluation

5.2.10 Calendar

Users can navigate through year and month. Each day is displayed a number of To-Dos. When the button is clicked the list is open on the right. The current day is highlighted. In the left panel are check-boxes where users can filter categories which should be displayed e.g. User like to see just Hazard, complete Task. Those will be visible only.

At first look, the user can see a difference between Saturday, Sunday and the working days. The narrow strip on the left displays the week of the year.

It was tested: on click, the Year or Month can be changed. The button TODAY returns to the current month and today’s day is highlighted.

Project Implementation 44

Figure 5.18: Hazard Settings - evaluation

User can view actual month - When the user reaches the Calendar, then can see the full actual month where Sundays, Saturdays, Working days, weeks, headers and fields with or without date have a different colour to make it more pleasant to use.

User can see the actual day - The current day is highlighted and the list for today is displayed on the right when the field is clicked

User can see a number of events in the calendar - If calendars contain tasks, then below the date is number how many Task due at this date.

User can navigate between Years, Months and return back to current month - User can click << or >> buttons beside Year to view next or previous year

- User can click << or >> buttons beside Month name to view next or previous month - User can return to the current day by clicking on button TODAY

Project Implementation 45 5.2.11 System Tray

The System Tray is independent as well, thus running on the background, displays notifications when the application is closed and the Icon can be used as a launcher.

Implementation of System Try took longer then I expect because a Hello World appli-cation wasn’t working together with Spring until was placed into the separate Threads.

Implementing Threads did require another time for testing.

A running separate thread brought the benefit of the faster application start. Without

A running separate thread brought the benefit of the faster application start. Without

Related documents