1 /*
2 * File: ITimeBarChangeListener.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 import de.jaret.util.date.JaretDate;
24 import de.jaret.util.ui.timebars.TimeBarMarker;
25
26 /**
27 * Listener interface for listeners that will be notified on changes a user makes interactively using the timebar
28 * viewer. If the change is done by keyboard shortcuts those will reported as a series of events (each keystroke).
29 *
30 * @author kliem
31 * @version $Id: ITimeBarChangeListener.java 825 2009-02-04 21:51:08Z kliem $
32 */
33 public interface ITimeBarChangeListener {
34 /**
35 * Indicates that an interval is about to be changed interactively by the user.
36 *
37 * @param row row of the interval about to be changed
38 * @param interval interval that is about to be changed
39 */
40 void intervalChangeStarted(TimeBarRow row, Interval interval);
41
42 /**
43 * Indicates an intermediate state while he user drags interval edegs or the interval.
44 *
45 * @param row row of the interval that is changed
46 * @param interval interval that is changed
47 * @param oldBegin begin date before the change
48 * @param oldEnd end date before the change
49 */
50 void intervalIntermediateChange(TimeBarRow row, Interval interval, JaretDate oldBegin, JaretDate oldEnd);
51
52 /**
53 * Indicates the final state after an interactive change performed by the user.
54 *
55 * @param row row of the interval that has been changed
56 * @param interval interval that has been changed
57 * @param oldBegin begin date before the change
58 * @param oldEnd end date before the change
59 */
60 void intervalChanged(TimeBarRow row, Interval interval, JaretDate oldBegin, JaretDate oldEnd);
61
62 /**
63 * Indicates that the user cancelled the change (most probably by pressing the ESC key).
64 *
65 * @param row row of the interval whose change has been cancelled
66 * @param interval interval whose change has been cancelled
67 */
68 void intervalChangeCancelled(TimeBarRow row, Interval interval);
69
70 /**
71 * Indicates that a marker drag started.
72 *
73 * @param marker marker that is beeing dragged
74 */
75 void markerDragStarted(TimeBarMarker marker);
76
77 /**
78 * Indicates that a marker drag stopped.
79 *
80 * @param marker marker
81 */
82 void markerDragStopped(TimeBarMarker marker);
83 }