Search in sources :

Example 1 with Movie

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);
    }
}
Also used : Movie(org.apache.pivot.wtk.media.Movie)

Example 2 with Movie

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);
}
Also used : Movie(org.apache.pivot.wtk.media.Movie) MovieView(org.apache.pivot.wtk.MovieView)

Example 3 with Movie

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);
    }
}
Also used : Movie(org.apache.pivot.wtk.media.Movie) MovieView(org.apache.pivot.wtk.MovieView)

Example 4 with Movie

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();
}
Also used : Movie(org.apache.pivot.wtk.media.Movie)

Example 5 with Movie

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));
}
Also used : Movie(org.apache.pivot.wtk.media.Movie) Dimensions(org.apache.pivot.wtk.Dimensions) MovieView(org.apache.pivot.wtk.MovieView)

Aggregations

Movie (org.apache.pivot.wtk.media.Movie)8 MovieView (org.apache.pivot.wtk.MovieView)6 Dimensions (org.apache.pivot.wtk.Dimensions)1