1 /*
2 * File: TimeBarModelListener.java
3 * Copyright (c) 2004-2007 Peter Kliem (Peter.Kliem@jaret.de)
4 * A commercial license is available, see http://www.jaret.de.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 package de.jaret.util.ui.timebars.model;
21
22 import de.jaret.util.date.Interval;
23
24 /**
25 * Interface for listening to changes in the data of a TimeBarModel.
26 *
27 * @author Peter Kliem
28 * @version $Id: TimeBarModelListener.java 800 2008-12-27 22:27:33Z kliem $
29 */
30 public interface TimeBarModelListener {
31 /**
32 * Unspecific or multiple changes occured in the model. Should not be used without the need to signal a huge change
33 * of data.
34 *
35 * @param model the model of which the data changed
36 */
37 void modelDataChanged(TimeBarModel model);
38
39 /**
40 * The model was enlarged by a new row.
41 *
42 * @param model the changed model
43 * @param row the added row
44 */
45 void rowAdded(TimeBarModel model, TimeBarRow row);
46
47 /**
48 * The model was reduced by a row.
49 *
50 * @param model the changed model
51 * @param row the removed row
52 */
53 void rowRemoved(TimeBarModel model, TimeBarRow row);
54
55 /**
56 * Unspecific change in the data of a row.
57 *
58 * @param model the changed model
59 * @param row the row of which the data has changed
60 */
61 void rowDataChanged(TimeBarModel model, TimeBarRow row);
62
63 /**
64 * A new element was added to a row.
65 *
66 * @param model the changed model
67 * @param row the changed row
68 * @param element the added element
69 */
70 void elementAdded(TimeBarModel model, TimeBarRow row, Interval element);
71
72 /**
73 * An element was removed from a row.
74 *
75 * @param model the changed model
76 * @param row the changed row
77 * @param element the removed element
78 */
79 void elementRemoved(TimeBarModel model, TimeBarRow row, Interval element);
80
81 /**
82 * An element in a row has changed.
83 *
84 * @param model the changed model
85 * @param row the changed row
86 * @param element the element that changed
87 */
88 void elementChanged(TimeBarModel model, TimeBarRow row, Interval element);
89
90 /**
91 * The header of a row changed.
92 *
93 * @param model the changed model
94 * @param row the changed row
95 * @param newHeader the changed header
96 */
97 void headerChanged(TimeBarModel model, TimeBarRow row, Object newHeader);
98
99 }