Packageimpression.utilities
Classpublic class LessonMapController
InheritanceLessonMapController Inheritance flash.events.EventDispatcher

The LessonMapController combines a LessonMap object and a StoryboardCollection object, and provides methods for working with both.



Public Properties
 PropertyDefined By
  absoluteCount : Number
[read-only] The number of items in map.
LessonMapController
  absolutePosition : Number
[read-only] The absolute position of currentStoryboard.
LessonMapController
  currentStoryboard : Storyboard
The current storyboard.
LessonMapController
  firstChild : Storyboard
[read-only] Returns the first child of currentStoryboard.
LessonMapController
  firstSibling : Storyboard
[read-only] Returns the first sibling of currentStoryboard.
LessonMapController
  firstStoryboard : Storyboard
[read-only] Returns the first storyboard in the map.
LessonMapController
  lastChild : Storyboard
[read-only] Returns the last child of currentStoryboard.
LessonMapController
  lastDescendant : Storyboard
[read-only] Returns the last descendant of currentStoryboard.
LessonMapController
  lastSibling : Storyboard
[read-only] Returns the last sibling of currentStoryboard.
LessonMapController
  lastStoryboard : Storyboard
[read-only] Returns the last storyboard in the map.
LessonMapController
  map : LessonMap
The LessonMap object associated with the object.
LessonMapController
  nextLinear : Storyboard
[read-only] Returns the next linear storyboard of currentStoryboard.
LessonMapController
  nextSibling : Storyboard
[read-only] Returns the next sibling of currentStoryboard.
LessonMapController
  parent : Storyboard
[read-only] Returns the parent of currentStoryboard.
LessonMapController
  previousLinear : Storyboard
[read-only] Returns the previous linear storyboard of currentStoryboard.
LessonMapController
  previousSibling : Storyboard
[read-only] Returns the previous sibling of currentStoryboard.
LessonMapController
  relativeCount : Number
[read-only] The number of siblings of currentStoryboard.
LessonMapController
  relativePath : String
[read-only] The dot-separated list of relative positions of currentStoryboard and its ancestors.
LessonMapController
  relativePosition : Number
[read-only] The relative position of currentStoryboard.
LessonMapController
  storyboards : StoryboardCollection
The StoryboardCollection object associated with the object.
LessonMapController
  topAncestor : Storyboard
[read-only] Returns the top ancestor of currentStoryboard.
LessonMapController
Public Methods
 MethodDefined By
  
LessonMapController(map:LessonMap = null, storyboards:StoryboardCollection = null, current:* = null)
Creates a new instance of the LessonMapController class.
LessonMapController
  
Returns a copy of the object.
LessonMapController
  
Returns the first child of an item.
LessonMapController
  
Returns the first sibling of an item.
LessonMapController
  
Returns a copy of map without hierarchical data.
LessonMapController
  
Returns the aggregate status of a location.
LessonMapController
  
getMapFromCollection(appendMissing:Boolean = false):LessonMap
Returns a LessonMap object based on the collection.
LessonMapController
  
Returns a LessonMap object based on the location.
LessonMapController
  
Returns a LessonMap object containing the ancestors of currentStoryboard.
LessonMapController
  
getMapOfChildren(deep:Boolean = true):LessonMap
Returns a LessonMap object containing the descendants of currentStoryboard.
LessonMapController
  
Returns a LessonMap object containing the descendants of currentStoryboard.
LessonMapController
  
getRelative(relativeLocation:String):Storyboard
Returns the relative of currentStoryboard.
LessonMapController
  
labelMap(label:String = %TITLE_OR_SBID%, attribute:String = label):void
Adds a label to each item in the map.
LessonMapController
  
Returns the last child of an item.
LessonMapController
  
Returns the last descendant of an item.
LessonMapController
  
Returns the last sibling of an item.
LessonMapController
  
Returns the next linear storyboard of an item.
LessonMapController
  
Returns the next sibling of an item.
LessonMapController
  
Returns the parent of an item.
LessonMapController
  
Returns the previous linear storyboard of an item.
LessonMapController
  
Returns the previous sibling of an item.
LessonMapController
  
relativeOf(sb:Storyboard, relativeLocation:String):Storyboard
Returns the relative of an item.
LessonMapController
  
Returns a resolved version of a LocationData object.
LessonMapController
  
setCurrent(item:*):void
Sets the currentStoryboard to the storyboard specified by item.
LessonMapController
  
Returns the top ancestor of an item.
LessonMapController
  
toSBIDArray():Array
Returns an array of sbid references in map.
LessonMapController
  
Returns an array of Storyboard objects referenced in map and present in storyboards.
LessonMapController
  
Returns a StoryboardCollection object containing the storyboards referenced in map and present in storyboards.
LessonMapController
Events
 Event Summary Defined By
  Dispatched when the value of currentStoryboard has changed.LessonMapController
Public Constants
 ConstantDefined By
  ABSCOUNT : String = %ABSCOUNT%
[static] The number of storyboards in the map.
LessonMapController
  ABSPOS : String = %ABSPOS%
[static] The absolute position of the storyboard in the map.
LessonMapController
  IDENTIFIER : String = %IDENTIFIER%
[static] The identifier of the storyboard.
LessonMapController
  RELCOUNT : String = %RELCOUNT%
[static] The number of siblings of the storyboard in the map.
LessonMapController
  RELPATH : String = %RELPATH%
[static] The dot-seperated list of relative positions for the storyboard in the map.
LessonMapController
  RELPOS : String = %RELPOS%
[static] The relative position of the storyboard in the map.
LessonMapController
  SBID : String = %SBID%
[static] The sbid of the storyboard.
LessonMapController
  TITLE : String = %TITLE%
[static] The title of the storyboard.
LessonMapController
  TITLE_OR_SBID : String = %TITLE_OR_SBID%
[static] The title of the storyboard, or its sbid if the title is blank.
LessonMapController
Property Detail
absoluteCountproperty
absoluteCount:Number  [read-only]

The number of items in map.

If map is null, -1 is returned.


Implementation
    public function get absoluteCount():Number

See also

absolutePositionproperty 
absolutePosition:Number  [read-only]

The absolute position of currentStoryboard.

If map is null, -1 is returned.


Implementation
    public function get absolutePosition():Number

See also

currentStoryboardproperty 
currentStoryboard:Storyboard

The current storyboard.

Setting this value will cause the LessonMapControllerEvent.CHANGE event to be dispatched.


Implementation
    public function get currentStoryboard():Storyboard
    public function set currentStoryboard(value:Storyboard):void

See also

firstChildproperty 
firstChild:Storyboard  [read-only]

Returns the first child of currentStoryboard.


Implementation
    public function get firstChild():Storyboard

See also

firstSiblingproperty 
firstSibling:Storyboard  [read-only]

Returns the first sibling of currentStoryboard.


Implementation
    public function get firstSibling():Storyboard

See also

firstStoryboardproperty 
firstStoryboard:Storyboard  [read-only]

Returns the first storyboard in the map.


Implementation
    public function get firstStoryboard():Storyboard

See also

lastChildproperty 
lastChild:Storyboard  [read-only]

Returns the last child of currentStoryboard.


Implementation
    public function get lastChild():Storyboard

See also

lastDescendantproperty 
lastDescendant:Storyboard  [read-only]

Returns the last descendant of currentStoryboard.


Implementation
    public function get lastDescendant():Storyboard

See also

lastSiblingproperty 
lastSibling:Storyboard  [read-only]

Returns the last sibling of currentStoryboard.


Implementation
    public function get lastSibling():Storyboard

See also

lastStoryboardproperty 
lastStoryboard:Storyboard  [read-only]

Returns the last storyboard in the map.


Implementation
    public function get lastStoryboard():Storyboard

See also

mapproperty 
map:LessonMap

The LessonMap object associated with the object.


Implementation
    public function get map():LessonMap
    public function set map(value:LessonMap):void
nextLinearproperty 
nextLinear:Storyboard  [read-only]

Returns the next linear storyboard of currentStoryboard.


Implementation
    public function get nextLinear():Storyboard

See also

nextSiblingproperty 
nextSibling:Storyboard  [read-only]

Returns the next sibling of currentStoryboard.


Implementation
    public function get nextSibling():Storyboard

See also

parentproperty 
parent:Storyboard  [read-only]

Returns the parent of currentStoryboard.


Implementation
    public function get parent():Storyboard

See also

previousLinearproperty 
previousLinear:Storyboard  [read-only]

Returns the previous linear storyboard of currentStoryboard.


Implementation
    public function get previousLinear():Storyboard

See also

previousSiblingproperty 
previousSibling:Storyboard  [read-only]

Returns the previous sibling of currentStoryboard.


Implementation
    public function get previousSibling():Storyboard

See also

relativeCountproperty 
relativeCount:Number  [read-only]

The number of siblings of currentStoryboard.

If map is null, -1 is returned.


Implementation
    public function get relativeCount():Number

See also

relativePathproperty 
relativePath:String  [read-only]

The dot-separated list of relative positions of currentStoryboard and its ancestors.

If map is null, the empty string ("") is returned.


Implementation
    public function get relativePath():String

See also

relativePositionproperty 
relativePosition:Number  [read-only]

The relative position of currentStoryboard.

If map is null, -1 is returned.


Implementation
    public function get relativePosition():Number

See also

storyboardsproperty 
storyboards:StoryboardCollection

The StoryboardCollection object associated with the object.


Implementation
    public function get storyboards():StoryboardCollection
    public function set storyboards(value:StoryboardCollection):void
topAncestorproperty 
topAncestor:Storyboard  [read-only]

Returns the top ancestor of currentStoryboard.


Implementation
    public function get topAncestor():Storyboard

See also

Constructor Detail
LessonMapController()Constructor
public function LessonMapController(map:LessonMap = null, storyboards:StoryboardCollection = null, current:* = null)

Creates a new instance of the LessonMapController class.

Parameters
map:LessonMap (default = null) — The LessonMap object associated with the object.
 
storyboards:StoryboardCollection (default = null) — The StoryboardCollection object associated with the object.
 
current:* (default = null) — An expression specifying the current storyboard.

See also

Method Detail
clone()method
public function clone():LessonMapController

Returns a copy of the object.

Returns
LessonMapController — A copy of the object.
firstChildOf()method 
public function firstChildOf(sb:Storyboard):Storyboard

Returns the first child of an item.

Parameters

sb:Storyboard — The storyboard to return the first child of.

Returns
Storyboard — The first child of sb, or null if one cannot be found.

See also

firstSiblingOf()method 
public function firstSiblingOf(sb:Storyboard):Storyboard

Returns the first sibling of an item.

Parameters

sb:Storyboard — The storyboard to return the first sibling of.

Returns
Storyboard — The first sibling of sb, or null if one cannot be found.

See also

getLinearMap()method 
public function getLinearMap():LessonMap

Returns a copy of map without hierarchical data. If map is null, an empty map is returned.

Returns
LessonMap — A copy of the map without hierarchical data.

See also

getLocationStatus()method 
public function getLocationStatus(location:LocationData):String

Returns the aggregate status of a location.

This method returns the result of invoking the getLocationStatus() method on the object's associated LessonMap object using the location parameter and the currentStoryboard property value. If the map property value is null, LocationStatusTypes.UNKNOWN is returned.

Parameters

location:LocationData — The location to return the aggregate status of.

Returns
String — A LocationStatusTypes value identifying the aggregate status of the storyboards.

See also

getMapFromCollection()method 
public function getMapFromCollection(appendMissing:Boolean = false):LessonMap

Returns a LessonMap object based on the collection.

This method returns the result of invoking the getMapFromCollection() method on the object's associated LessonMap object using the storyboards property value and the appendMissing parameter. If the map property value is null, an empty map is returned.

If the appendMissing parameter value is true, any storyboards in the collection but not referenced in the current map are appended to the end of the map in no defined order. If the parameter value is false, any unreferenced storyboards in the collection are ignored.

Parameters

appendMissing:Boolean (default = false) — Indicates how to process unreferenced storyboards in the collection.

Returns
LessonMap — A LessonMap object containing the subset of this map that includes storyboards contained in the collection.

See also

getMapFromLocation()method 
public function getMapFromLocation(location:LocationData):LessonMap

Returns a LessonMap object based on the location.

This method returns the result of invoking the getMapFromLocation() method on the object's associated LessonMap object using the location parameter and the currentStoryboard property value. If the map property value is null, an empty map is returned.

Parameters

location:LocationData — The location to build a map of.

Returns
LessonMap — A LessonMap object containing the subset of this map that falls within the location.

See also

getMapOfAncestors()method 
public function getMapOfAncestors():LessonMap

Returns a LessonMap object containing the ancestors of currentStoryboard.

This method returns the result of invoking the getMapOfAncestors() method on the object's associated LessonMap object using the currentStoryboard property value. If the map property value is null, an empty map is returned.

Returns
LessonMap — A LessonMap object containing the ancestors of currentStoryboard.

See also

getMapOfChildren()method 
public function getMapOfChildren(deep:Boolean = true):LessonMap

Returns a LessonMap object containing the descendants of currentStoryboard.

If deep is false, only direct children of the current storyboard will be added to the returned LessonMap object. If deep is true, all descendants will be added to the returned object. In this case, invoking this method is the same as invoking getMapOfDescendants().

This method returns the result of invoking the getMapOfChildren() method on the object's associated LessonMap object using the currentStoryboard property value and the deep parameter. If the map property value is null, an empty map is returned.

Parameters

deep:Boolean (default = true) — Specifies how descendants should be handled.

Returns
LessonMap — A LessonMap object containing the children of currentStoryboard.

See also

getMapOfDescendants()method 
public function getMapOfDescendants():LessonMap

Returns a LessonMap object containing the descendants of currentStoryboard.

This method returns the result of invoking the getMapOfDescendants() method on the object's associated LessonMap object using the currentStoryboard property value. If the map property value is null, an empty map is returned.

Returns
LessonMap — A LessonMap object containing the descendants of currentStoryboard.

See also

getRelative()method 
public function getRelative(relativeLocation:String):Storyboard

Returns the relative of currentStoryboard.

Parameters

relativeLocation:String — The relative location to retrieve the value of. This should be one of the RelativeLocations constant values.

Returns
Storyboard — The Storyboard object that is the relative of currentStoryboard, or null if no relative can be found.

See also

labelMap()method 
public function labelMap(label:String = %TITLE_OR_SBID%, attribute:String = label):void

Adds a label to each item in the map.

The label is added as an attribute to each XML node. In addition, an attribute is added to the map root; this attribute contains the name of the map.

Note that the LessonMapViewer object invokes this method before loading a map into the TreeView.

Parameters

label:String (default = %TITLE_OR_SBID%) — The label to add to each item. If label contains any of the constant values defined in this class, the constant value is replaced by the data from the actual item, if available.
 
attribute:String (default = label) — The name of the attribute to store the label in.


Throws
ArgumentError — Cannot use 'sbid' as map label (ArgumentError).
lastChildOf()method 
public function lastChildOf(sb:Storyboard):Storyboard

Returns the last child of an item.

Parameters

sb:Storyboard — The storyboard to return the last child of.

Returns
Storyboard — The last child of sb, or null if one cannot be found.

See also

lastDescendantOf()method 
public function lastDescendantOf(sb:Storyboard):Storyboard

Returns the last descendant of an item.

Parameters

sb:Storyboard — The storyboard to return the last descendant of.

Returns
Storyboard — The last descendant of sb, or null if one cannot be found.

See also

lastSiblingOf()method 
public function lastSiblingOf(sb:Storyboard):Storyboard

Returns the last sibling of an item.

Parameters

sb:Storyboard — The storyboard to return the last sibling of.

Returns
Storyboard — The last sibling of sb, or null if one cannot be found.

See also

nextLinearOf()method 
public function nextLinearOf(sb:Storyboard):Storyboard

Returns the next linear storyboard of an item.

Parameters

sb:Storyboard — The storyboard to return the next linear item of.

Returns
Storyboard — The next linear item of sb, or null if one cannot be found.

See also

nextSiblingOf()method 
public function nextSiblingOf(sb:Storyboard):Storyboard

Returns the next sibling of an item.

Parameters

sb:Storyboard — The storyboard to return the next sibling of.

Returns
Storyboard — The next sibling of sb, or null if one cannot be found.

See also

parentOf()method 
public function parentOf(sb:Storyboard):Storyboard

Returns the parent of an item.

Parameters

sb:Storyboard — The storyboard to return the parent of.

Returns
Storyboard — The parent of sb, or null if one cannot be found.

See also

previousLinearOf()method 
public function previousLinearOf(sb:Storyboard):Storyboard

Returns the previous linear storyboard of an item.

Parameters

sb:Storyboard — The storyboard to return the previous linear item of.

Returns
Storyboard — The previous linear item of sb, or null if one cannot be found.

See also

previousSiblingOf()method 
public function previousSiblingOf(sb:Storyboard):Storyboard

Returns the previous sibling of an item.

Parameters

sb:Storyboard — The storyboard to return the previous sibling of.

Returns
Storyboard — The previous sibling of sb, or null if one cannot be found.

See also

relativeOf()method 
public function relativeOf(sb:Storyboard, relativeLocation:String):Storyboard

Returns the relative of an item.

Parameters

sb:Storyboard — The Storyboard object to retrieve the relative of.
 
relativeLocation:String — The relative location to retrieve the value of. This should be one of the RelativeLocations constant values.

Returns
Storyboard — The Storyboard object that is the relative of item, or null if no relative can be found.

See also

resolveLocation()method 
public function resolveLocation(location:LocationData):LocationData

Returns a resolved version of a LocationData object.

This method returns the result of invoking the resolveLocation() method on the object's associated LessonMap object using the location parameter and the currentStoryboard property value. If the map property value is null, location is returned without modification.

Parameters

location:LocationData — The object to resolve.

Returns
LocationData — The resolved version of the location parameter.

See also

setCurrent()method 
public function setCurrent(item:*):void

Sets the currentStoryboard to the storyboard specified by item.

Note that, unlike setting the currentStoryboard property, invoking setCurrent() will not cause the LessonMapControllerEvent.CHANGE event to be dispatched.

Parameters

item:* — An expression identifying the new value of currentStoryboard. item can be one of the following types:
  • null. The method sets currentStoryboard to null.
  • Storyboard. The method sets currentStoryboard to item.
  • XML. The method sets currentStoryboard to the item in the storyboards collection as found by invoking the sbidOf() method of the map property. If either map or storyboards is null, the method s ets currentStoryboard to null.
  • String. If item is a relative location, the method sets currentStoryboard to the appropriate relative. If item is not a relative location, and specifies an item in the storyboards collection, the method sets currentStoryboard to the storyboard identified by item. Otherwise, the method sets currentStoryboard to null.


Throws
ArgumentError — Invalid item passed to setCurrent() (ArgumentError).

See also

topAncestorOf()method 
public function topAncestorOf(sb:Storyboard):Storyboard

Returns the top ancestor of an item.

Parameters

sb:Storyboard — The storyboard to return the top ancestor of.

Returns
Storyboard — The top ancestor of sb, or null if one cannot be found.

See also

toSBIDArray()method 
public function toSBIDArray():Array

Returns an array of sbid references in map. If map is null, an empty array is returned.

The return value preserves the linear order of references in the map.

Returns
Array — An array of sbid references in the map.

See also

toStoryboardArray()method 
public function toStoryboardArray():Array

Returns an array of Storyboard objects referenced in map and present in storyboards. If either map or storyboards is null, an empty array is returned.

Returns
Array — An array of storyboards.

See also

toStoryboardCollection()method 
public function toStoryboardCollection():StoryboardCollection

Returns a StoryboardCollection object containing the storyboards referenced in map and present in storyboards.

If either map or storyboards is null, an empty collection is returned.

Returns
StoryboardCollection — A StoryboardCollection object containing the storyboards in the map.

See also

Event Detail
controllerStoryboardChange Event
Event Object Type: impression.events.LessonMapControllerEvent
LessonMapControllerEvent.type property = impression.events.LessonMapControllerEvent.CHANGE

Dispatched when the value of currentStoryboard has changed.

Note that this event is not dispatched if the setCurrent method is used to change the current storyboard.

The LessonMapControllerEvent.CHANGE constant defines the value of the type property of a change 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.
sbThe Storyboard object assigned to the target.
Constant Detail
ABSCOUNTConstant
public static const ABSCOUNT:String = %ABSCOUNT%

The number of storyboards in the map.

ABSPOSConstant 
public static const ABSPOS:String = %ABSPOS%

The absolute position of the storyboard in the map.

IDENTIFIERConstant 
public static const IDENTIFIER:String = %IDENTIFIER%

The identifier of the storyboard.

RELCOUNTConstant 
public static const RELCOUNT:String = %RELCOUNT%

The number of siblings of the storyboard in the map.

RELPATHConstant 
public static const RELPATH:String = %RELPATH%

The dot-seperated list of relative positions for the storyboard in the map.

RELPOSConstant 
public static const RELPOS:String = %RELPOS%

The relative position of the storyboard in the map.

SBIDConstant 
public static const SBID:String = %SBID%

The sbid of the storyboard.

TITLEConstant 
public static const TITLE:String = %TITLE%

The title of the storyboard.

TITLE_OR_SBIDConstant 
public static const TITLE_OR_SBID:String = %TITLE_OR_SBID%

The title of the storyboard, or its sbid if the title is blank.