uk.ac.starlink.ast.gui
Class AstFigureStore

java.lang.Object
  extended by uk.ac.starlink.diva.DrawFigureStore
      extended by uk.ac.starlink.ast.gui.AstFigureStore
All Implemented Interfaces:
FigureStore, StoreSource

public class AstFigureStore
extends DrawFigureStore

A subclass of DrawFigureStore that adds functionality to store and restore the current AST context along with the properties of a set of figures. This is intended to make it possible to save figures and restore them using world coordinates, not just graphics coordinates (so that figures can be redrawn at the same wavelength, time, celestial coordinates etc.).

Version:
$Id$
Author:
Peter W. Draper

Field Summary
static String PLOT_TAG
          Name of the tag used for the Plot serialisation
protected  AstPlotSource plotSource
          Source of the AST Plot currently being used to map from world to graphics coordinates
 
Fields inherited from class uk.ac.starlink.diva.DrawFigureStore
drawActions, figureFactory
 
Constructor Summary
AstFigureStore(AstPlotSource plotSource, String application, String storeFile, String tagName)
          Constructor.
 
Method Summary
protected  Plot restorePlot(Element rootElement)
           
 void restoreState(Element rootElement)
          Restore a previous saved state to the DrawActions object.
protected  void savePlot(Element rootElement)
           
 void saveState(Element rootElement)
          Save all the figures currently held by the DrawActions to the given root element.
 
Methods inherited from class uk.ac.starlink.diva.DrawFigureStore
activate, getApplicationName, getStoreName, getTagName, setDrawActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plotSource

protected AstPlotSource plotSource
Source of the AST Plot currently being used to map from world to graphics coordinates


PLOT_TAG

public static final String PLOT_TAG
Name of the tag used for the Plot serialisation

See Also:
Constant Field Values
Constructor Detail

AstFigureStore

public AstFigureStore(AstPlotSource plotSource,
                      String application,
                      String storeFile,
                      String tagName)
Constructor.

Parameters:
plotSource - the source of the Plot currently being used to map world coordinates to graphics coordinates. It is expected that the Plot will be re-created so access needs to be provided in this form.
application - the name of the application directory used for backing store files (created in "home" directory).
storeFile - file used for storing figures (in application specific directory).
tagName - the name of the tag (root element) that contains figures that can be restored by this object.
Method Detail

saveState

public void saveState(Element rootElement)
Description copied from class: DrawFigureStore
Save all the figures currently held by the DrawActions to the given root element.

Specified by:
saveState in interface StoreSource
Overrides:
saveState in class DrawFigureStore

restoreState

public void restoreState(Element rootElement)
Description copied from class: DrawFigureStore
Restore a previous saved state to the DrawActions object. These are then repainted by any GraphicsPanes that are associated with the DrawActions instance.

Specified by:
restoreState in interface StoreSource
Overrides:
restoreState in class DrawFigureStore

savePlot

protected void savePlot(Element rootElement)

restorePlot

protected Plot restorePlot(Element rootElement)


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.