JGraphpad Pro
v6.0.5.0


com.jgraph
Class JGraphpadDemo.JGraphpadDemoFileAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended bycom.jgraph.editor.JGraphEditorAction
          extended bycom.jgraph.pad.action.JGraphpadFileAction
              extended bycom.jgraph.JGraphpadDemo.JGraphpadDemoFileAction
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable
Enclosing class:
JGraphpadDemo

public static class JGraphpadDemo.JGraphpadDemoFileAction
extends JGraphpadFileAction

Replaces file open / save action with different actions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.jgraph.pad.action.JGraphpadFileAction
JGraphpadFileAction.AllActions
 
Nested classes inherited from class com.jgraph.editor.JGraphEditorAction
JGraphEditorAction.Bundle
 
Field Summary
 
Fields inherited from class com.jgraph.pad.action.JGraphpadFileAction
dlgs, editor, KEY_EDGEPROTOTYPE, KEY_MAINWINDOW, KEY_RECENTFILES, KEY_VERTEXPROTOTYPE, lastDirectory, MAX_RECENTFILES, MIME_HTML, MIME_PLAINTEXT, NAME_CLOSE, NAME_CLOSEALL, NAME_DOWNLOAD, NAME_EXIT, NAME_IMPORTCSV, NAME_NEWDIAGRAM, NAME_NEWDOCUMENT, NAME_NEWLIBRARY, NAME_OPEN, NAME_PAGESETUP, NAME_PRINT, NAME_REMOVEDIAGRAM, NAME_RENAMEDIAGRAM, NAME_SAVE, NAME_SAVEALL, NAME_SAVEAS, NAME_SAVEIMAGE, NAME_UPLOADAS
 
Fields inherited from class com.jgraph.editor.JGraphEditorAction
isToggleAction, PROPERTY_ISSELECTED, PROPERTY_ISVISIBLE
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
JGraphpadDemo.JGraphpadDemoFileAction(String name, JGraphEditor editor)
           
 
Method Summary
protected  void doOpenFile(String filename)
          Replaces the saveFile action with an error message.
 void doSave(String filename, byte[] data)
          Replaces the open action with an error message.
protected  void doSaveFile(JGraphEditorFile file, boolean forceFilenameDialog, boolean urlDialog)
          Replaces the saveFile action with an error message.
 
Methods inherited from class com.jgraph.pad.action.JGraphpadFileAction
actionPerformed, convert, doCloseAll, doCloseFile, doExit, doImportCSV, doNewDiagram, doNewDocument, doNewLibrary, doOpenFile, doPageSetup, doPrintDiagramPane, doRemoveDiagram, doRenameDiagram, doSaveAll, doSaveImage, getCellForKey, getFileCount, getFileCount, getPermanentFocusOwnerFile, getPermanentFocusOwnerLibraryPane, importCSVFile, isLibrary, makeMimeForm, post, post, postPlain
 
Methods inherited from class com.jgraph.editor.JGraphEditorAction
getActiveFrame, getFrame, getJGraphpadPane, getJGraphpadPane, getName, getParentGraph, getPermanentFocusOwner, getPermanentFocusOwnerDiagram, getPermanentFocusOwnerDiagramPane, getPermanentFocusOwnerGraph, getPermanentFocusOwnerOrParent, getString, isSelected, isToggleAction, isVisible, setEnabled, setSelected, setToggleAction, setVisible
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGraphpadDemo.JGraphpadDemoFileAction

public JGraphpadDemo.JGraphpadDemoFileAction(String name,
                                             JGraphEditor editor)
Parameters:
name -
editor -
Method Detail

doSaveFile

protected void doSaveFile(JGraphEditorFile file,
                          boolean forceFilenameDialog,
                          boolean urlDialog)
                   throws IOException
Replaces the saveFile action with an error message.

Overrides:
doSaveFile in class JGraphpadFileAction
Parameters:
file - The file to be saved.
forceFilenameDialog - Whether to display a dialog regardless of the filename.
urlDialog - Whether to display an URL dialog to specifiy the filename.
Throws:
IOException - If the file cannot be saved.
See Also:
JGraphEditorModel.getOutputStream(String), JGraphpadFileAction.postPlain(URL, String, OutputStream)

doSave

public void doSave(String filename,
                   byte[] data)
            throws Exception
Replaces the open action with an error message.

Overrides:
doSave in class JGraphpadFileAction
Parameters:
filename - The filename of the file to be written.
data - The array of bytes to write to the file.
Throws:
Exception

doOpenFile

protected void doOpenFile(String filename)
                   throws MalformedURLException,
                          IOException
Replaces the saveFile action with an error message.

Throws:
MalformedURLException
IOException

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.