示例#1
0
  /** Initialize this example. */
  private Widget initialize() {

    // Create a new panel
    absolutePanel = new AbsolutePanel();

    // Add a widget that we will animate
    animateeTop = new Image("gwtLogoThumb.png");
    animateeBottom = new Image("gwtLogoThumb.png");
    animateeLeft = new Image("gwtLogoThumb.png");
    animateeRight = new Image("gwtLogoThumb.png");
    absolutePanel.add(animateeTop);
    absolutePanel.add(animateeBottom);
    absolutePanel.add(animateeLeft);
    absolutePanel.add(animateeRight);

    // Wrap the absolute panel in a DecoratorPanel
    VerticalPanel absolutePanelWrapper = new VerticalPanel();
    absolutePanelWrapper.add(absolutePanel);

    // Add the components to a panel and return it
    absolutePanelWrapper.add(createOptionsBar());

    // Create the custom animation
    animation = new CustomAnimation(70);

    // Set the start position of the widgets
    animation.onComplete();

    absolutePanel.setSize((animation.centerX * 2 + 10) + "px", (animation.centerY * 2 + 10) + "px");

    // Return the layout
    return absolutePanelWrapper;
  }