use of org.apache.pivot.wtk.media.Movie in project pivot by apache.
the class MovieView method setMovie.
/**
* Sets the movie view's current movie.
*
* @param movie The movie to set, or <tt>null</tt> for no movie.
*/
public void setMovie(Movie movie) {
Movie previousMovie = this.movie;
if (previousMovie != movie) {
this.movie = movie;
movieViewListeners.movieChanged(this, previousMovie);
}
}
use of org.apache.pivot.wtk.media.Movie in project pivot by apache.
the class MovieViewSkin method getPreferredWidth.
@Override
public int getPreferredWidth(int height) {
MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
return (movie == null) ? 0 : Math.round(movie.getWidth() * scale);
}
use of org.apache.pivot.wtk.media.Movie in project pivot by apache.
the class MovieViewSkin method install.
@Override
public void install(Component component) {
super.install(component);
MovieView movieView = (MovieView) component;
movieView.getMovieViewListeners().add(this);
Movie movie = movieView.getMovie();
if (movie != null) {
movie.getMovieListeners().add(movieListener);
}
}
use of org.apache.pivot.wtk.media.Movie in project pivot by apache.
the class MovieViewSkin method movieChanged.
// MovieViewListener methods
@Override
public void movieChanged(MovieView movieView, Movie previousMovie) {
if (previousMovie != null) {
previousMovie.getMovieListeners().remove(movieListener);
}
Movie movie = movieView.getMovie();
if (movie != null) {
movie.getMovieListeners().add(movieListener);
}
invalidateComponent();
}
use of org.apache.pivot.wtk.media.Movie in project pivot by apache.
the class MovieViewSkin method getPreferredSize.
@Override
public Dimensions getPreferredSize() {
MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
return (movie == null) ? Dimensions.ZERO : new Dimensions(Math.round(movie.getWidth() * scale), Math.round(movie.getHeight() * scale));
}
Aggregations