Class HistogramDocument

  • All Implemented Interfaces:
    Pageable, ChannelHistogramListener, xal.tools.data.DataListener

    public class HistogramDocument
    extends xal.extension.application.smf.AcceleratorDocument
    implements xal.tools.data.DataListener, ChannelHistogramListener
    HistogramDocument represents the document for the PV Histogram application.
    Author:
    t6p
    • Constructor Detail

      • HistogramDocument

        public HistogramDocument()
        Empty Constructor
      • HistogramDocument

        public HistogramDocument​(URL url)
        Primary constructor
        Parameters:
        url - The URL of the file to load into the new document.
    • Method Detail

      • makeMainWindow

        public void makeMainWindow()
        Make and configure the main window.
      • saveDocumentAs

        public void saveDocumentAs​(URL url)
        Save the document to the specified URL.
        Parameters:
        url - The URL to which the document should be saved.
      • acceleratorChanged

        public void acceleratorChanged()
        Handle the accelerator changed event by displaying the elements of the accelerator in the main window.
        Overrides:
        acceleratorChanged in class xal.extension.application.smf.AcceleratorDocument
      • selectedSequenceChanged

        public void selectedSequenceChanged()
        Handle the selected sequence changed event by displaying the elements of the selected sequence in the main window.
        Overrides:
        selectedSequenceChanged in class xal.extension.application.smf.AcceleratorDocument
      • dataLabel

        public String dataLabel()
        Provides the name used to identify the class in an external data source.
        Specified by:
        dataLabel in interface xal.tools.data.DataListener
        Returns:
        the data label
      • update

        public void update​(xal.tools.data.DataAdaptor adaptor)
        Instructs the receiver to update its data based on the given adaptor.
        Specified by:
        update in interface xal.tools.data.DataListener
        Parameters:
        adaptor - the data adaptor
      • write

        public void write​(xal.tools.data.DataAdaptor adaptor)
        Instructs the receiver to write its data to the adaptor for external storage.
        Specified by:
        write in interface xal.tools.data.DataListener
        Parameters:
        adaptor - the data adaptor
      • channelSourceChanged

        public void channelSourceChanged​(xal.app.pvhistogram.ChannelHistogram model,
                                         xal.app.pvhistogram.ChannelSource channelSource)
        event indicating that the model's channel source has changed
        Specified by:
        channelSourceChanged in interface ChannelHistogramListener
        Parameters:
        model - the channel histogram
        channelSource - the channel source
      • histogramUpdated

        public void histogramUpdated​(xal.app.pvhistogram.ChannelHistogram model,
                                     double[] range,
                                     int[] counts,
                                     List<Double> values,
                                     xal.tools.statistics.UnivariateStatistics statistics)
        event indicating that the model's histogram has changed
        Specified by:
        histogramUpdated in interface ChannelHistogramListener
        Parameters:
        model - the channel histogram
        range - the range
        counts - the number of counts
        values - the values
        statistics - the univariate statistics object
      • writableDocumentTypes

        public String[] writableDocumentTypes()
      • customizeCommands

        public void customizeCommands​(xal.extension.application.Commander arg0)
      • getCustomMenuDefinitionResource

        public String getCustomMenuDefinitionResource()
      • getTitle

        public String getTitle()
      • getSource

        public URL getSource()
      • getDefaultFolder

        public File getDefaultFolder()
      • getDefaultFolderURL

        public URL getDefaultFolderURL()
      • setSource

        public void setSource​(URL arg0)
      • isEmpty

        public boolean isEmpty()
      • getDisplayFilePath

        public String getDisplayFilePath()
      • getFileNameForSaving

        public String getFileNameForSaving()
      • getNewFileName

        public String getNewFileName()
      • getNewDocumentName

        public String getNewDocumentName​(String arg0)
      • getEmptyDocumentPath

        public String getEmptyDocumentPath()
      • hasChanges

        public boolean hasChanges()
      • saveDocument

        public void saveDocument()
      • writeDataTo

        public void writeDataTo​(xal.tools.data.DataListener arg0,
                                URL arg1)
      • handleDataWrittenTo

        public void handleDataWrittenTo​(xal.tools.data.DataListener arg0,
                                        URL arg1)
      • warnUserOfUnsavedChangesWhenClosing

        public boolean warnUserOfUnsavedChangesWhenClosing()
      • freeCustomResources

        public void freeCustomResources()
      • willClose

        public void willClose()
      • windowWillOpen

        public void windowWillOpen()
      • windowOpened

        public void windowOpened()
      • showDocument

        public void showDocument()
      • hideDocument

        public void hideDocument()
      • displayConfirmDialog

        public int displayConfirmDialog​(String arg0,
                                        String arg1)
      • displayWarning

        public void displayWarning​(String arg0,
                                   String arg1)
      • displayWarning

        public void displayWarning​(Exception arg0)
      • displayError

        public void displayError​(String arg0,
                                 String arg1)
      • displayError

        public void displayError​(Exception arg0)