Scientific Toolkit for Java' - PowerPoint PPT Presentation

About This Presentation
Title:

Scientific Toolkit for Java'

Description:

Data Points with error bars, Histograms, Fitting, Functions, Plotting. ... Plethora of new extensions. JavaHelp. New features in JDK 1.2. Collection classes. Java 2D. ... – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 28
Provided by: markpo91
Category:

less

Transcript and Presenter's Notes

Title: Scientific Toolkit for Java'


1
Scientific Toolkit for Java.
  • Mark Pollack
  • (formerly BNL-PHENIX now
  • TIBCO Software)

2
Goals for Toolkit (I)
  • Develop scientific specific interfaces.
  • Data Points with error bars, Histograms, Fitting,
    Functions, Plotting.
  • Take advantage of inherit multithreaded nature of
    Java (Online monitoring)
  • Stick to Model-View-Controller design.
  • Avoid package dependencies.
  • Note Not a attack on Java Analysis Studio my
    side project to learn more about JDK1.2

3
Goals for Toolkit (II)
  • Bundle together useful components for building a
    real world application.
  • Advanced GUI components, icons.
  • Editor.
  • Interpreters.
  • Regular Expressions.
  • Source code management. (cvs)
  • Code scrapbook. (tricks of the trade)

4
State of Java
  • Plethora of new extensions
  • JavaHelp
  • New features in JDK 1.2
  • Collection classes.
  • Java 2D.
  • Growing collection of open-source components.
  • Reuse and integration.

5
Java2D Overview
  • Graphics2D class
  • Acquire g2d object for an output device
  • Screen, Printer, Offscreen buffer.
  • Set rendering context
  • Font, Transform, Stroke, Paint, Clip, Hints
  • g2d.setPaint(Color.blue)
  • Draw shapes, text, images
  • g2d.draw(aShape), g2d.drawText(hi)
  • g2d.draw(new Rectangle(0,0,100,100)

6
STJ Drawing Framework
  • Based on HotDraw framework.
  • Simplify Java2D API
  • ltltGShapegtgt
  • Appearance.
  • Delegates drawing to a ltltRenderergtgt.
  • isFixedSize, isMoveable, isVisible.
  • ltltShapeChangeListnergtgt
  • draw(Graphics2D)

7
STJ Drawing Framework Interfaces
GDrawingView
GDrawingEditor
Implementation inherits from JComponent
Current tool
GDrawing
Implementation inherits from JFrame
GTool
GLayer
GShape
Text
8
GShapes
9
Transformations
  • Easy to transform a Shape
  • Non-linear transformations.
  • Can use PathIterator to walk shape and convert
    points as necessary.

Fish-eye
10
Graphs
  • Interfaces
  • ltltDataPoint2Dgtgt, ltltGraphModelgtgt
  • Models
  • AbstractGraphModel (Listener management)
  • DefaultGraphModel
  • GraphModelEvent events fired when model changes.
  • View Graph. (GAxis, ltltTickMakergtgt)

11
Simple Graph
Axis scale with data changes
12
Histograms
  • Interfaces
  • ltltHistoModelgtgt, ltltHistoModel1Dgtgt, ltltPartitiongtgt
  • Models
  • AbstractHistoModel, FixedPartition,
    FixedHistoModel1D
  • HistoModelEvent events fired. (manage up to 3D)
  • Abstract Histogram Factory
  • STJHistoFactory implementation.

13
Simple Histogram
Random Number Generation via CERN Colt package.
14
Functions
  • Interfaces
  • ltltFunctiongtgt,ltltFunction1Dgtgt
  • Models
  • AbstractFunction, AbstractFunction1D
  • 1D Gaussian, Exponential, Polynomial
  • ParsedFunction1D (use interpreter)
  • View Graph, GFunction1D

15
Functions
Math.abs(x) is a parsed function.
16
Interactive use
  • Many interpreted languages available in Java.
  • Allow access to Java objects.
  • Managed like JDBC drivers
  • ltltInterpreterDrivergtgt InterpreterDriverManager
  • BshInterpreterDriver (Java) etc
  • Generic Swing console.

17
Interactive use
It actually works!
18
Generic Console
  • For packages that do not provide a swing based
    console.

19
Persistence
  • Use Bridge pattern for locating and archiving
    objects.
  • ltltObjectFindergtgt,ltltObjectStorergtgt
  • Responsible for finding object and how to
    decompose object for storage on physical media.
  • RawSerializationStorer, ReflectionStorer
  • Physical storage ltltObjectStoragegtgt
  • JDBCStorage, RawSerializationFileStorage
  • Objects can be located from Serialized file DB
    and saved to JDBC Database.

20
Persistance
  • Java Reflection picks apart objects
  • Class, Name, Value put in StorageFields.
  • Basic types, arrays to come, (SQL3 Data Types)
  • Bean Reflection, persistence based on public API.
    (more stable?) New RFC from Sun.

(SQL generated on the fly)
TMessage
(TFile to come)
File DB
21
Code snip for JDBC Storage
ObjectStorage storage new JDBCStorage()
ObjectManager.setObjectStorer(new
ReflectionStorer(storage)) ObjectManager om
new ObjectManager() Person p new
Person("mark",30,6.0f) om.storeObject(p)
ObjectFinderImpl of new JDBCObjectFinder(storage
) om.setObjectFinder(of) //work with object
Iterator it om.selectAll() //Iterator itt
om.select(QueryString)
Specific Implementations
Similar to ODMG DCollection
OQL grammar now available in Java.
22
Code snip for Serialization Storage
RawObjectStorage storage new
RawSerializationFileStorage("D\\mark\\java\\dataf
iles\\myfile.ser", "RECREATE")
ObjectManager om new ObjectManager()
ObjectManager.setObjectStorer(new
RawSerializationStorer(storage)) //Work with
objects. GraphModel gmodel new
DefaultGraph2DModel() om.storeObject(gmodel
) ObjectFinderImpl of new
SERObjectFinder(storage) om.setObjectFinder(of)
Iterator it om.selectAll() //work with
objects.
Specific Implementations
23
GUI Components/Icons
  • Nice components from Claude Duguay.
  • JBorder, JCalendar, JConfigure, JExplore,
    JGradient, JGraph, JIconEditor, JMaskField,
    JOutlookBar, JPalette, JReportForm, JScrollView,
    JSpinner.
  • JavaLobby, 200 20x20 icons.
  • Converted to 16x16.

24
Component Snapshots
25
Other Components
  • JavaHelp
  • Integration with application context.
  • jEdit
  • Extensible via plug-ins
  • jCVS
  • JUnit, framework for Unit testing.
  • Colt

26
Status
  • Proof of principle
  • Early stages, feedback needed.
  • Drawing metaphor too clumsy?
  • To do Fitting Implementation, TFile support, TeX
    Labels.
  • Need to make API more concise, scripting
    friendly.
  • Performance, Interpreters General

27
Contact
  • markp_at_bnl.gov
  • More information _at_
  • www.phenix.bnl.gov/markp
Write a Comment
User Comments (0)
About PowerShow.com