public class OpenArchiveAction extends FigureAction
FigureAction.SourceType
CANVAS_TYPE, CONTEXTMENU_TYPE, HOTKEY_TYPE, MENUBAR_TYPE, PASTE_OFFSET, TOOLBAR_TYPE
Constructor and Description |
---|
OpenArchiveAction(TableauFrame parent)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
_open(java.io.File file)
Open a file dialog to identify a file to be opened, and then call
_read() to open the file.
|
protected void |
_read(java.net.URL url)
Read the specified URL.
|
void |
actionPerformed(java.awt.event.ActionEvent e)
Attempt to open the KAR.
|
java.lang.Exception |
getOpenException()
Return any exception generated while trying to open the KAR.
|
void |
openKAR(java.io.File karFile,
boolean forceOpen,
boolean updateHistory)
Process the new kar file into the actor library.
|
void |
setArchiveFileToOpen(java.io.File archiveFile)
Explicitly set the Archive file that the action will open.
|
void |
updateHistoryAndLastDirectory(boolean updateHistoryAndLastDirectory)
Change whether or not to update Kepler's Recent Files menu, and
last directory setting.
|
getFigure, getFrame, getSourceType, getTarget, getX, getY, offsetFigure
public OpenArchiveAction(TableauFrame parent)
parent
- the "frame" (derived from ptolemy.gui.Top) where the menu is
being added.public void setArchiveFileToOpen(java.io.File archiveFile)
archiveFile
- public void updateHistoryAndLastDirectory(boolean updateHistoryAndLastDirectory)
updateHistoryAndLastDirectory
- public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class FigureAction
e
- ActionEventpublic java.lang.Exception getOpenException()
public void openKAR(java.io.File karFile, boolean forceOpen, boolean updateHistory) throws java.lang.Exception
karFile
- the file to processforceOpen
- java.lang.Exception
protected void _open(java.io.File file)
protected void _read(java.net.URL url) throws java.lang.Exception
url
- The URL to read.java.lang.Exception
- If the URL cannot be read, or if there is no
tableau.