Package xal.app.scan2d
Class ScanDocument2D
- java.lang.Object
-
- xal.extension.application.XalDocument
-
- xal.extension.application.smf.AcceleratorDocument
-
- xal.app.scan2d.ScanDocument2D
-
- All Implemented Interfaces:
Pageable
public class ScanDocument2D extends xal.extension.application.smf.AcceleratorDocumentScanDocument2D is a custom XalDocument for 2D scan application. The document manages the data that is displayed in the window.- Author:
- shishlo
-
-
Field Summary
Fields Modifier and Type Field Description protected 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 ScanDocument2D()Create a new empty ScanDocument2DScanDocument2D(URL url)Create a new document loaded from the URL file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceleratorChanged()voidcustomizeCommands(xal.extension.application.Commander commander)Register actions for the menu items and toolbar.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()Dispose of ScanDocument2D resources.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()booleanisEmpty()voidmakeMainWindow()Make a main window by instantiating the ScanWindow2D window.voidreadScanDocument(URL url)Reads the content of the document from the specified URL.voidsaveDocument()voidsaveDocumentAs(URL url)Save the ScanDocument2D document to the specified URL.voidsetSource(URL arg0)voidshowDocument()booleanwarnUserOfUnsavedChangesWhenClosing()voidwillClose()voidwindowOpened()voidwindowWillOpen()String[]writableDocumentTypes()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, selectedSequenceChanged, setAccelerator, setAcceleratorFilePath, setSelectedSequence, setSelectedSequenceList
-
-
-
-
Field Detail
-
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
-
ScanDocument2D
public ScanDocument2D()
Create a new empty ScanDocument2D
-
ScanDocument2D
public ScanDocument2D(URL url)
Create a new document loaded from the URL file- Parameters:
url- The URL of the file to load into the new document.
-
-
Method Detail
-
readScanDocument
public void readScanDocument(URL url)
Reads the content of the document from the specified URL.- Parameters:
url- Description of the Parameter
-
makeMainWindow
public void makeMainWindow()
Make a main window by instantiating the ScanWindow2D window.
-
freeCustomResources
public void freeCustomResources()
Dispose of ScanDocument2D resources. This method overrides an empty superclass method.
-
saveDocumentAs
public void saveDocumentAs(URL url)
Save the ScanDocument2D document to the specified URL.- Parameters:
url- Description of the Parameter
-
customizeCommands
public void customizeCommands(xal.extension.application.Commander commander)
Register actions for the menu items and toolbar.- Parameters:
commander- Description of the Parameter
-
acceleratorChanged
public void acceleratorChanged()
- Overrides:
acceleratorChangedin classxal.extension.application.smf.AcceleratorDocument
-
writableDocumentTypes
public String[] writableDocumentTypes()
-
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()
-
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
-
-