# Presentation: 423191

## Plug and Play Scientific Graphics with SGT

- Donald DenboNOAA/PMEL-UW/JISAO

*http://www.epic.noaa.gov/java/sgt*

## Introduction

- The Scientific Graphics Toolkit (SGT) is a collection of Java classes to produce scientific 2D graphics.
- SGT is a flexible system, allowing developers to produce custom graphics.
- SGT, while popular, does require an expert programmer to use it effectively.

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Goals for Plug n’ Play Graphics

- Create easy-to-use JavaBeans from the SGT classes.
- JavaBeans will enable beginner and intermediate developers a quick entry into SGT graphics.
- SGT Beans will handle most events and provide tools to easily customize the appearance of the plot.

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Why JavaBeans?

- Provide component technology for Java.  Components enhance re-usability in the Java environment.
- Can easily be used in IDE and RAD environments.
- Bean Customizers can be developed to work within IDE and RAD tools.
- Beans provide a standard mechanism to interact with development tools and simplify access to complicated Java class libraries.
- Beans have an object persistence mechanism.  (XML serialization)

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Java Development Tools

- BeanBuilderAvailable free from Sun Microsystems for JVM 1.4 or later
- Java Integrated Development Environments (JBuilder, Eclipse, NetBeans)

- 19th IIPS, Long Beach, CA

- 2003-02-13

## BeanBuilder

- Event Connection

- Component Layout

- 19th IIPS, Long Beach, CA

- 2003-02-13

## SGT JavaBeans

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Slide 8

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Design

**Page**

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Page JavaBean

- Visual JavaBean.  *Page* can be added to any swing container.
*Page* can have any number of Panels placed inside it.  Each Panel provides an independent graphical display of data from the *DataModel*.
- The location and size of the Panels are specified in the *PanelModel*.

- 19th IIPS, Long Beach, CA

- 2003-02-13

## PanelModel JavaBean

- Non-visual JavaBean.
*PanelModel *maintains:
- location and size of Panels on *Page*
- AxisGroups and their positions on a Panel
- Legend position on a Panel
- Titles and annotation positions on a Panel

- 19th IIPS, Long Beach, CA

- 2003-02-13

## DataModel JavaBean

- Non-visual JavaBean.
*DataModel* uses information from the *PanelModel* to specify the connection between data and Panel/AxisGroup.
- Contains the SGTData and Attribute objects.

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Real World Example

- User opens ncReader and selects a netCDF file.
- ncReader accesses the *PanelModel* to generate a list of Panel/AxisGroups.
- User selects which Panel/AxisGroup the data subset should be attached.
- ncReader adds the data with the Panel/AxisGroup information to the *DataModel*.

- ncReader

- data

*DataModel*

*PanelModel*

*Page*

- 19th IIPS, Long Beach, CA

- 2003-02-13

## Future Directions

- Implementation has just begun.
- Beta version of SGT with JavaBeans will be made available once an initial implementation of the *Page*, *PanelModel*, *DataModel*, and Customizer are complete.
- User feedback will help guide additional development.

*http://www.epic.noaa.gov/java/sgt*

- 19th IIPS, Long Beach, CA

- 2003-02-13