Package org.apache.pivot.wtk.media

Examples of org.apache.pivot.wtk.media.Movie$MovieListenerList


     *
     * @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);
        }
View Full Code Here


        super.install(component);

        MovieView movieView = (MovieView)component;
        movieView.getMovieViewListeners().add(this);

        Movie movie = movieView.getMovie();
        if (movie != null) {
            movie.getMovieListeners().add(movieListener);
        }
    }
View Full Code Here

    }

    @Override
    public int getPreferredWidth(int height) {
        MovieView movieView = (MovieView)getComponent();
        Movie movie = movieView.getMovie();

        return (movie == null) ? 0 : Math.round(movie.getWidth() * scale);
    }
View Full Code Here

    }

    @Override
    public int getPreferredHeight(int width) {
        MovieView movieView = (MovieView)getComponent();
        Movie movie = movieView.getMovie();

        return (movie == null) ? 0 : Math.round(movie.getHeight() * scale);
    }
View Full Code Here

    }

    @Override
    public Dimensions getPreferredSize() {
        MovieView movieView = (MovieView)getComponent();
        Movie movie = movieView.getMovie();

        return (movie == null) ? new Dimensions(0, 0) :
            new Dimensions(Math.round(movie.getWidth() * scale),
            Math.round(movie.getHeight() * scale));
    }
View Full Code Here

    }

    @Override
    public void layout() {
        MovieView movieView = (MovieView)getComponent();
        Movie movie = movieView.getMovie();

        if (movie != null) {
            int width = getWidth();
            int height = getHeight();

            int movieWidth = movie.getWidth();
            int movieHeight = movie.getHeight();

            switch (horizontalAlignment) {
            case CENTER:
                movieX = (width - movieWidth) / 2;
                break;
View Full Code Here

    }

    @Override
    public void paint(Graphics2D graphics) {
        MovieView movieView = (MovieView)getComponent();
        Movie movie = movieView.getMovie();

        int width = getWidth();
        int height = getHeight();

        if (backgroundColor != null) {
            graphics.setPaint(backgroundColor);
            graphics.fillRect(0, 0, width, height);
        }

        if (movie != null) {
            if (scale != 1) {
                graphics.scale(scale, scale);
            }

            graphics.translate(movieX, movieY);
            movie.paint(graphics);
        }
    }
View Full Code Here

    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();
    }
View Full Code Here

     *
     * @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);
        }
View Full Code Here

     *
     * @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);
        }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.media.Movie$MovieListenerList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.