//////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors. // All Rights Reserved. The following is Source Code and is subject to all // restrictions on such code as contained in the End User License Agreement // accompanying this product. // //////////////////////////////////////////////////////////////////////////////// package { import mx.core.UIComponent; import com.adobe.flex.extras.controls.springgraph.IViewFactory; import com.adobe.flex.extras.controls.springgraph.Item; /** The object that knows how to create views that correspond to a given Item. * We recognize these types: * - for Items of type Word, we create a WordView * - for Items of type Meaning, we create a MeaningView */ public class ax_springgraph_thesaurus_ViewFactory implements IViewFactory { public function ax_springgraph_thesaurus_ViewFactory() { } public function getView(item:Item):UIComponent { if(item is ax_springgraph_thesaurus_Meaning) return new springgraph_thesaurus_MeaningView(); else if(item is ax_springgraph_thesaurus_Word) return new springgraph_thesaurus_WordView(); return null; } } }