topical media & game development

talk show tell print

#ax-springgraph-thesaurus-ViewFactory.ax

#ax-springgraph-thesaurus-ViewFactory.ax [swf] flex


  
//////////////////////////////////////////////////////////////////////////

// // 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-ax-springgraph-thesaurus-ViewFactory implements IViewFactory
      {
          public function @ax-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;
          }
          
      }
  }
  


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.