
net.vectorpublish.desktop.vp.api.ui.KeyframeSlider Maven / Gradle / Ivy
/*
* Copyright (c) 2016, Peter Rader. All rights reserved.
* ___ ___ __ ______ __ __ __ __
* | | |.-----..----.| |_ .-----..----.| __ \.--.--.| |--.| ||__|.-----.| |--.
* | | || -__|| __|| _|| _ || _|| __/| | || _ || || ||__ --|| |
* \_____/ |_____||____||____||_____||__| |___| |_____||_____||__||__||_____||__|__|
*
* http://www.gnu.org/licenses/gpl-3.0.html
*/
package net.vectorpublish.desktop.vp.api.ui;
import net.vectorpublish.desktop.vp.api.Moment;
import net.vectorpublish.desktop.vp.api.ui.kf.Keyframe;
import net.vectorpublish.desktop.vp.api.ui.kf.listener.KeyframeSliderListener;
import net.vectorpublish.desktop.vp.api.vpd.DocumentNode;
/**
* The Keyframe slider.
*
*
* The keyframes are stored in the {@link DocumentNode document}.
*/
public interface KeyframeSlider {
/**
* Returns the keyframe at the current time if there is one.
*
* @return the {@link Keyframe} or null
if there is no
* Keyframe.
*/
Keyframe getCurrentKeyframe();
/**
* Returns the {@link DocumentNode document} the slider handles.
*
* @return The {@link DocumentNode document}.
*/
DocumentNode getDocument();
/**
* Returns the time of the latest {@link Keyframe} if exists.
*
* @return The time of the latest {@link Keyframe} or null
if
* not a single {@link Keyframe} exists.
*/
Moment getMaximumTime();
/**
* Returns the time of the earlyest {@link Keyframe} if exists.
*
* @return The time of the earlyest {@link Keyframe} or null
if
* not a single {@link Keyframe} exists.
*/
Moment getMinimumTime();
/**
* Returns the current time, the time the user choose on the
* {@link UserInterface}. If there is no {@link Keyframe} the slider is
* disabled and {@link Moment#NULL_MOMENT} is returned.
*
* @return The time the slider is on or {@link Moment#NULL_MOMENT} if the
* slider is disabled, never null
.
*/
Moment getTime();
/**
* Notifies the slider about changed keyframes in the {@link DocumentNode}.
*/
void notifyIncommingKeyframes();
/**
* Set the slider to a specific time.
*
* If the slider already has the {@link Moment time}, do nothing. If the
* {@link Moment time} is set to the new {@link Moment time}, notify the
* {@link KeyframeSliderListener listeners} too.
*
* @param time
* The position the slider has to be on.
* @throws ArrayIndexOutOfBoundsException
* If the slider is out of Keyframe range. To reset the range,
* insert a new Keyframe at the specific position.
*/
void setTime(Moment time) throws ArrayIndexOutOfBoundsException;
}