Package xal.app.knobs
Class KnobsDocument
- java.lang.Object
-
- xal.extension.application.XalDocument
-
- xal.extension.application.smf.AcceleratorDocument
-
- xal.app.knobs.KnobsDocument
-
- All Implemented Interfaces:
Pageable,xal.tools.data.DataListener
public class KnobsDocument extends xal.extension.application.smf.AcceleratorDocument implements xal.tools.data.DataListenerKnobs document
-
-
Field Summary
Fields Modifier and Type Field Description protected KnobsModel_modelThe main model of this documentstatic StringDATA_LABELthe data adaptor label used for reading and writing this documentprotected ActionMAKE_HORIZONTAL_BUMP_ACTIONhorizontal bump maker actionprotected ActionMAKE_VERTICAL_BUMP_ACTIONvertical bump maker actionprotected 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 KnobsDocument()Create a new empty documentKnobsDocument(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()Handle the accelerator change event.voidcustomizeCommands(xal.extension.application.Commander commander)Register actions specific to this document instance.StringdataLabel()dataLabel() 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()KnobsWindowgetKnobsWindow()Get the main window cast as a knobs window.KnobsModelgetModel()Get this document's main modelStringgetNewDocumentName(String arg0)StringgetNewFileName()intgetNumberOfPages()PageFormatgetPageFormat(int arg0)PrintablegetPrintable(int arg0)URLgetSource()StringgetTitle()voidhandleDataWrittenTo(xal.tools.data.DataListener arg0, URL arg1)booleanhasChanges()voidhideDocument()booleanisEmpty()protected voidmakeBumpKnobs(PlaneAdaptor planeAdaptor)make the bump knobsvoidmakeMainWindow()Make a main window by instantiating the my custom window.voidsaveDocument()voidsaveDocumentAs(URL url)Save the document to the specified URL.voidselectedSequenceChanged()Handle the sequence change event.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
-
_model
protected final KnobsModel _model
The main model of this document
-
MAKE_HORIZONTAL_BUMP_ACTION
protected Action MAKE_HORIZONTAL_BUMP_ACTION
horizontal bump maker action
-
MAKE_VERTICAL_BUMP_ACTION
protected Action MAKE_VERTICAL_BUMP_ACTION
vertical bump maker action
-
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
-
KnobsDocument
public KnobsDocument()
Create a new empty document
-
KnobsDocument
public KnobsDocument(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
-
makeMainWindow
public void makeMainWindow()
Make a main window by instantiating the my custom 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 change event.- Overrides:
acceleratorChangedin classxal.extension.application.smf.AcceleratorDocument
-
selectedSequenceChanged
public void selectedSequenceChanged()
Handle the sequence change event.- Overrides:
selectedSequenceChangedin classxal.extension.application.smf.AcceleratorDocument
-
getModel
public KnobsModel getModel()
Get this document's main model- Returns:
- the main model of this document
-
getKnobsWindow
public KnobsWindow getKnobsWindow()
Get the main window cast as a knobs window.- Returns:
- the knobs window associated with this document
-
customizeCommands
public void customizeCommands(xal.extension.application.Commander commander)
Register actions specific to this document instance.- Parameters:
commander- The commander with which to register the custom commands.
-
makeBumpKnobs
protected void makeBumpKnobs(PlaneAdaptor planeAdaptor)
make the bump knobs
-
dataLabel
public String dataLabel()
dataLabel() provides the name used to identify the class in an external data source.- Specified by:
dataLabelin interfacexal.tools.data.DataListener- Returns:
- The tag for this data node.
-
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 corresponding to this object's data node.
-
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 corresponding to this object's data node.
-
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()
-
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
-
-