Packagecom.adobe.flex.extras.controls.springgraph
Classpublic class Roamer
InheritanceRoamer Inheritance SpringGraph Inheritance mx.containers.Canvas

An extension to SpringGraph that restricts the visible items to a subset of the full graph. You can control which items are currently visible by using the itemLimit, maxDistanceFromCurrent, and currentItem properties.



Public Properties
 PropertyDefined by
 InheritedaddItemEffect : Effect
An effect that applied to all itemRenderer instances when they are add to the spring graph.
SpringGraph
 InheritedautoFit : Boolean
Enable/disable the auto-fit feature.
SpringGraph
  backOK : Boolean
[read-only] Whether the back() function will have any effect at the moment.
Roamer
  currentItem : Item
The item that current acts as the 'center' or 'root' of the graph.
Roamer
  dataProvider : Object
Defines the data model for this springgraph.
Roamer
 InheritededgeRenderer : IEdgeRenderer
Defines an Edge Renderer object that we will use to render edges.
SpringGraph
  forwardOK : Boolean
[read-only] Whether the forward() function will have any effect at the moment
Roamer
  fullNodeCount : int
[read-only] The total number of items in the dataProvider.
Roamer
  history : Array
[read-only] An ordered list of all the items that been the current item.
Roamer
  historyIndex : int
The index into "history" that corresponds to the currentItem.
Roamer
  itemLimit : int
The maximum number of items that are visible at any time.
Roamer
 InheriteditemRenderer : IFactory
Defines the UIComponent class for rendering an item.
SpringGraph
 InheritedlineColor : int
The color we use to draw the lines that represent links between items.
SpringGraph
  maxDistanceFromCurrent : int
We only display items that are within this distance from the current item.
Roamer
 InheritedmotionThreshold : Number
[for experimental use].
SpringGraph
 InheritedremoveItemEffect : Effect
An effect that is applied to all itemRenderer instances when they are removed from the spring graph.
SpringGraph
 InheritedrepulsionFactor : Number
How strongly do items push each other away.
SpringGraph
  showHistory : Boolean
If true, then all items that have been the 'current item' are made visible.
Roamer
  tidyHistory : Boolean
Keeps all visibleHistoryItems clustered together.
Roamer
 InheritedviewFactory : IViewFactory
A factory that can create views for specific Items.
SpringGraph
  visibleHistoryItems : Object
[read-only] A list of all the items that are currently visible only because showHistory is enabled.
Roamer
  visibleNodeCount : int
[read-only] The number of items in the dataProvider that are currently visible.
Roamer
 InheritedxmlNames : Array
The XML element and attribute names to use when parsing an XML dataProvider.
SpringGraph
Public Methods
 MethodDefined by
  
back():void
Sets the currentItem to the previous history Item.
Roamer
  
distance(fromItem:Item, toItem:Item):int
Calulate the distance between 2 items.
Roamer
 Inherited
empty():void
Throw away the dataProvider, leaving an empty graph.
SpringGraph
  
forward():void
Sets the currentItem to the next history Item.
Roamer
  
hasBeenCurrentItem(item:Item):Boolean
Find out if a given item has ever been the currentItem.
Roamer
  
hideItem(item:Item):void
Force the item to not be shown, even if it is inside the limits set by 'maxDistanceFromCurrent'.
Roamer
 Inherited
refresh():void
Redraw everything.
SpringGraph
  
resetHistory():void
Forget which items have been the current item.
Roamer
  
Cancels the effect of any prior calls to hideItem and/or showItem.
Roamer
  
setDataProvider(dp:XML, currentId:String):void
sets the data provider and chooses the initial currentItem.
Roamer
  
showItem(item:Item):void
Force the item to be shown, even if it is outside the limits set by 'maxDistanceFromCurrent'.
Roamer
Events
 EventSummaryDefined by
   Dispatched when there is any change to the nodes and/or links of this graph.Roamer
Property detail
backOKproperty
backOK:Boolean  [read-only]

Whether the back() function will have any effect at the moment.

This property can be used as the source for data binding.

Implementation
    public function get backOK():Boolean
currentItemproperty 
currentItem:Item  [read-write]

The item that current acts as the 'center' or 'root' of the graph. This item defines the subset of the graph that will be visible.

Implementation
    public function get currentItem():Item
    public function set currentItem(value:Item):void
dataProviderproperty 
dataProvider:Object  [read-write]

Defines the data model for this springgraph. See SpringGraph.dataProvider for more information.

This property can be used as the source for data binding.

Implementation
    public function get dataProvider():Object
    public function set dataProvider(value:Object):void
forwardOKproperty 
forwardOK:Boolean  [read-only]

Whether the forward() function will have any effect at the moment

This property can be used as the source for data binding.

Implementation
    public function get forwardOK():Boolean
fullNodeCountproperty 
fullNodeCount:int  [read-only]

The total number of items in the dataProvider.

Implementation
    public function get fullNodeCount():int
historyproperty 
history:Array  [read-only]

An ordered list of all the items that been the current item.

This property can be used as the source for data binding.

Implementation
    public function get history():Array
historyIndexproperty 
historyIndex:int  [read-write]

The index into "history" that corresponds to the currentItem. Can be any number between 0 and the index of the most recent history entry. Usually this is simply the index of the most recent history entry. However, if you've used back() or forward() then this index will vary. You can also set this index to any valid value; this will cause currentItem to become the corresponding history item.

This property can be used as the source for data binding.

Implementation
    public function get historyIndex():int
    public function set historyIndex(value:int):void
itemLimitproperty 
itemLimit:int  [read-write]

The maximum number of items that are visible at any time.

This property can be used as the source for data binding.

Implementation
    public function get itemLimit():int
    public function set itemLimit(value:int):void
maxDistanceFromCurrentproperty 
maxDistanceFromCurrent:int  [read-write]

We only display items that are within this distance from the current item.

Implementation
    public function get maxDistanceFromCurrent():int
    public function set maxDistanceFromCurrent(value:int):void
showHistoryproperty 
showHistory:Boolean  [read-write]

If true, then all items that have been the 'current item' are made visible.

This property can be used as the source for data binding.

Implementation
    public function get showHistory():Boolean
    public function set showHistory(value:Boolean):void
tidyHistoryproperty 
tidyHistory:Boolean  [read-write]

Keeps all visibleHistoryItems clustered together. If this is set to false, history items tend to form a long chain that makes the autoFit mode tend to shrink the repulsionFactor excessively.

This property can be used as the source for data binding.

Implementation
    public function get tidyHistory():Boolean
    public function set tidyHistory(value:Boolean):void
visibleHistoryItemsproperty 
visibleHistoryItems:Object  [read-only]

A list of all the items that are currently visible only because showHistory is enabled. In other words this list is the entire history minus the items that are currently visible anyway.

This property can be used as the source for data binding.

Implementation
    public function get visibleHistoryItems():Object
visibleNodeCountproperty 
visibleNodeCount:int  [read-only]

The number of items in the dataProvider that are currently visible.

Implementation
    public function get visibleNodeCount():int
Method detail
back()method
public function back():void

Sets the currentItem to the previous history Item. "historyIndex" will be decremented. Has no effect if historyIndex is already 0.

distance()method 
public function distance(fromItem:Item, toItem:Item):int

Calulate the distance between 2 items. Currently this is a fast-but-cheezy calculation that returns 0 (if the 2 items are the same), 1 (if the 2 items are linked), or 99 otherwise.

Parameters
fromItem:Item
 
toItem:Item

Returns
int — the distance between the two items.
forward()method 
public function forward():void

Sets the currentItem to the next history Item. "historyIndex" will be incremented. Has no effect if historyIndex is already the highest possible index in "history".

hasBeenCurrentItem()method 
public function hasBeenCurrentItem(item:Item):Boolean

Find out if a given item has ever been the currentItem.

Parameters
item:Item — an Item that is contained in this graph

Returns
Boolean
hideItem()method 
public function hideItem(item:Item):void

Force the item to not be shown, even if it is inside the limits set by 'maxDistanceFromCurrent'.

Parameters
item:Item
resetHistory()method 
public function resetHistory():void

Forget which items have been the current item. This will affect the history used by 'showHistory' and 'hasBeenCurrentItem'.

resetShowHide()method 
public function resetShowHide():void

Cancels the effect of any prior calls to hideItem and/or showItem.

setDataProvider()method 
public function setDataProvider(dp:XML, currentId:String):void

sets the data provider and chooses the initial currentItem.

Parameters
dp:XML
 
currentId:String
showItem()method 
public function showItem(item:Item):void

Force the item to be shown, even if it is outside the limits set by 'maxDistanceFromCurrent'.

Parameters
item:Item
Event detail
changeevent 
Event object type: flash.events.Event

Dispatched when there is any change to the nodes and/or links of this graph.