Package xal.app.knobs

Class KnobsDocument

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

    public class KnobsDocument
    extends xal.extension.application.smf.AcceleratorDocument
    implements xal.tools.data.DataListener
    Knobs document
    • 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
      • 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:
        acceleratorChanged in class xal.extension.application.smf.AcceleratorDocument
      • selectedSequenceChanged

        public void selectedSequenceChanged()
        Handle the sequence change event.
        Overrides:
        selectedSequenceChanged in class xal.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:
        dataLabel in interface xal.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:
        update in interface xal.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:
        write in interface xal.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()
      • 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)