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

Quick Search    Search Deep

Source code: org/embl/ebi/escience/scuflui/ScuflUIComponent.java


1   /**
2    * This file is a component of the Taverna project,
3    * and is licensed under the GNU LGPL.
4    * Copyright Tom Oinn, EMBL-EBI
5    */
6   package org.embl.ebi.escience.scuflui;
7   
8   import org.embl.ebi.escience.scufl.ScuflModel;
9   
10  import java.lang.String;
11  
12  
13  
14  /**
15   * The interface implemented by all Scufl UI widgets 
16   * specifying how they bind and detach from an instance
17   * of a ScuflModel. Any class implementing this interface
18   * must be a subclass of JComponent; unfortunately there's
19   * no way that I know of to enforce this constraint in the
20   * language, but if you don't stick to it your components
21   * won't work.
22   * @author Tom Oinn
23   */
24  public interface ScuflUIComponent {
25  
26      /**
27       * Directs the implementing component to bind to the
28       * specified ScuflModel instance, refresh its internal
29       * state from the model and commence listening to events,
30       * maintaining its state as these events dictate.
31       */
32      public void attachToModel(ScuflModel model);
33      
34      /**
35       * Directs the implementing component to detach from the 
36       * model, set its internal state to some suitable blank
37       * (i.e. blank image, no text in a text field etc) and 
38       * desist from listening to model events.
39       */
40      public void detachFromModel();
41  
42      /**
43       * Get the preferred name of this component, for titles
44       * in windows etc.
45       */
46      public String getName();
47  
48  }