1 30 31 package com.jgoodies.animation; 32 33 42 43 public abstract class AbstractAnimationFunction 44 implements AnimationFunction { 45 46 49 private final long duration; 50 51 52 54 61 protected AbstractAnimationFunction(long duration) { 62 if (duration < 0) 63 throw new IllegalArgumentException ("The duration must not be negative."); 64 65 this.duration = duration; 66 } 67 68 69 71 80 protected void checkTimeRange(long time) { 81 if ((time < 0) || (time >= duration())) 82 throw new IllegalArgumentException ( 83 "The time must be larger than 0 and smaller than " 84 + duration() 85 + "."); 86 } 87 88 89 94 public final long duration() { 95 return duration; 96 } 97 98 } | Popular Tags |