Packagecom.yworks.remote
Classpublic class SaveHandler
InheritanceSaveHandler Inheritance AbstractFileWriteHandler Inheritance flash.events.EventDispatcher

Handler which saves the given graph as GraphML in a file using a flash.net.FileReference.

For a server-based write handler, see class DownloadHandler

See also

com.yworks.remote.DownloadHandler


Public Properties
 PropertyDefined By
 InheritedfileName : String
[read-only] The name of the last successfully downloaded file.
AbstractFileWriteHandler
 InheritedoutputIOHandler : GraphMLIOHandler
Get or set the GraphMLIOHandler instance that will be used for graph serialization.
AbstractFileWriteHandler
Protected Properties
 PropertyDefined By
 InheritedfileReference : FileReference
The FileReference which handles the file operations.
AbstractFileWriteHandler
Public Methods
 MethodDefined By
  
SaveHandler(roundtripHandler:RoundtripHandler = null)
Creates a new instance with the given RoundtripHandler as output handler.
SaveHandler
  
save(graph:IGraph, defaultFileName:String):void
Opens a file dialog and saves the GraphML which represents the given graph.
SaveHandler
Protected Methods
 MethodDefined By
 Inherited
createFileReference():FileReference
Creates a new FileReference and sets the fileReference property.
AbstractFileWriteHandler
 Inherited
Create the GraphML representation of the given graph.
AbstractFileWriteHandler
 Inherited
Create the GraphMLIOHandler instance that will be used for graph serialization.
AbstractFileWriteHandler
 Inherited
onCancel(evt:Event):void
Called when the user cancels the download using the file chooser's cancel button.
AbstractFileWriteHandler
 Inherited
onComplete(evt:Event):void
Called when the download operation has finished successfully.
AbstractFileWriteHandler
 Inherited
onHTTPStatus(evt:HTTPStatusEvent):void
Called when the server sends a HTTP status.
AbstractFileWriteHandler
 Inherited
onIOError(evt:IOErrorEvent):void
Called when an IO error occurs while executing the file download.
AbstractFileWriteHandler
 Inherited
onProgress(evt:ProgressEvent):void
Dispatched periodically during the file upload or download operation.
AbstractFileWriteHandler
 Inherited
onSecurityError(evt:SecurityErrorEvent):void
Called when a security error occurs while executing the file download.
AbstractFileWriteHandler
 Inherited
onSelect(evt:Event):void
Called when the user has selected a location for the file download.
AbstractFileWriteHandler
Constructor Detail
SaveHandler()Constructor
public function SaveHandler(roundtripHandler:RoundtripHandler = null)

Creates a new instance with the given RoundtripHandler as output handler.

Parameters
roundtripHandler:RoundtripHandler (default = null) — The handler to use as provider for an output handler. If none is provided a new DefaultGraphMLIOHandler is used as output handler.
Method Detail
save()method
public function save(graph:IGraph, defaultFileName:String):void

Opens a file dialog and saves the GraphML which represents the given graph.

Event handling can be customized by overriding the various protected event handler functions.

Parameters

graph:IGraph — The graph instance that is to be serialized.
 
defaultFileName:String — The default file name to be shown in the browser's download dialog.