Packageimpression.utilities
Classpublic class LessonMapViewer
InheritanceLessonMapViewer Inheritance flash.events.EventDispatcher

The LessonMapViewer class combines a TreeView and a LessonMapController to provide a display for a LessonMap.



Public Properties
 PropertyDefined By
  controller : LessonMapController
The LessonMapController associated with this object.
LessonMapViewer
  currentStoryboard : Storyboard
[read-only] The current storyboard.
LessonMapViewer
  labelTemplate : String
The template string to use to label the LessonMap objects displayed in the TreeView.
LessonMapViewer
  treeView : TreeView
[read-only] The TreeView associated with this object.
LessonMapViewer
Public Methods
 MethodDefined By
  
LessonMapViewer(tvw:TreeView, controller:LessonMapController = null, labelTemplate:String = null)
Creates a new instance of the LessonMapViewer class.
LessonMapViewer
  
Returns the TreeNode object of an item.
LessonMapViewer
  
sbidOf(item:*):String
Returns the sbid of an item.
LessonMapViewer
  
Returns the storyboard of an item.
LessonMapViewer
  
Ensures that the selected node of the object's TreeView matches the controller's currentStoryboard.
LessonMapViewer
Events
 Event Summary Defined By
  Dispatched when a LessonMap has been loaded into the associated TreeView.LessonMapViewer
  Dispatched when a new node is selected in the associated TreeView.LessonMapViewer
  Dispatched when the object receives a request to select a node.LessonMapViewer
Property Detail
controllerproperty
controller:LessonMapController

The LessonMapController associated with this object.

When this property is set to a non-null value, and the controller's map property is non-null, the LessonMapViewer will label the map using the labelTemplate property value, then invoke the treeView object's loadXML method using the controller's map.

Note: Do not change the map property of the controller once it has been passed to the LessonMapViewer. Changes to the controller's map are not reflected in the LessonMapViewer and unexpected results may occur. Instead, create a new LessonMapController and pass that object to this property, or reassociate the existing controller with the viewer by setting the controller property value to the existing controller.


Implementation
    public function get controller():LessonMapController
    public function set controller(value:LessonMapController):void

See also

currentStoryboardproperty 
currentStoryboard:Storyboard  [read-only]

The current storyboard.

If controller is null, then null is returned.


Implementation
    public function get currentStoryboard():Storyboard

See also

labelTemplateproperty 
labelTemplate:String

The template string to use to label the LessonMap objects displayed in the TreeView.

If controller is non-null, the controller's map will be relabeled and redisplayed when this property is changed.

The default value is LessonMapController.TITLE_OR_SBID.


Implementation
    public function get labelTemplate():String
    public function set labelTemplate(value:String):void

See also

treeViewproperty 
treeView:TreeView  [read-only]

The TreeView associated with this object.


Implementation
    public function get treeView():TreeView

See also

Constructor Detail
LessonMapViewer()Constructor
public function LessonMapViewer(tvw:TreeView, controller:LessonMapController = null, labelTemplate:String = null)

Creates a new instance of the LessonMapViewer class.

If labelTemplate is null, the default value is used.

Parameters
tvw:TreeView — The TreeView object to be associated with this object.
 
controller:LessonMapController (default = null) — The LessonMapController object initially associated with this object.
 
labelTemplate:String (default = null) — The template string to use to label the LessonMap objects displayed in the TreeView.

Throws
ArgumentError tvw — cannot be null (ArgumentError).

See also

Method Detail
nodeOf()method
public function nodeOf(item:*):TreeNode

Returns the TreeNode object of an item.

If item is null, controller is null, or the controller's map property is null, null is returned.

Parameters

item:* — The item to return the node of.

Returns
TreeNode — The TreeNode object associated with item. If item does not have an associated node, null is returned.

See also

sbidOf()method 
public function sbidOf(item:*):String

Returns the sbid of an item.

Parameters

item:* — Expression identifying the item to return the sbid value of. item can be one of the following types:
  • null. The method returns the empty string ("").
  • String. The method returns item.
  • Storyboard. The method returns item's sbid property value.
  • XML. The method returns the result of invoking the sbidOf() method of the controller object's map property. If either the controller or its map is null, the empty string ("") is returned.
  • TreeNode. This method returns the result of calling sbidOf with the value of the TreeNode's source property.
  • [other types]. The method returns the empty string ("").

Returns
String — The sbid of the item.

See also

storyboardOf()method 
public function storyboardOf(item:*):Storyboard

Returns the storyboard of an item.

If item is null, the controller property value is null, or the controller's storyboards property value is null, then null is returned. Otherwise, this method returns the result of invoking the controller's storyboards object's item() method with the return value from this object's sbidOf() method.

Parameters

item:* — Expression identifying the item to return the storyboard of.

Returns
Storyboard — The storyboard specified by item.

See also

synchronize()method 
public function synchronize():void

Ensures that the selected node of the object's TreeView matches the controller's currentStoryboard.

Event Detail
lessonMapViewerLoadComplete Event
Event Object Type: impression.events.LessonMapViewerEvent
LessonMapViewerEvent.type property = impression.events.LessonMapViewerEvent.LOAD_COMPLETE

Dispatched when a LessonMap has been loaded into the associated TreeView.

This event is dispatched when the associated TreeView object dispatches its load complete event.

The LessonMapViewerEvent.LOAD_COMPLETE constant defines the value of the type property of a lesson map viewer load complete event object. This event has the following properties:
PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that raised the event.
reasonIndicates why the event occurred.
nodeThe node associated with the event.
sbThe Storyboard object associated with the selected node.

See also

lessonMapViewerSelected Event  
Event Object Type: impression.events.LessonMapViewerEvent
LessonMapViewerEvent.type property = impression.events.LessonMapViewerEvent.SELECTED

Dispatched when a new node is selected in the associated TreeView.

This event is dispatched when the associated TreeView object dispatches its selected event.

The LessonMapViewerEvent.SELECTED constant defines the value of the type property of a lesson map viewer selected event object. This event has the following properties:
PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that raised the event.
reason
node
sbThe Storyboard object associated with the selected node.

See also

lessonMapViewerSelectRequest Event  
Event Object Type: impression.events.LessonMapViewerRequestEvent
LessonMapViewerRequestEvent.type property = impression.events.LessonMapViewerRequestEvent.SELECT_REQUEST

Dispatched when the object receives a request to select a node.

This event is dispatched when the associated TreeView object dispatches its selection request event.

If the reason property of the event is LessonMapViewerEventReasons.LOAD_COMPLETE, the value of the newNode and newSB properties will be the value of the controller's currentStoryboard property.

The LessonMapViewerRequestEvent.SELECT_REQUEST constant defines the value of the type property of a select request event object. This event has the following properties:
PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that raised the event.
reason
oldNode
newNode
oldSBThe Storyboard object associated with the currently selected node.
newSBThe Storyboard object associated with the new node to select.

See also