Saturday, June 16, 2007

File Import and Display


Importing image files from the local file system and populating the image file browser deserves a close inspection. Here the major interactions and collaborating classes are shown in static form along with collaborative details.

When openImageFile is invoked, the File Selection Dialog Box is opened. Once a file has been selected a private event handler, fileOpenSelected(event:FileEvent), is invoked this event handler calls getBitmapFromFile(imageFile:File, onOpenComplete:Function, suppressErrors:Boolean = false) for each image in the directory of the selected file.

For the user selected image onOpenComplete is set to a specific event handler which performs the opening of the image the user requested and submitting the corresponding event. This event is heard by the LightTable and the proper image is displayed in the MainCanvas. Next, fileOpenSelected cranks through every other open-able image in the directory, ignoring errors, and dispatches the "directoryImageFileLoaded" event for each successfully opened image. LightTable listens and adds each image in to the directoryImageViewer.

0 Comments:

Post a Comment

<< Home