topical media & game development

talk show tell print

springgraph-thesaurus-ViewFactory.ax

springgraph-thesaurus-ViewFactory.ax (swf ) [ flash ] 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.Ispringgraph-thesaurus-ViewFactory; 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 springgraph-thesaurus-ViewFactory implements Ispringgraph-thesaurus-ViewFactory
      {
          public function springgraph-thesaurus-ViewFactory() {
              
          }
          
          public function getView(item:Item):UIComponent
          {
              if(item is Meaning)
                  return new MeaningView();
              else if(item is Word)
                  return new WordView();
  
              return null;
          }
          
      }
  }
  


(C) Æliens 20/2/2008

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.