Packagecom.yworks.remote
Classpublic class AbstractFileWriteHandler
InheritanceAbstractFileWriteHandler Inheritance flash.events.EventDispatcher
Subclasses DownloadHandler, SaveHandler

Abstract base class for handlers which save graphs as GraphML files. The implementations are DownloadHandler and SaveHandler.

See also

DownloadHandler
SaveHandler


Public Properties
 PropertyDefined By
  fileName : String
[read-only] The name of the last successfully downloaded file.
AbstractFileWriteHandler
  outputIOHandler : GraphMLIOHandler
Get or set the GraphMLIOHandler instance that will be used for graph serialization.
AbstractFileWriteHandler
Protected Properties
 PropertyDefined By
  fileReference : FileReference
The FileReference which handles the file operations.
AbstractFileWriteHandler
Public Methods
 MethodDefined By
  
Create a new instance.
AbstractFileWriteHandler
Protected Methods
 MethodDefined By
  
createFileReference():FileReference
Creates a new FileReference and sets the fileReference property.
AbstractFileWriteHandler
  
Create the GraphML representation of the given graph.
AbstractFileWriteHandler
  
Create the GraphMLIOHandler instance that will be used for graph serialization.
AbstractFileWriteHandler
  
onCancel(evt:Event):void
Called when the user cancels the download using the file chooser's cancel button.
AbstractFileWriteHandler
  
onComplete(evt:Event):void
Called when the download operation has finished successfully.
AbstractFileWriteHandler
  
onHTTPStatus(evt:HTTPStatusEvent):void
Called when the server sends a HTTP status.
AbstractFileWriteHandler
  
onIOError(evt:IOErrorEvent):void
Called when an IO error occurs while executing the file download.
AbstractFileWriteHandler
  
onProgress(evt:ProgressEvent):void
Dispatched periodically during the file upload or download operation.
AbstractFileWriteHandler
  
onSecurityError(evt:SecurityErrorEvent):void
Called when a security error occurs while executing the file download.
AbstractFileWriteHandler
  
onSelect(evt:Event):void
Called when the user has selected a location for the file download.
AbstractFileWriteHandler
Property Detail
fileNameproperty
fileName:String  [read-only]

The name of the last successfully downloaded file.


Implementation
    public function get fileName():String
fileReferenceproperty 
fileReference:FileReference

The FileReference which handles the file operations.


Implementation
    protected function get fileReference():FileReference
    protected function set fileReference(value:FileReference):void
outputIOHandlerproperty 
outputIOHandler:GraphMLIOHandler

Get or set the GraphMLIOHandler instance that will be used for graph serialization.


Implementation
    public function get outputIOHandler():GraphMLIOHandler
    public function set outputIOHandler(value:GraphMLIOHandler):void

See also

Constructor Detail
AbstractFileWriteHandler()Constructor
public function AbstractFileWriteHandler(roundtripHandler:RoundtripHandler = null)

Create a new instance.

Parameters
roundtripHandler:RoundtripHandler (default = null) — The roundtrip handler to receive the outputIOHandler from. If none is provided a new DefaultGraphMLIOHandler will manage the GraphML parsing.

See also

Method Detail
createFileReference()method
protected function createFileReference():FileReference

Creates a new FileReference and sets the fileReference property.

This method registers all event listeners to the appropriate callbacks and thus should be used to create the file reference in a save or upload method.

Returns
FileReference — A file reference instance.
createGraphML()method 
protected function createGraphML(graph:IGraph):XML

Create the GraphML representation of the given graph.

Parameters

graph:IGraph — The graph to be serialized

Returns
XML — The GraphML as XML

See also

createOutputIOHandler()method 
protected function createOutputIOHandler():GraphMLIOHandler

Create the GraphMLIOHandler instance that will be used for graph serialization. This implementation uses the RoundtripHandler that has been passed to the constructor and returns its output io handler. If no RoundtripHandler was provided, a new DefaultGraphMLIOHandler is returned.

Returns
GraphMLIOHandler — the GraphMLIOHandler instance created.

See also

onCancel()method 
protected function onCancel(evt:Event):void

Called when the user cancels the download using the file chooser's cancel button.

Flash Player does not dispatch this event if the user cancels an upload or download through other means (closing the browser or stopping the current application).

This implementation does nothing.

Parameters

evt:Event

onComplete()method 
protected function onComplete(evt:Event):void

Called when the download operation has finished successfully.

This implementation removes the busy cursor.

Parameters

evt:Event

onHTTPStatus()method 
protected function onHTTPStatus(evt:HTTPStatusEvent):void

Called when the server sends a HTTP status.

This implementation is empty.

Parameters

evt:HTTPStatusEvent

onIOError()method 
protected function onIOError(evt:IOErrorEvent):void

Called when an IO error occurs while executing the file download.

This implementation shows an alert message, traces the event and removes the busy cursor.

Parameters

evt:IOErrorEvent

onProgress()method 
protected function onProgress(evt:ProgressEvent):void

Dispatched periodically during the file upload or download operation.

The progress event is dispatched while Flash Player transmits bytes to a server, and it is periodically dispatched during the transmission, even if the transmission is ultimately not successful. To determine if and when the file transmission is actually successful and complete, listen for the complete event.

In some cases, progress events are not received. For example, when the file being transmitted is very small or the upload or download happens very quickly a progress event might not be dispatched.

This implementation does nothing.

Parameters

evt:ProgressEvent

onSecurityError()method 
protected function onSecurityError(evt:SecurityErrorEvent):void

Called when a security error occurs while executing the file download.

This implementation shows an alert message, traces the event and removes the busy cursor.

Parameters

evt:SecurityErrorEvent

onSelect()method 
protected function onSelect(evt:Event):void

Called when the user has selected a location for the file download.

This implementation sets the busy cursor.

Parameters

evt:Event