View Javadoc

1   // START LICENSE
2   // JSet - a Java JSet card board game implementation
3   // Copyright (C) 2004 Jerome Lacoste
4   //
5   // This program is free software; you can redistribute it and/or modify
6   // it under the terms of the GNU General Public License as published by
7   // the Free Software Foundation; either version 2 of the License, or (at
8   // your option) any later version.
9   //
10  // This program is distributed in the hope that it will be useful, but
11  // WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // General Public License for more details.
14  //
15  // You should have received a copy of the GNU General Public License
16  // along with this program; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18  // END LICENSE
19  
20  package org.cb.cardboard;
21  
22  import java.util.EventListener;
23  
24  /***
25   * An interface that all CardBoardModel listeners must implement.
26   *
27   * @author jerome@coffeebreaks.org - last modified by $LastChangedBy: jerome $
28   * @version $Id: CardBoardModelListener.java 129 2004-04-15 05:00:43Z jerome $
29   */
30  public interface CardBoardModelListener extends EventListener
31  {
32    /***
33     * Sent after the indices in the index0,index1
34     * interval have been inserted in the data model.
35     * The new interval includes both index0 and index1.
36     *
37     * @param e  a <code>CardBoardEvent</code> encapsulating the
38     *    event information
39     */
40    void intervalAdded(CardBoardEvent e);
41  
42  
43    /***
44     * Sent after the indices in the index0,index1 interval
45     * have been removed from the data model.  The interval
46     * includes both index0 and index1.
47     *
48     * @param e  a <code>CardBoardEvent</code> encapsulating the
49     *    event information
50     */
51    void intervalRemoved(CardBoardEvent e);
52  
53  
54    /***
55     * Sent when the contents of the board has changed in a way
56     * that's too complex to characterize with the previous
57     * methods. For example, this is sent when an item has been
58     * replaced. Index0 and index1 bracket the change.
59     *
60     * @param e  a <code>CardBoardEvent</code> encapsulating the
61     *    event information
62     */
63    void contentsChanged(CardBoardEvent e);
64  
65  }