use of org.apache.pivot.wtk.MovieView in project pivot by apache.
the class MovieViewSkin method layout.
@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;
case RIGHT:
movieX = width - movieWidth;
break;
default:
movieX = 0;
break;
}
switch(verticalAlignment) {
case CENTER:
movieY = (height - movieHeight) / 2;
break;
case BOTTOM:
movieY = height - movieHeight;
break;
default:
movieY = 0;
break;
}
}
}
Aggregations