View Javadoc

1   /*
2   @See License.txt@
3    */
4   
5   package spellcast.ui;
6   
7   import spellcast.beings.IWizard;
8   import spellcast.game.Game;
9   import spellcast.model.Id;
10  import spellcast.questions.Question;
11  
12  /***
13   * This interface provides all the GUI view manipulation methods.
14   * This allows the Client code to be independent of the particulars
15   * of Swing or AWT.  In addition this allows an empty view to be created
16   * for the cases when there is no view connected to the client.  For example
17   * when a bot is created the bot might not have a visible gui.
18   *
19   * @author Barrie Treloar
20   */
21  public interface SpellcastView
22  {
23      /***
24       * Add a message to the view.
25       */
26      public void addMessage( String message );
27  
28      /***
29       * Add a query to the view.
30       */
31      public void addQuery( Question query );
32  
33      /***
34       * Add a wizard to the view.
35       */
36      public void addWizard( IWizard w );
37  
38      /***
39       * Remove a wizard from the view.
40       */
41      public void removeWizard( IWizard w );
42  
43      /***
44       * Indicate that the system has connected to a Spellcast server.
45       * A successful connection will pass true, otherwise false is used.
46       *
47       * @param success indicates whether the connection was success (true),
48       *        or unsuccessful (false)
49       */
50      public void connected( boolean success );
51  
52      /***
53       * Indicate that the system has disconnected from a Spellcast server.
54       */
55      public void disconnected();
56  
57      /***
58       * Set the value of Wizard's id.
59       *
60       * @param v Value to assign to id.
61       */
62      public void setID( Id v );
63  
64      /***
65       * Set the value of the current Game.
66       *
67       * @param v Value to assign to game.
68       */
69      public void setGame( Game v );
70  
71      /***
72       * Sets the ok button to display the desired text with the specified enabled state.
73       */
74      //    public void setOk( String text, boolean enabled );
75  }
76