Package net.sf.gum.xml.v1

Examples of net.sf.gum.xml.v1.ObjectFactory


    {
      return false;
    }
    else
    {
      BaseType baseType = (BaseType) node;
      return (baseType.getItem().size() == 0);
    }
  }
View Full Code Here



  /********************************************************************************/
  public void valueForPathChanged( TreePath treePath, Object string )
  {
    BaseType baseType = (BaseType) treePath.getLastPathComponent();
    baseType.setTitle( (String) string );
  }
View Full Code Here


  /********************************************************************************/
  public void addNode( TreePath treePathToParent, ItemType itemType )
  {
    BaseType baseType = (BaseType) treePathToParent.getLastPathComponent();
    baseType.getItem().add( 0, itemType );

    this.fireModelChanged( treePathToParent );
  }
View Full Code Here


  /********************************************************************************/
  public void removeNode( TreePath pathToNodeForRemoval )
  {
    BaseType selectedNode = (BaseType) pathToNodeForRemoval.getLastPathComponent();
    BaseType parentNode = (BaseType) pathToNodeForRemoval.getParentPath().getLastPathComponent();

    parentNode.getItem().remove( selectedNode );

    this.fireModelChanged( pathToNodeForRemoval.getParentPath() );
  }
View Full Code Here

   * Adds a node to the currently selected node
   *
   *******************************************************************************/
  public void addNode()
  {
    BaseType selectedNode = this.getSelectedNode()

    if( selectedNode != null )
    {
      logger.finer( "adding node to: '" + selectedNode.getTitle() + "'" );

      ItemType newNode = new ItemType();
      newNode.setTitle( "New Item" );
      newNode.setType( TaskType.TASK );

View Full Code Here

  @Override
  public boolean importData( JComponent jComponent, Transferable transferable )
  {
    JTree jTree = (JTree) jComponent;   
    BaseType target = (BaseType) jTree.getSelectionPath().getLastPathComponent();   

    try
    {
      ItemType source = (ItemType) transferable.getTransferData( ITEM_TYPE_DATA_FLAVOR );
      target.getItem().add( source );
     
     
      //System.out.println( "BEFORE---this.parent.getItem().size()= " + this.parent.getItem().size() );
     
      this.parent.getItem().remove( source );     
View Full Code Here

  {
    this.gumData = DataFactory.loadData();
   
    if( this.gumData == null )
    {
      this.gumData = new GumData();

      //TODO do this until the New Project functionality gets added...
      ProjectType p = new ProjectType();
      p.setTitle( "Big Brutus" );
View Full Code Here

    }
    else if( value instanceof ItemType )
    {

      ItemType itemType = (ItemType) value;

      super.setText( itemType.getTitle() );
    }
    else
    {
      //---else, this is first time and there is no data so it is a DefaultMutableTreeNode
    }
View Full Code Here

    {
      return ImageFactory.getImageIcon( ImageNames.ICON_PROJECT );
    }
    else if( this.lastSelectedNode instanceof ItemType )
    {
      ItemType itemType = (ItemType) this.lastSelectedNode;

      if( itemType.getType() == TaskType.EMAIL )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_MAIL );
      }
      else if( itemType.getType() == TaskType.MEETING )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_MEETING );
      }
      else if( itemType.getType() == TaskType.PHONE )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_TELEPHONE );
      }
      else if( itemType.getType() == TaskType.TASK )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_TASK );
      }
      else
      {
        logger.finest( "Need to add icon for TaskType: " + itemType.getType() );
        return super.getLeafIcon();
      }
    }
    else
    {
View Full Code Here

   *
   * @param taskType
   *******************************************************************************/
  public void changeCurrentNodeType( TaskType taskType )
  {
    ItemType itemType= (ItemType) this.getSelectedNode();
    itemType.setType( taskType );
  }
View Full Code Here

TOP

Related Classes of net.sf.gum.xml.v1.ObjectFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.