/[svn]/jsampler/trunk/src/org/jsampler/Resource.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/Resource.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2287 by iliev, Thu Feb 14 16:52:36 2008 UTC revision 2288 by iliev, Wed Nov 23 21:19:44 2011 UTC
# Line 24  package org.jsampler; Line 24  package org.jsampler;
24    
25  import java.util.Vector;  import java.util.Vector;
26    
27  import javax.swing.event.ChangeEvent;  import net.sf.juife.event.GenericEvent;
28  import javax.swing.event.ChangeListener;  import net.sf.juife.event.GenericListener;
29    
30    
31  /**  /**
# Line 36  public class Resource { Line 36  public class Resource {
36          private String name = "Untitled";          private String name = "Untitled";
37          private String description = "";          private String description = "";
38                    
39          private final Vector<ChangeListener> listeners = new Vector<ChangeListener>();          private final Vector<GenericListener> listeners = new Vector<GenericListener>();
40                    
41          /**          /**
42           * Creates a new instance of Resource           * Creates a new instance of Resource
# Line 46  public class Resource { Line 46  public class Resource {
46                    
47          /**          /**
48           * Registers the specified listener to be notified when the resource info is changed.           * Registers the specified listener to be notified when the resource info is changed.
49           * @param l The <code>ChangeListener</code> to register.           * @param l The <code>GenericListener</code> to register.
50           */           */
51          public void          public void
52          addChangeListener(ChangeListener l) { listeners.add(l); }          addChangeListener(GenericListener l) { listeners.add(l); }
53                    
54          /**          /**
55           * Removes the specified listener.           * Removes the specified listener.
56           * @param l The <code>ChangeListener</code> to remove.           * @param l The <code>GenericListener</code> to remove.
57           */           */
58          public void          public void
59          removeChangeListener(ChangeListener l) { listeners.remove(l); }          removeChangeListener(GenericListener l) { listeners.remove(l); }
60                    
61          /**          /**
62           * Gets the name of this resource.           * Gets the name of this resource.
# Line 95  public class Resource { Line 95  public class Resource {
95          /** Notifies listeners that the recourse properties has changed. */          /** Notifies listeners that the recourse properties has changed. */
96          protected void          protected void
97          fireChangeEvent() {          fireChangeEvent() {
98                  ChangeEvent e = new ChangeEvent(this);                  GenericEvent e = new GenericEvent(this);
99                  for(ChangeListener l : listeners) l.stateChanged(e);                  for(GenericListener l : listeners) l.jobDone(e);
100          }          }
101  }  }

Legend:
Removed from v.2287  
changed lines
  Added in v.2288

  ViewVC Help
Powered by ViewVC