Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/jempeg/empeg/emplode/model/BasicEmpegPlaylistTreeNode.java


1   /**
2   * Copyright (c) 2001, Mike Schrag & Daniel Zimmerman
3   * All rights reserved.
4   *
5   * Redistribution and use in source and binary forms, with or without
6   * modification, are permitted provided that the following conditions are met:
7   *
8   * Redistributions of source code must retain the above copyright notice,
9   * this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * Neither the name of Mike Schrag, Daniel Zimmerman, nor the names of any
16  * other contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31  package org.jempeg.empeg.emplode.model;
32  
33  import org.jempeg.empeg.emplode.action.ConfirmationListenerIfc;
34  import org.jempeg.empeg.emplode.action.FIDTreeNodeChangeEvent;
35  import org.jempeg.empeg.emplode.action.FIDTreeNodeChangeListenerIfc;
36  import javax.swing.table.TableModel;
37  import javax.swing.tree.DefaultMutableTreeNode;
38  
39  /**
40  * BasicEmpegPlaylistTreeNode is the most simple implementation
41  * of EmpegPlaylistTreeNodeIfc (basically nothing :) ).  This is
42  * used for the root node of the Empeg tree.
43  *
44  * @author Mike Schrag
45  * @version $Revision: 1.6 $
46  */
47  public class BasicEmpegPlaylistTreeNode extends DefaultMutableTreeNode implements EmpegPlaylistTreeNodeIfc {
48    private String myName;
49  
50    /**
51    * Constructs a new BasicEmpegPlaylistTreeNode
52    */
53    public BasicEmpegPlaylistTreeNode(String _name) {
54      myName = _name;
55    }
56  
57    /**
58    * Returns the type of this EmpegTreeNode.
59    *
60    * @returns the type of this EmpegTreeNode
61    */
62    public int getType() {
63      return EmpegTreeNodeIfc.TYPE_ROOT;
64    }
65  
66    /**
67    * Returns the name of this EmpegTreeNode.
68    *
69    * @returns the name of this EmpegTreeNode
70    */
71    public String getTitle() {
72      return myName;
73    }
74  
75    /**
76    * Attempt to add the given child node.
77    *
78    * @param _changeListener the change listener to use
79    * @param _confirmationListener the confirmaton listener to use
80    * @param _childNode the child node to add
81    */
82    public void add(FIDTreeNodeChangeListenerIfc _changeListener, ConfirmationListenerIfc _confirmationListener, EmpegTreeNodeIfc _childNode) {
83    }
84  
85    /**
86    * Attempt to delete the given child node.
87    *
88    * @param _changeListener the change listener to use
89    * @param _confirmationListener the confirmaton listener to use
90    * @param _childNode the child node to delete
91    */
92    public void delete(FIDTreeNodeChangeListenerIfc _changeListener, ConfirmationListenerIfc _confirmationListener, EmpegTreeNodeIfc _childNode) {
93    }
94  
95    /**
96    * Attempt to move the given child node into this node.
97    *
98    * @param _changeListener the change listener to use
99    * @param _confirmationListener the confirmaton listener to use
100   * @param _childNode the child node to move into this playlist
101   */
102   public void move(FIDTreeNodeChangeListenerIfc _changeListener, ConfirmationListenerIfc _confirmationListener, EmpegTreeNodeIfc _childNode) {
103   }
104 
105   /**
106   * Creates a TableModel out of the children of
107   * this tree node.
108   *
109   * @returns a TableModel containing the children of this node.
110   */
111   public EmpegTableModelIfc createTableModel() {
112     EmpegPlaylistTableModel tableModel = new EmpegPlaylistTableModel(this);
113     return tableModel;
114   }
115 
116   /**
117   * Called when a set of FIDTreeNodes is added.
118   *
119   * @param _event the change event
120   */
121   public void fidTreeNodesAdded(FIDTreeNodeChangeEvent _event) {
122   }
123 
124   /**
125   * Called when a set of FIDTreeNodes is modified.
126   *
127   * @param _event the change event
128   */
129   public void fidTreeNodesModified(FIDTreeNodeChangeEvent _event) {
130   }
131 
132   /**
133   * Called when a set of FIDTreeNodes is removed.
134   *
135   * @param _event the change event
136   */
137   public void fidTreeNodesRemoved(FIDTreeNodeChangeEvent _event) {
138   }
139 
140   public String toString() {
141     return myName;
142   }
143 }