1. #Setup
    1. #Environment
    2. #Dependencies
    3. #Test inside Eclipse
  2. #Development
    1. #Overview
    2. #Classes and Functions
      1. #Model
      2. #Controllers
      3. #Panels
      4. #XYPlots
      5. #Renderers
      6. #Other
  3. #Release with Eclipse

Setup

Environment

  • Effectively, you can develop BeamlineZplot inside Eclipse on lcls-builder.
  • Check out the CVS module physics/beamlineZplot into your workspace
    • From now on, the root of project is referred to as $ZPLOT_ROOT

Dependencies

  • SLAColors (latest version)
  • SwingUtil (latest version)
  • xyplot (latest version)

Test inside Eclipse

  • Select $ZPLOT_ROOT/src/edu.stanford.slac.util.zplot.example/SimpleExampleApplication
  • Right-click => select Run As... => Java Application
  • Add -Dsun.java2d.pmoffscreen=false to VM arguments, if too slow

Development

Overview

API

  • Best is to look in $ZPLOT_ROOT/src/edu.stanford.slac.util.zplot.example/SimpleExampleApplication for how to use the API

Classes and Functions

Model

edu.stanford.slac.util.zplot.cartoon.model.CartoonDevice
edu.stanford.slac.util.zplot.cartoon.model.widget.CartoonWidget
edu.stanford.slac.util.zplot.model.Beamline
  • Has name, start z position, and end z position
  • A list of Beamlines can be drawn as a domain axis
edu.stanford.slac.util.zplot.model.Device
edu.stanford.slac.util.zplot.model.Widget
  • Has color, shape, and stroke

Controllers

edu.stanford.slac.util.zplot.ZPlotController
  • Adds functionality to the right-click menu and the PropertiesDialog
edu.stanford.slac.util.zplot.ZPlotEvent, edu.stanford.slac.util.zplot.ZPlotListener
  • Provide support for processing events after a tooltip is shown, or zoom is completed

Panels

edu.stanford.slac.util.zplot.ui.AbstractPanel
  • Parent of all beamlineZplot panels
edu.stanford.slac.util.zplot.ui.CartoonFilterPanel
edu.stanford.slac.util.zplot.ui.DevicePlotsPanel
edu.stanford.slac.util.zplot.ui.DeviceRangePanel
edu.stanford.slac.util.zplot.ui.DevicesPanel
  • Panel for configuring Devices (as well as CartoonDevices)
  • Located on the Devices tab of the PropertiesDialog
edu.stanford.slac.util.zplot.ui.PropertiesDialog
  • Dialog that pops up when you right-click on the plot and select "Properties..."

XYPlots

edu.stanford.slac.util.zplot.ZPlot
  • Main plot for Devices; can include several subplots (e.g. X, Y) as well as a beamline cartoon; can draw device labels and beamlines (on the domain axis)
edu.stanford.slac.util.zplot.cartoon.BeamlineCartoon
org.jfree.chart.plot.XYPlot
  • Modified JFreeChart XYPlot
    • Fixed bugs; needed access to some private methods

Renderers

edu.stanford.slac.util.zplot.ZPlotFeatherRenderer
  • Draws Devices as feathers (sticks)
edu.stanford.slac.util.zplot.ZPlotLineAndShapeRenderer
  • Draws devices as shapes; optionally connects lines between them
edu.stanford.slac.util.zplot.cartoon.CartoonRenderer
  • Draws CartoonDevices as shapes

Other

edu.stanford.slac.util.zplot.DevicesDataset
  • Adapts an array of Devices into a JFreeChart-specific dataset class
edu.stanford.slac.util.zplot.MatlabUtil
  • Utility methods for access from Matlab
edu.stanford.slac.util.zplot.ZPlotUtil
  • Contains useful methods, mostly related to Java2D
edu.stanford.slac.util.zplot.cartoon.CartoonWidgetIcon
  • Adopts a CartoonWidget as an instance of Icon (needed to draw icons on Devices tab of the PropertiesDialog)
edu.stanford.slac.util.zplot.model.WidgetsRepository
  • A repository of widgets for different types of devices

Release with Eclipse

  • Add a note in $ZPLOT_ROOT/RELEASE_NOTES
    • Increment the tag version accordingly
  • Commit to CVS
  • Tag with beamlineZplot-R#-#-#
  • Check out the tagged version into production
    cd $PHYSICS_TOP/release
    cvs co -r beamlineZplot-R#-#-# -d beamlineZplot-R#-#-# physics/beamlineZplot
    
  • Select File => New Java project => Create project from existing source
  • Select $PHYSICS_TOP/release/beamlineZplot-R#-#-#
  • Name the project beamlineZplot-R#-#-#
  • Press "Finish"
  • Right-click on the new project beamlineZplot-R#-#-# => Export...
  • Select Java => JAR file
  • Check beamlineZplot-R#-#-# in "Resources to export"
  • Check "Export generated class files and resources"
  • As the export destination, type (and/or select)
    $PHYSICS_TOP/release/beamlineZplot-R#-#-#/jar/beamlineZplot.jar
    
  • Press "Finish"
  • Move the symbolic link
    cd $PHYSICS_TOP/
    rm -rf beamlineZplot; ln -s release/beamlineZplot-R#-#-# beamlineZplot
    
  • No labels