/** * @return <code>true</code> if this controllers {@link #getRepeatType() repeat type} is * {@link ComplexSpatialController.RepeatType#CLAMP clamp} and its currently clamped at the maximum index. */ public boolean isClamped() { return isRepeatTypeClamp() && getIndex() == getMaximumIndex(); }
/** * @return <code>true</code> if this controllers {@link #getRepeatType() repeat type} is * {@link ComplexSpatialController.RepeatType#CLAMP clamp} and its currently clamped at the maximum index. */ public boolean isClamped() { return isRepeatTypeClamp() && getIndex() == getMaximumIndex(); }
/** * This method assumes the {@link #getIndex() index} has already been {@link #clampIndex() clamped} correctly. * * @return The control to interpolate from, will not be <code>null</code>. * @see #getControlTo() */ protected C getControlFrom() { C from = null; switch (getRepeatType()) { case CLAMP: if (getIndex() > getMaximumIndex()) { from = getControls().get(getMaximumIndex()); } else { from = getControls().get(getIndex()); } break; case CYCLE: from = getControls().get(getIndex()); break; case WRAP: from = getControls().get(getIndex()); break; } return from; }
/** * This method assumes the {@link #getIndex() index} has already been {@link #clampIndex() clamped} correctly. * * @return The control to interpolate from, will not be <code>null</code>. * @see #getControlTo() */ protected C getControlFrom() { C from = null; switch (getRepeatType()) { case CLAMP: if (getIndex() > getMaximumIndex()) { from = getControls().get(getMaximumIndex()); } else { from = getControls().get(getIndex()); } break; case CYCLE: from = getControls().get(getIndex()); break; case WRAP: from = getControls().get(getIndex()); break; } return from; }
/** * This method assumes the {@link #getIndex() index} has already been {@link #clampIndex() clamped} correctly. * * @return The control to interpolate to, will not be <code>null</code>. * @see #getControlFrom() */ protected C getControlTo() { C to = null; switch (getRepeatType()) { case CLAMP: if (getIndex() >= getMaximumIndex()) { to = getControls().get(getMaximumIndex()); } else { to = getControls().get(getIndex() + 1); } break; case CYCLE: if (isCycleForward()) { to = getControls().get(getIndex() + 1); } else { to = getControls().get(getIndex() - 1); } break; case WRAP: to = getControls().get(getIndex() + 1); break; } return to; }
/** * This method assumes the {@link #getIndex() index} has already been {@link #clampIndex() clamped} correctly. * * @return The control to interpolate to, will not be <code>null</code>. * @see #getControlFrom() */ protected C getControlTo() { C to = null; switch (getRepeatType()) { case CLAMP: if (getIndex() >= getMaximumIndex()) { to = getControls().get(getMaximumIndex()); } else { to = getControls().get(getIndex() + 1); } break; case CYCLE: if (isCycleForward()) { to = getControls().get(getIndex() + 1); } else { to = getControls().get(getIndex() - 1); } break; case WRAP: to = getControls().get(getIndex() + 1); break; } return to; }
switch (getRepeatType()) { case CLAMP: if (getIndex() >= getMaximumIndex()) { setIndex(getMaximumIndex()); setDelta(DELTA_MAX); if (getIndex() >= getMaximumIndex()) { setIndex(getMaximumIndex()); setCycleForward(false); if (getIndex() >= getMaximumIndex()) { setIndex(getMinimumIndex());
switch (getRepeatType()) { case CLAMP: if (getIndex() >= getMaximumIndex()) { setIndex(getMaximumIndex()); setDelta(DELTA_MAX); if (getIndex() >= getMaximumIndex()) { setIndex(getMaximumIndex()); setCycleForward(false); if (getIndex() >= getMaximumIndex()) { setIndex(getMinimumIndex());