1 /*
2 * File: DefaultIntervalModificator.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.mod;
21
22 import de.jaret.util.date.Interval;
23 import de.jaret.util.date.JaretDate;
24 import de.jaret.util.ui.timebars.model.TimeBarRow;
25
26 /**
27 * Default implementation of the IntervalModificator simply allowing everything.
28 *
29 * @author Peter Kliem
30 * @version $Id: DefaultIntervalModificator.java 881 2009-09-22 21:25:47Z kliem $
31 */
32 public class DefaultIntervalModificator implements IIntervalModificator {
33
34 /**
35 * {@inheritDoc}
36 */
37 public boolean isApplicable(TimeBarRow row, Interval interval) {
38 return true;
39 }
40
41 /**
42 * {@inheritDoc}
43 */
44 public boolean isSizingAllowed(TimeBarRow row, Interval interval) {
45 return true;
46 }
47
48 /**
49 * {@inheritDoc}
50 */
51 public boolean newBeginAllowed(TimeBarRow row, Interval interval, JaretDate newBegin) {
52 return true;
53 }
54
55 /**
56 * {@inheritDoc}
57 */
58 public boolean newEndAllowed(TimeBarRow row, Interval interval, JaretDate newEnd) {
59 return true;
60 }
61
62 /**
63 * {@inheritDoc}
64 */
65 public boolean isShiftingAllowed(TimeBarRow row, Interval interval) {
66 return true;
67 }
68
69 /**
70 * {@inheritDoc}
71 */
72 public boolean shiftAllowed(TimeBarRow row, Interval interval, JaretDate newBegin) {
73 return true;
74 }
75
76 /**
77 * {@inheritDoc}
78 */
79 public double getSecondGridSnap() {
80 return -1;
81 }
82
83 /**
84 * {@inheritDoc}
85 */
86 public double getSecondGridSnap(TimeBarRow row, Interval interval) {
87 return -1;
88 }
89
90 }