1 / 27

Scientific Toolkit for Java.

Scientific Toolkit for Java. Mark Pollack (formerly BNL-PHENIX now TIBCO Software). Goals for Toolkit (I). Develop scientific specific interfaces. Data Points with error bars, Histograms, Fitting, Functions, Plotting.

jherrin
Download Presentation

Scientific Toolkit for Java.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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 Scientific Toolkit for Java

  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) Scientific Toolkit for Java

  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. Scientific Toolkit for Java

  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); Scientific Toolkit for Java

  6. STJ Drawing Framework • Based on HotDraw framework. • Simplify Java2D API • <<GShape>> • Appearance. • Delegates drawing to a <<Renderer>>. • isFixedSize, isMoveable, isVisible. • <<ShapeChangeListner>> • draw(Graphics2D) Scientific Toolkit for Java

  7. 1 1 1 1 1..* 1..* STJ Drawing Framework Interfaces GDrawingEditor GDrawingView Implementation inherits from JComponent Current tool GDrawing Implementation inherits from JFrame GTool GLayer GShape “Text” Scientific Toolkit for Java

  8. GShapes Scientific Toolkit for Java

  9. Transformations • Easy to transform a Shape • Non-linear transformations. • Can use PathIterator to walk shape and convert points as necessary. “Fish-eye” Scientific Toolkit for Java

  10. Graphs • Interfaces • <<DataPoint2D>>, <<GraphModel>> • Models • AbstractGraphModel (Listener management) • DefaultGraphModel • GraphModelEvent events fired when model changes. • View: Graph. (GAxis, <<TickMaker>>) Scientific Toolkit for Java

  11. Simple Graph Axis scale with data changes Scientific Toolkit for Java

  12. Histograms • Interfaces • <<HistoModel>>, <<HistoModel1D>>, <<Partition>> • Models • AbstractHistoModel, FixedPartition, FixedHistoModel1D • HistoModelEvent events fired. (manage up to 3D) • Abstract Histogram Factory • STJHistoFactory implementation. Scientific Toolkit for Java

  13. Simple Histogram Random Number Generation via CERN Colt package. Scientific Toolkit for Java

  14. Functions • Interfaces • <<Function>>,<<Function1D>> • Models • AbstractFunction, AbstractFunction1D • 1D: Gaussian, Exponential, Polynomial • ParsedFunction1D (use interpreter) • View: Graph, GFunction1D Scientific Toolkit for Java

  15. Functions Math.abs(x) is a parsed function. Scientific Toolkit for Java

  16. Interactive use • Many interpreted languages available in Java. • Allow access to Java objects. • Managed like JDBC drivers • <<InterpreterDriver>> InterpreterDriverManager • BshInterpreterDriver (Java) etc • Generic Swing console. Scientific Toolkit for Java

  17. Interactive use It actually works! Scientific Toolkit for Java

  18. Generic Console • For packages that do not provide a swing based console. Scientific Toolkit for Java

  19. Persistence • Use Bridge pattern for locating and archiving objects. • <<ObjectFinder>>,<<ObjectStorer>> • Responsible for finding object and how to decompose object for storage on physical media. • RawSerializationStorer, ReflectionStorer • Physical storage <<ObjectStorage>> • JDBCStorage, RawSerializationFileStorage • Objects can be located from Serialized file “DB” and saved to JDBC Database. Scientific Toolkit for Java

  20. keys serialized objects 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” Scientific Toolkit for Java

  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…. Scientific Toolkit for Java

  22. Code snip for Serialization Storage RawObjectStorage storage = new RawSerializationFileStorage("D:\\mark\\java\\datafiles\\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 Scientific Toolkit for Java

  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. Scientific Toolkit for Java

  24. Component Snapshots Scientific Toolkit for Java

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

  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 Scientific Toolkit for Java

  27. Contact • markp@bnl.gov • More information @ • www.phenix.bnl.gov/~markp Scientific Toolkit for Java

More Related