use of org.apache.pivot.wtk.MovieView 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.MovieView 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.MovieView 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));
}
use of org.apache.pivot.wtk.MovieView in project pivot by apache.
the class MovieViewSkin method paint.
@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);
}
}
use of org.apache.pivot.wtk.MovieView in project pivot by apache.
the class MovieViewSkin method getPreferredHeight.
@Override
public int getPreferredHeight(int width) {
MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
return (movie == null) ? 0 : Math.round(movie.getHeight() * scale);
}
Aggregations