Source Code Migration Guide

Skip to end of metadata
Go to start of metadata

This document shall help when migrating your source code from one BEAM version to another.

Changes in BEAM 4.2

Incompatible Java API Changes

Module Package BEAM 4.1 BEAM 4.2
beam-core org.esa.beam.framework.datamodel ProductManager.ProductManagerListener ProductManager.Listener
beam-core org.esa.beam.framework.datamodel ProductManager.ProductManagerEvent ProductManager.Event

Changes in BEAM 4.1

Incompatible Java API Changes

Module Package BEAM 4.0 BEAM 4.1
beam-core com.bc.layer Layer.draw(Graphics2D g2d) Layer.draw(Graphics2D g2d, ViewModel vm)

Changes in BEAM 4.0

Plug-ins

Plug-ins in BEAM 4 are named modules. The difference between BEAM 4 modules and BEAM 3.x plug-ins is the module descriptor file module.xml, which is located in the root of the module JAR. It provides module metadata (name, version, etc) and describes the module's extensions and extension points. See also Extending BEAM for more information on BEAM modules.

  • Remove com.bc.progress.ProgressController usages and use com.bc.ceres.core.ProgressMonitor instead.
  • Use of org.esa.beam.util.SystemUtils is discouraged, use com.bc.ceres.core.runtime.Activator if possible
  • Remove deprecated code

Incompatible Java API Changes

Old New Module Refactoring
org.esa.beam.framework.ui.*
beam-core moved into new module
org.esa.beam.framework.processor.*
beam-processing moved into new module
org.esa.beam.framework.dataproc.*
beam-processing moved into new module
org.esa.beam.framework.ui.draw.* org.esa.beam.framework.draw.* beam-core moved package
org.esa.beam.framework.param.editors.*ExpressionEditor
beam-ui moved
org.esa.beam.framework.datamodel.ProgressListener com.bc.ceres.core.ProgressMonitor ceres-core replacement
org.esa.beam.framework.datamodel.Product.getSceneRasterStartTime() getStartTime() beam-core rename
org.esa.beam.framework.datamodel.Product.getSceneRasterStopTime() getStopTime() beam-core rename
org.esa.beam.framework.ui.io.BeamFileFilter org.esa.beam.util.io.BeamFileFilter beam-core moved class
org.esa.beam.framework.ui.io.BeamFileChooser org.esa.beam.util.io.BeamFileChooser beam-core moved class
org.esa.beam.framework.ui.BeamMetalTheme
removed, no replacement
org.esa.beam.framework.ui.BitmaskExpressionDialog
removed, no replacement
org.esa.beam.framework.util.HelpSys org.esa.beam.help.HelpSys beam-ui moved into new module
org.esa.beam.framework.util.JavaVersionChecker
beam-core removed
org.esa.beam.util.PlugInLoader
removed, replaced by Ceres
org.esa.beam.util.SystemUtils.getExtension*()
removed, replaced by Ceres
org.esa.beam.framework.dataio.ProductIO#writeProduct(...)
beam-core removed deprecated method
org.esa.beam.visat.VisatPlugIn.initPlugIn()
beam-visat removed, replaced by start() and stop()
org.esa.beam.visat.VisatPlugIn.start()
beam-visat new, replaces initPlugIn()
org.esa.beam.visat.VisatPlugIn.stop()
beam-visat new
org.esa.beam.visat.AbstractProcessorPlugIn
beam-visat removed, replaced by extension point beam-visat:actions in module.xml
org.esa.beam.visat.AbstractProductExportPlugIn
beam-visat removed, replaced by extension point beam-visat:actions in module.xml
org.esa.beam.visat.AbstractProductImportPlugIn
beam-visat removed, replaced by extension point beam-visat:actions in module.xml
org.esa.beam.visat.VisatApp.createToolCommand()
beam-visat removed, use extension point beam-visat:actions in module.xml
org.esa.beam.visat.VisatApp.addPluginComponentForStatusBar()
beam-visat removed
org.esa.beam.visat.VisatApp.addPluginComponentForLeftPane()
beam-visat removed
com.bc.swing.FileArrayEditor org.esa.beam.framework.ui.io.FileArrayEditor beam-core moved class

Tool windows, such as the Contrast Stretch, ROI Definition, Worl Map, Navigation tool windows, formlerly extended javax.swing.JDialog. Now we use com.bc.ui.toolw.AbstractToolWindow in instead. Here is how to migrate:

  1. Examine if any methods of javax.swing.JDialog are overridden. If so, these methods will no longer be called! Try to find replacements in the ToolWindow and ToolWindowPart interfaces. E.g. overrides of the JDialog.setVisible() method can be replaced by adding a special ToolWindowListener to the ToolWindowPart.
  2. MyWindow extends JDialog --> MyWindow extends AbstractToolWindow
  3. Override AbstractToolWindow.init()
  4. Implement AbstractToolWindow.createUI() by reusing source code usually already located in methods such as initUI() or createUI(). Remove old initUI() or createUI() methods.
  5. Make sure the overridden AbstractToolWindow.createUI() is not called from client code anymore, since this is done by the framework now
  6. If you need the parent component or the window containing the tool window's content pane, e.g. in order to open new dialogs (from tool window actions), replace
    ... = new MyNewDialog(_visatApp.getMainFrame(), ...);
    

    by

    ... = new MyNewDialog(getWindowAncestor(), ...);
    

    You can also use AbstractToolWindow.getContentPane() in some of these cases.

  7. Replace
    repaint();
    

    by

    getContentPane().repaint();
    
  8. Replace
    setVisible(true);
    

    getPart().setVisible(true);

Use Java 1.5 Features

Use Java 1.6 Features

  • Replace org.esa.beam.framework.ui.SwingWorker by javax.swing.SwingWorker<X,Y>
  • Use META-INF/services instead via ServiceLoader. Don't use PlugInLoader anymore.

Improve Code Quality

  • Resolve all javadoc warnings
  • Complete javadoc comments

Increase Runtime Performance

  • Replace StringBuffer by StringBuilder, if in a thread safe context
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.