All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bibliothek.gui.dock.extension.css.transition.TransitionalCssProperty Maven / Gradle / Ivy

The newest version!
/*
 * Bibliothek - DockingFrames
 * Library built on Java/Swing, allows the user to "drag and drop"
 * panels containing any Swing-Component the developer likes to add.
 * 
 * Copyright (C) 2012 Benjamin Sigg
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Benjamin Sigg
 * [email protected]
 * CH - Switzerland
 */
package bibliothek.gui.dock.extension.css.transition;

import bibliothek.gui.dock.extension.css.CssProperty;
import bibliothek.gui.dock.extension.css.CssPropertyContainer;
import bibliothek.gui.dock.extension.css.CssRule;

/**
 * Represents one {@link CssProperty} whose value is animated.
* Things get interesting if T is a {@link CssPropertyContainer}: *
    *
  • To fully support the sub-properties of T, the clients needs to access the property with * a {@link CssContainerTransitionProperty}.
  • *
  • Values that are calculated should not show up as {@link CssProperty}, otherwise they will be overridden * by the values defined in the current, leading {@link CssRule} (negating the effects of the transition).
  • *
* @author Benjamin Sigg * @param the type of value handled by this property */ public interface TransitionalCssProperty { /** * Sets a callback, any change of the value has to be reported to callback. * @param callback the callback */ public void setCallback( TransitionalCssPropertyCallback callback ); /** * Informs this property about the source value, the value that is used before the transition starts. * @param source the source value, may be null */ public void setSource( T source ); /** * Informs this property about the target value, the value that is used after the transition stopped. * @param target the target value, can be null */ public void setTarget( T target ); /** * Informs this property of the current progress of the transition from source to target {@link CssRule}. * @param transition the progress, a value between 0 and 1 */ public void setTransition( double transition ); /** * Tells this property to check its value, and maybe call {@link TransitionalCssPropertyCallback#set(Object)} * if the value changed. * @param delay the delay since the last call to this method or -1 if the call is either out of * order or the call was not scheduled */ public void step( int delay ); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy