de.jaret.util.ui.timebars.mod
Class DefaultIntervalModificator

java.lang.Object
  extended by de.jaret.util.ui.timebars.mod.DefaultIntervalModificator
All Implemented Interfaces:
IIntervalModificator, IntervalModificator

public class DefaultIntervalModificator
extends java.lang.Object
implements IIntervalModificator

Default implementation of the IntervalModificator simply allowing everything.

Version:
$Id: DefaultIntervalModificator.java 881 2009-09-22 21:25:47Z kliem $
Author:
Peter Kliem

Constructor Summary
DefaultIntervalModificator()
           
 
Method Summary
 double getSecondGridSnap()
          If this method returns a positive value this is used as the modification interval.
 double getSecondGridSnap(TimeBarRow row, de.jaret.util.date.Interval interval)
          If this method returns a positive value this is used as the modification interval.
 boolean isApplicable(TimeBarRow row, de.jaret.util.date.Interval interval)
          Decides whether the interval modificator is responsible for a given interval in a row.
 boolean isShiftingAllowed(TimeBarRow row, de.jaret.util.date.Interval interval)
          Decide whether a given interval in a row is allowed to be shifted.
 boolean isSizingAllowed(TimeBarRow row, de.jaret.util.date.Interval interval)
          Decide whether a given interval in a row is allowed to be sized.
 boolean newBeginAllowed(TimeBarRow row, de.jaret.util.date.Interval interval, de.jaret.util.date.JaretDate newBegin)
          Decide whether a given interval in a given row can change the begin date.
 boolean newEndAllowed(TimeBarRow row, de.jaret.util.date.Interval interval, de.jaret.util.date.JaretDate newEnd)
          Decide whether a given interval in a given row can change the end date.
 boolean shiftAllowed(TimeBarRow row, de.jaret.util.date.Interval interval, de.jaret.util.date.JaretDate newBegin)
          Decide whether an interval may be shifted in time to a new begin date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIntervalModificator

public DefaultIntervalModificator()
Method Detail

isApplicable

public boolean isApplicable(TimeBarRow row,
                            de.jaret.util.date.Interval interval)
Decides whether the interval modificator is responsible for a given interval in a row.

Specified by:
isApplicable in interface IntervalModificator
Parameters:
row - row of the interval
interval - interval in question
Returns:
true if this modificator should be questioned

isSizingAllowed

public boolean isSizingAllowed(TimeBarRow row,
                               de.jaret.util.date.Interval interval)
Decide whether a given interval in a row is allowed to be sized.

Specified by:
isSizingAllowed in interface IntervalModificator
Parameters:
row - row of the interval
interval - interval in question
Returns:
true if the interval may be sized

newBeginAllowed

public boolean newBeginAllowed(TimeBarRow row,
                               de.jaret.util.date.Interval interval,
                               de.jaret.util.date.JaretDate newBegin)
Decide whether a given interval in a given row can change the begin date.

Specified by:
newBeginAllowed in interface IntervalModificator
Parameters:
row - row of the interval
interval - interval to be modified
newBegin - new begin date
Returns:
true if the modification is allowed

newEndAllowed

public boolean newEndAllowed(TimeBarRow row,
                             de.jaret.util.date.Interval interval,
                             de.jaret.util.date.JaretDate newEnd)
Decide whether a given interval in a given row can change the end date.

Specified by:
newEndAllowed in interface IntervalModificator
Parameters:
row - row of the interval
interval - interval to be modified
newEnd - new end date
Returns:
true if the modification is allowed

isShiftingAllowed

public boolean isShiftingAllowed(TimeBarRow row,
                                 de.jaret.util.date.Interval interval)
Decide whether a given interval in a row is allowed to be shifted.

Specified by:
isShiftingAllowed in interface IntervalModificator
Parameters:
row - row of the interval
interval - interval in question
Returns:
true if the interval may be shifted

shiftAllowed

public boolean shiftAllowed(TimeBarRow row,
                            de.jaret.util.date.Interval interval,
                            de.jaret.util.date.JaretDate newBegin)
Decide whether an interval may be shifted in time to a new begin date.

Specified by:
shiftAllowed in interface IntervalModificator
Parameters:
row - row of the interval
interval - interval to be modified
newBegin - new begin date
Returns:
true if the modification is allowed

getSecondGridSnap

public double getSecondGridSnap()
If this method returns a positive value this is used as the modification interval. The value is given in seconds.

Specified by:
getSecondGridSnap in interface IntervalModificator
Returns:
the positive grid snap or a negative value indicating no grid snap

getSecondGridSnap

public double getSecondGridSnap(TimeBarRow row,
                                de.jaret.util.date.Interval interval)
If this method returns a positive value this is used as the modification interval. The value is given in seconds.

Specified by:
getSecondGridSnap in interface IIntervalModificator
Parameters:
row - row of the interval
interval - interval in question
Returns:
the positive grid snap or a negative value indicating no grid snap


Copyright © 2012. All Rights Reserved.