spheregl requirements specs. - web viewspheregl requirements ... so the app provides fran with a...

24
ANTON KRONAJ – TUAN TRAN – SEAN FINLEY SphereGL is a program to perform a stroop test. The stroop test is one where a subject is presented with a prompt where he is told to select the object on the prompt in the following screen. The prompt has a color written and an image of an object, such as a sphere, cube or torus. The color of the wording and the object are different from the wording itself. When the screen refreshes the subject is presented with many objects in many different colors. He must choose the object that appeared on the prompt in the color that the wording says. Not the color of the prompt itself. Some data is measured while the subject tries to fund this object. SphereGL will not do the measuring of the brain. SphereGL is the application that will display the images on the screen and allow http://sourceforge.net/p/spheregl/wiki/Home/ SphereGL Requirements Specs.

Upload: phamhanh

Post on 30-Jan-2018

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

A N T O N K R O N A J – T U A N T R A N – S E A N F I N L E Y

SphereGL is a program to perform a stroop test. The stroop test is one where a subject is presented with a prompt where he is told to select the object on the prompt in the following screen. The prompt has a color written and an image of an object, such as a sphere, cube or torus. The color of the wording and the object are different from the wording itself. When the screen refreshes the subject is presented with many objects in many different colors. He must choose the object that appeared on the prompt in the color that the wording says. Not the color of the prompt itself. Some data is measured while the subject tries to fund this object. SphereGL will not do the measuring of the brain. SphereGL is the application that will display the images on the screen and allow the subject to perform a selection on them, and measure the reaction time

http://sourceforge.net/p/spheregl/wiki/Home/

SphereGL Requirements Specs.

Page 2: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

Table of Contents

Document Overview ...………………………………………………………………………………………… 3

Requirements ……………………………………………………………………………………………………. 3

System Overview ……………………………………………………………………………………………….. 4

Use Case Diagram ………………………………………………………………………………………………. 7

Technical Specifications ……………………………………………………………………………………... 8

Support ………...………………………………………………………………………………………………..... 14

References ……………………………………………………………………………………………………..... 14

Glossary …………………………………………………………………………………………………………... 14

Index ……………………………………………………………………………………………………………….. 15

SphereGL Requirements Specifications

2 Anton Kronaj - Tuan Tran - Sean Finley

Page 3: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

Document OverviewThough SphereGL is a one-task application it takes a lot to make it run. This document will go through the necessary information to understand SphereGL.

RequirementsIn order to use SpherGL it is important to do the following:

1. Have the latest Java Runtime Environment installed in your system. As of this writing (Wednesday, February 27, 2013) the latest version is JRE Version 7 Update 15. If you need to download it you can do so at either java.com or at oracle.com

2. Run your specific Operating System distribution of SphereGL, such as the Mac, Windows, or Linux versions. Whichever system you are using make sure to run its corresponding version of SphereGL

SphereGL Requirements Specifications

3 Anton Kronaj - Tuan Tran - Sean Finley

Page 4: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

System OverviewSphereGL is a program to perform a stroop test. The stroop test is one where a subject is presented with a prompt where he is told to select the object on the prompt in the following screen. The prompt has a color written and an image of an object, such as a sphere, cube or torus. The color of the wording and the object are different from the wording itself. When the screen refreshes the subject is presented with many objects in many different colors. He must choose the object that appeared on the prompt in the color that the wording says. Not the color of the prompt itself.

Some data is measured while the subject tries to fund this object. SphereGL will not do the measuring of the brain. SphereGL is the application that will display the images on the screen and allow the subject to perform a selection on them, and measure the reaction time

So to get an understanding on how the software will be used lets use Steven, a bright young man, as our subject for the day. Once Steven arrives at the laboratory, fifteen minutes late, and our impatient research student Fran greats him. Fran is very eager to probe Steven’s brain so she can fill the pages of her dissertation with it. Steven is fitted with a headband that will measure brain activity and he is placed in front of a wall-sized screen that will be projected with images and he is given a wireless mouse. He is then told to find and click the image the prompt tells him as fast as he can. Frank is now scared of Fran, so he does what she says without any lip.

In a terminal in another room -perhaps an evil room- is the terminal that houses the app. Fran launches the application.

SphereGL Requirements Specifications

4 Anton Kronaj - Tuan Tran - Sean Finley

Page 5: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

So Fran enters Stevens name. She then proceeds to enter a few of the attributes that are important to the way the test will be run. One of those attributes is the mode the first trial of the test will run. It may be in stroop mode, where the word describing a color is in a different color than the word itself, such as “green” being in blue, or non-stroop mode, the opposite of stroop, where the word and the color of the word match. The size of the objects to be displayed, the prompt time in milliseconds and the time one trial will run for. A test consists of multiple trials.

All the while Fran is fiddling with the user interface, Steven is getting mighty anxious. Fran finishes with the input and clicks start. Steven is now presented with something to cut his boredom.

SphereGL Requirements Specifications

5 Anton Kronaj - Tuan Tran - Sean Finley

Page 6: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

This is the pause screen that Steven will see at the beginning of the test and at the end of each trial. It indicates for him to just sit tight and wait for the next instruction. Which arrives soon after to be…

SphereGL Requirements Specifications

6 Anton Kronaj - Tuan Tran - Sean Finley

Page 7: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

Steven now has to select the “Blue sphere” not the green like the color of the word, but the blue. So this is a stroop mode. And this is non-stroop.

Each trial has a specific mode (stroop or non-stroop) it will run on. This depends on the planning of the test, so the app provides Fran with a method to set the stroop/non-stroop setting for each trial for the entire test in the beginning, or a method to change it in the beginning of every trial. This hint image will be displayed

SphereGL Requirements Specifications

7 Anton Kronaj - Tuan Tran - Sean Finley

Page 8: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

for a predetermined time. And then random images are presented on the screen. Steven has to find the only “green sphere” on the bunch and select it.

This process will repeat for as long as Fran wants to have Steven in her clutches. Then a formatted text file is created with the retrieved data.

Here it is!

SphereGL Requirements Specifications

8 Anton Kronaj - Tuan Tran - Sean Finley

Page 9: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

Use Case DiagramThe below diagram describes the above process in a diagram.

ResearcherActor System1. ) Researcher starts the application. 1.) System prompts the user with the GUI.2.) Researcher presses ‘Cancel’. 2.) Application exits.2.) Researcher presses ‘Start’. 2.) System stores all parameters, closes the GUI

and starts the application. Parameters: Subjects first and last name are stored as String values in Subject class. The prompt display time is stored in the main application and sets the number of seconds for the prompt be displayed. If stroop is selected, a Boolean is set to true that stroops the prompt. Object size sets the size of all the objects on the screen. If full screen option is selected, the application will set the test in full screen if the device is capable of doing so. Number of tests sets the number of times for the subject to be prompted with an object.

SubjectActor System

SphereGL Requirements Specifications

9 Anton Kronaj - Tuan Tran - Sean Finley

Page 10: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

1.) Clicks on the target object. 1.) Records the hit; if the current test is not equal to the max number of tests, prompt the subject with another target, otherwise, close the test and save the results.

1.) Clicks anywhere other than the target object. 1.) Records the miss for that specific test, does NOT advance to the next test.

SphereGL Requirements Specifications

10 Anton Kronaj - Tuan Tran - Sean Finley

Page 11: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

Technical SpecificationsDescriptions of the following classes are still to be written.

ColorUtilThis is a utility class to house a centralized way to access and generate colors. Currently the application only uses Red, Blue and Green colors for objects. This class maintains a list of integers that correspond to colors and are used in switch/if statements to choose what king of ColorRGBA object to create and apply to an object. This class has functions to choose a color at random, choose colors at random other than what’s not wanted as a choice (lets say when you want all the other available colors besides green), convert an integer to its corresponding ColorRGBA and convert a ColorRGBA to its corresponding integer representation.

IMPORTANT NOTE: The integer referred to in the above description only pertains to this application. In no way is it standard in Java or JME. It is much easier to randomly generate an integer and then map it to a corresponding ColorRGBA than to figure out a way to generate a ColorRGBA.

CoordinatePairThis object is one that contains a pair of (x, y) values that are used as x and y coordinates for building of objects.

Passing two desired values can create a CoordinatePair object or it can create its own values at random. This is convenient since for most part of the application we want the coordinates of the objects to be at random.

This class implements equals() and hashCode() thus it can be used to compare two CoordinatePair objects. This is helpful when we need to check if there are two objects with the same coordinates and may collide.

Tech Note: Create better randomization of numbers in random generating of pairs.

o Look into using floats instead of int. but this will require close attention to object collision.

FactoryWhatsItThis is a factory class to build all the available WhatsIt objects. Use this class when knowing what WhatsIt object to build at runtime. Each object is designated an int value and the various makeWhatsIt () methods will determine what object to create based on it.

This class has a method to create a random whatsit at the specified coordinates and with a specified color. It also has one method to create a random object at the specified location sans color represented by the passed color integer. Template

SphereGL Requirements Specifications

11 Anton Kronaj - Tuan Tran - Sean Finley

Page 12: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

objects are created when the factory object is first created. These template objects are later cloned to create varying color objects. This method is faster than creating brand new objects every time one is needed. The clone is a deep clone so in all respects it’s as if a new whatsit is created, but much faster.

Tech Note: It is preferable that the factory be used instead direct instantiation.

GameStateThis is the class that is used to switch between the running state and the pause state. The enable() method excepts a boolean value. True is to activate the running state and false is for the pause state.

LogHandlerClass to be used in creating a log file so we may know what occurred when and if the application crashes.

MainThis is the main class of the application that implements Simple Application. This class is responsible for starting the application and handling the mouse trigger for selection of objects.

SphereGL Requirements Specifications

12 Anton Kronaj - Tuan Tran - Sean Finley

Page 13: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

Tech Note: Move the trigger to a new class Create a new class to implement SimpleApplication instead of in the Main Leave the main class only to start the app and maybe a few preprocessing

that may be needed before the application starts.

ObjectWhatsItThis class is an abstract class that implements most of the WhatsIt interface. All the objects that will be used will have similar implementations of the interface WhatsIt, so this class implements the majority. The only methods that will need to be implemented when extending this class is make(), changeColor (), clone().

This class provides many get and set methods, as well as variables for storing various information such as name, color, diameter, x, y, z, and of course the model. The model is a JME Spatial.

ObjNodeControlThis is the control class for the building of the background objects. All the background objects are currently build in this class using a FactoryWhatsIt object.

When the application starts the background objects are built at the moment they are needed. That’s why there may be a small lag, depending on the number of background objects built. Subsequent background objects are built on a separate thread at the time objects are being displayed on the screen and the user is trying to select one of them.

In a typical scenario the background objects and the target object are displayed, while the user is locating the target to select. At this 'search' time period the background objects are being built by a separate thread from the main thread that’s handling the rendering on the screen. The back-thread and stores the back-objects in a buffer so they may be applied to the scene when the scene needs an update. At this point the stops and waits to be dispatched again when the user selects the target on the screen. This process repeats itself every time the user makes a selection on an object. So in short the objects that render on the screen are objects that have been built and are waiting in a buffer.

This class has no hand in how the objects are built. The only thing it to get random generated coordinates and then use the factory to build the objects in a separate thread from the main thread. The objects are “built” in the background. This is achieved by using the CoordinatePair class to generate a pair of (x, y) coordinates at random that get passed to the factory.

NOTE: The target object has a shape -sphere, box, etc.- and a color. The background

objects that are of the same shape as the target cannot have the same color as

SphereGL Requirements Specifications

13 Anton Kronaj - Tuan Tran - Sean Finley

Page 14: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

the target. So if target is a blue sphere the background spheres cannot be blue.

This class Makes use of an executor that’s a Global in Main.class to run the thread

OutputFileClass to create a text file that the results of the test will be written to. It has methods to create and close the file as well as to write a string to it.

PromptClass to be used to create a prompt object. Prompt will need to display the target object and the wording of the color of the target object, however the color of the prompt target object will be in a different color than the wording.Example:

prompt reads: red (sphere) - instead of the word sphere it will be the picture of a spherePrompt sphere would be in, lets say, blue.So the subject will have to read the word red and look at he sphere and choose the red sphere, not the blue sphere.

The prompt will display for a set time. The StopWatch class is used to show the prompt for a set time. The Prompt class will know what the target object is, so it can display an image of it, but will change the color of the image to something other than the color of the target; this is called stroop mode. When the target object in the prompt is the same as the real target object it is non-stroop.

RunningStateThe most important class when the application is running. It is the state where the app is “running” the experiment. This class handles the creation and update of the target WhatsIt and delegates the creation of the background objects to the ObjControlControl class. Before this state can be applied to the application this state must be enabled. When the app needs to change states then whatever initializations on the scene that were created in this state will be taken away.

Tech Note: Create a new class that is the Pause State for when the application is paused

due to a trial ending. In the setEnable() method use the ‘else’ part of the ‘if’ statement to take away

what was initialized in this state.

StopWatchClass to create an object that will measure time. Time measurements are used in the event where the prompt is displayed for a set amount of time, and the time it takes the user to make a selection of the objects on the screen. Time is also measured in how long the entire test trial and task are run for.

SphereGL Requirements Specifications

14 Anton Kronaj - Tuan Tran - Sean Finley

Page 15: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

WhatsItThis is the interface for all the models that are to be used in the application. Most of the methods required by this interface are implemented in the abstract class ObjectWhatsIt.

The choice to use the word WhatsIt is purely aesthetic. Whatsit is a synonym for “Object”, but since “Object” has a special meaning to Java I decided to use WhatsIt.

WhatsItTorusCreates a torus to use in the scene. This class Extends ObjectWhatsit.

WhatsItBoxCreates a Box WhatsIt. This class extends ObjectWhatsIt.

WhatsItSphereCreate a Sphere WhatsIt Object. This class extends ObjectWhatsIt.

Tech Note: When constructing a Whatsit you may use the constructor, however since the

objects will be displayed at random its best to use the FactoryWhatsIt to make the selection of the object to be built based on an integer passed to the factory.

UserDataClass to hold the users information. Such info as the first and last name, together with gender, age and any other information the researcher wants.

TrialDataObject to represent a trial. Each test is broken into trials. Each trial has a mode of stroop or non-stroop. Each trial also contains an array of tasks that are run during this trial. Data pertaining to this trial alone is written to the output file at the end of each trial. The output file is written to at the end of each trial.

TestDataThe entire app is designed around a test. Data needs to be collected during this test and the TestData object will contain that data. It is responsible to create the file the data will be written to. In order to access the trial data and the task data one must go through the test object first. The test procedure for collecting data is as follows.

1. Start the test2. Start a trial

SphereGL Requirements Specifications

15 Anton Kronaj - Tuan Tran - Sean Finley

Page 16: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

3. Start a task 4. End task5. Start another task6. End the task7. Repeat steps 5 & 6 the number of tests performed8. End the trial9. Start another trial10. Repeat the same procedure with the tasks11. End trial12. End test.

The main point is that tasks are nested in trials and trials are nested in the test. A started child task must be ended before starting another parent task.

TaskDataThis is the lowest level of information. A task consists of showing the prompt and then the selection of the user. Once another prompt is displayed then a new task has started.

UnsupportedModeExceptionThis is an error when a mode is passed to the trial that is not supported by the application. a mode is stroop or non-stroop only. The user should not encounter this exception. This is here for programmer error.

UtilA utility class for various random helpful methods.

Start UiStartUI is the class responsible to create the main Graphical User Interface. Greats the user when the application is first launched. It contains fields for information about the subject, first name and last name, a JComboBox to select the test files that the research will run, new test file button, an ok and cancel button. This UI is the main UI the researcher will use. StartUi is a JFrame Form that uses the Java Swing Framework.

EditTestStepsGUI to edit the test steps that can be selected form the dropdown in the StartUi. User is presented with a text area that is prepopulated with the contents of the text file he selected in the start ui. HE can then make changes and click the ok button to save the changes or the cancel button to exit with unchanged values. Whenever the ok button is clicked the values will be validated using regular expressions. The only allowed values are the set of 0's and 1's separated by a space. {0, ,1}^n If the text area is left blank or there are other input other that 0,1 there will be a error popup.

SphereGL Requirements Specifications

16 Anton Kronaj - Tuan Tran - Sean Finley

Page 17: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

NewTestStepsNewTestSteps is a JFrame form that uses the Java Swing Framework. It is the window the user uses to create a new test instruction file. Activated from the “new” button in the StartUI form. It contains instructions on how to enter data to create a new test, a text field for the test name that will be used as the filename and a text area that the user can enter the data for the test. The entry in the text area is limited to only the numbers 0 and 1, and a blank space between each value. After the user enters data and clicks the ok button the text area values are verified using Regular Expressions and the Java Pattern class to validate the input. If the input is not accepted NewTestSteps will display a popup message box using JOptionPane to notify the user of the mistakes. If the data is accepted then the file will be created and available for selection from the JComboBox in the StartUi form. The cancel button can be used to exit from creating a new test.

SphereGL Requirements Specifications

17 Anton Kronaj - Tuan Tran - Sean Finley

Page 19: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

ReferencesThere are not references for this document.

SphereGL Requirements Specifications

19 Anton Kronaj - Tuan Tran - Sean Finley

Page 20: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

GlossaryStroop - when the name of a color (e.g., "blue," "green," or "red") is printed in a color not denoted by the name (e.g., the word "red" printed in blue ink instead of red ink), naming the color of the word takes longer and is more prone to errors than when the color of the ink matches the name of the color.

SphereGL Requirements Specifications

20 Anton Kronaj - Tuan Tran - Sean Finley

Page 21: SphereGL Requirements Specs. - Web viewSphereGL Requirements ... so the app provides Fran with a method to set the stroop ... When the application starts the background objects are

IndexColorUtil …………………………………….… 8

CoordinatePair ………………………..……. 8

FactoryWhatsIt …………………………….. 9

GameState ……………………………………. 9

GUI …………………………………………….. 5i

Java ……………………………………………… 3

LogHandler ………………………………….. 9

Main …………………………………………….. 9

ObjectWhatsIt ………………………………. 9

Oracle ………………………………………...… 3

OutputFile ………………………………….. 11

Pause ………………………………………….. 5i

Prompt ……………………………… 5i, 6i, 11

Researcher …………………………………... 7

RunningState ……………………………… 11

StopWatch ………………………………….. 12

Stroop ………………………………………….. 4

Subject …………………………………………. 8

TaskData …………………………………….. 13

TestData …………………………………….. 13

TrialData ……………………………………. 12

Use Case Diagram ……………………….… 7

UserData …………………………………….. 12

Util …………………………………………… 13

WhatsIt …………………………………….. 12

WhatsItBox ……………………………….. 12

WhatsItSphere …………………………... 12

WhatsItTorus ………………………….… 12

SphereGL Requirements Specifications

21 Anton Kronaj - Tuan Tran - Sean Finley