Benthic Respirometer: A Case study for Java User Interfaces.

beehuntervivaciousΛογισμικό & κατασκευή λογ/κού

14 Ιουλ 2012 (πριν από 5 χρόνια και 2 μήνες)

597 εμφανίσεις



Benthic Respirometer: A Case study for Java User Interfaces.

Sanghamitra Das,
Kansas State University
Mentor: Brent Roman
Summer 2002


ABSTRACT

The Benthic Repirometer is used to measure the effects of changes in the environment on
microbes. The instrument is used to sample O
2
, CO
2
and measure PH and temperature
within push core chambers. It can also inject chemicals like acids and CO2. It then
measures the effects of the changes in the environment on the microbes inside the push
core chambers.
This paper describes technologies used to build a User Interface to program the Benthic
Respirometer.

INTRODUCTION

The Benthic respirometer generally has four push core chambers where it injects and
samples chemicals. Typically the benthic respirometer is programmed for the entire
mission and then left on the ocean bed for the time of the mission. The current interface
to the benthic respirometer is text based and difficult to use.

Hence the need for a user interface which would give a cleaner and a more simpler
interface for the scientist who plan the missions.

The requirements for a user interface to such an instrument would be

- The interface should be able to let the scientists plan and program the mission
- The scientist should be able to specify the time when a sampling needs to be done.
- The scientist should be able to program all the different chambers differently.
- The user interface should have features zooming, cut/ copy and paste, drag and drop
events across the mission line.
- The user should be able to save a mission and also load previously stored missions.






1

MATERIALS AND METHODS
Java was chosen as the language to implement the user interface. The java swing package
was used make the user interface.

JAVA SWING

The Java swing package is a part of Java Foundation Classes. It is a graphical user
interface component toolkit. It has a complete set of user interface elements written
entirely in Java. The swing package is pure java and is platform independent.
The swing package is integrated in Java 1.2 and above.

JAVA SWING GUI FUNDAMENTALS

Swing Containers and Non Containers:
Swing Containers are used to hold other container and non-containers. Example of swing
containers are :
- Top Level Containers:
JFrame, JDialog, JApplet
- Intermediate Containers:
JPanel, JScrollPane, JSplitPane.
Non Containers are all other elements that are not used to hold or position other GUI
elements.
- User Input
JButton, JComboBox, JTextField, JTable
- Data display / Organization
JLabel, JToolTip, JprogressBar

Layout Managers: These are used by the containers to position and organize their
components. Some common layout managers are FlowLayout, BorderLayout etc.

Event Handling: This describes the way a program handles user interactions with the
GUI. This project uses extensive use of Event Handlers and Event objects.
There are different types of events like
- Mouse Clicks
- Keyboard Events


Event Ob
j
ec
t
Event Listene
r
Event Source
Whenever an event occurs, all listeners that subscribe to that event are notified. For an
object needing to subscribe to an event it needs to implement the appropriate listener
interface. To do that we need to create a Listener class that implements the correct
methods and registers the listener with the component.
It is possible to register multiple listeners to a single component.

2

JFREECHART PACKAGE

The JFreeChart is a free java class library which can be used to build a number of charts.
The chart types supported by JFreeChart include pie charts, bar charts, line charts, scatter
plot, Gantt Chart etc.





Pie Chart Line Chart X/Y Plot






Gantt Chart

The Gantt chart is of special interest to us. It is typically used to generate project plans
with different tasks. Our aim to create a GUI for the benthic respirometer is to create a
mission with different tasks which is very close to the implementation of the Gantt Chart
from the JFreeChart package. Hence we have adapted the Gantt Chart to suit our needs.
JFreeChart already has the following features implemented.

- interactive zooming;
- events;
- tooltips;
- data is accessible from any implementation of the defined interfaces;
- export to JPEG, PNG, SVG, PDF and any other format with a Graphics2D
Implementation;
- support for HTML image maps;
- works in applications, servlets, JSP (thanks to the Cewolf project) and
- applets;

3
4
The JFreeChart is totally implemented in Java using the Java Swing package and can run
on any platform.

RESULTS

We added the following features to the existing Gantt Chart implementation to suit it for
our purpose.
- The chart contained information for 4 chambers.
- It had an editable list of tasks.
- The user could cut/copy/paste events on the mission line
- Each event has a property associated with it.
- The properties are editable


DISCUSSION

The user interface will be running as an applet. The user can plug in his/her laptop to the
instrument and can run the software as an applet inside a java enabled browser without
having to install any application on his laptop or worry about synchronization issues.

Since the User Interface is totally written in Java, it is platform independent, the UI will
run on any operating system.

CONCLUSIONS/RECOMMENDATIONS


The existing user interface has a few known bugs to be fixed. Some operations behave
differently in the windows environment.
Some more features to be added would be:
- Changing the number of chambers
- Cut/ Copy / Pasting events with the same properties.
- Displaying real time data.


ACKNOWLEDGEMENTS

I would like to thank Mr. Brent Roman and Dr. George Matsumoto for their help and
encouragement through out the project.

References:
http://www.object-refinery.com

http://developer.java.sun.com/