Package xal.app.pvhistogram
Class HistogramDocument
- java.lang.Object
-
- xal.extension.application.XalDocument
-
- xal.extension.application.smf.AcceleratorDocument
-
- xal.app.pvhistogram.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_LABELthe data adaptor label used for reading and writing this documentprotected xal.tools.messaging.MessageCentermessageCenterstatic intNO_OPTIONprotected static StringSAVE_FAILED_TITLEprotected URLsourcestatic StringWILDCARD_FILE_EXTENSIONstatic intYES_OPTION-
Fields inherited from class xal.extension.application.smf.AcceleratorDocument
accelerator, acceleratorFilePath, selectedSequence, selectedSequenceList
-
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
-
-
Constructor Summary
Constructors Constructor Description HistogramDocument()Empty ConstructorHistogramDocument(URL url)Primary constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceleratorChanged()Handle the accelerator changed event by displaying the elements of the accelerator in the main window.voidchannelSourceChanged(xal.app.pvhistogram.ChannelHistogram model, xal.app.pvhistogram.ChannelSource channelSource)event indicating that the model's channel source has changedvoidcustomizeCommands(xal.extension.application.Commander arg0)StringdataLabel()Provides the name used to identify the class in an external data source.intdisplayConfirmDialog(String arg0, String arg1)voiddisplayError(Exception arg0)voiddisplayError(String arg0, String arg1)voiddisplayError(String arg0, String arg1, Exception arg2)voiddisplayWarning(Exception arg0)voiddisplayWarning(String arg0, String arg1)voiddisplayWarning(String arg0, String arg1, Exception arg2)voidfreeCustomResources()StringgetCustomMenuDefinitionResource()FilegetDefaultFolder()URLgetDefaultFolderURL()StringgetDisplayFilePath()StringgetEmptyDocumentPath()StringgetFileNameForSaving()StringgetNewDocumentName(String arg0)StringgetNewFileName()intgetNumberOfPages()PageFormatgetPageFormat(int arg0)PrintablegetPrintable(int arg0)URLgetSource()StringgetTitle()voidhandleDataWrittenTo(xal.tools.data.DataListener arg0, URL arg1)booleanhasChanges()voidhideDocument()voidhistogramUpdated(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 changedbooleanisEmpty()voidmakeMainWindow()Make and configure the main window.voidsaveDocument()voidsaveDocumentAs(URL url)Save the document to the specified URL.voidselectedSequenceChanged()Handle the selected sequence changed event by displaying the elements of the selected sequence in the main window.voidsetSource(URL arg0)voidshowDocument()voidupdate(xal.tools.data.DataAdaptor adaptor)Instructs the receiver to update its data based on the given adaptor.booleanwarnUserOfUnsavedChangesWhenClosing()voidwillClose()voidwindowOpened()voidwindowWillOpen()String[]writableDocumentTypes()voidwrite(xal.tools.data.DataAdaptor adaptor)Instructs the receiver to write its data to the adaptor for external storage.voidwriteDataTo(xal.tools.data.DataListener arg0, URL arg1)-
Methods inherited from class xal.extension.application.smf.AcceleratorDocument
acceleratorFilePathChanged, applySelectedAcceleratorWithDefaultPath, catchXmlDataAdaptorException, generateDocumentTitle, getAccelerator, getAcceleratorFilePath, getAcceleratorWindow, getNewFileNamePrefix, getSelectedSequence, getSelectedSequenceList, isSelectedSequenceRing, loadDefaultAccelerator, nextChannelFactory, setAccelerator, setAcceleratorFilePath, setSelectedSequence, setSelectedSequenceList
-
-
-
-
Field Detail
-
DATA_LABEL
public static final String DATA_LABEL
the data adaptor label used for reading and writing this document- See Also:
- Constant Field Values
-
WILDCARD_FILE_EXTENSION
public static final String WILDCARD_FILE_EXTENSION
- See Also:
- Constant Field Values
-
YES_OPTION
public static final int YES_OPTION
- See Also:
- Constant Field Values
-
NO_OPTION
public static final int NO_OPTION
- See Also:
- Constant Field Values
-
SAVE_FAILED_TITLE
protected static final String SAVE_FAILED_TITLE
- See Also:
- Constant Field Values
-
messageCenter
protected xal.tools.messaging.MessageCenter messageCenter
-
source
protected URL source
-
-
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:
acceleratorChangedin classxal.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:
selectedSequenceChangedin classxal.extension.application.smf.AcceleratorDocument
-
dataLabel
public String dataLabel()
Provides the name used to identify the class in an external data source.- Specified by:
dataLabelin interfacexal.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:
updatein interfacexal.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:
writein interfacexal.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:
channelSourceChangedin interfaceChannelHistogramListener- Parameters:
model- the channel histogramchannelSource- 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:
histogramUpdatedin interfaceChannelHistogramListener- Parameters:
model- the channel histogramrange- the rangecounts- the number of countsvalues- the valuesstatistics- 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()
-
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()
-
displayWarning
public void displayWarning(Exception arg0)
-
displayError
public void displayError(Exception arg0)
-
getNumberOfPages
public int getNumberOfPages()
- Specified by:
getNumberOfPagesin interfacePageable
-
getPageFormat
public PageFormat getPageFormat(int arg0) throws IndexOutOfBoundsException
- Specified by:
getPageFormatin interfacePageable- Throws:
IndexOutOfBoundsException
-
getPrintable
public Printable getPrintable(int arg0) throws IndexOutOfBoundsException
- Specified by:
getPrintablein interfacePageable- Throws:
IndexOutOfBoundsException
-
-