Esempio n. 1
0
  protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
    Screen screen = (Screen) getScreen();

    x = (x >= 0) ? x : this.x;
    y = (x >= 0) ? y : this.y;
    width = (width > 0) ? width : this.width;
    height = (height > 0) ? height : this.height;

    if (width > screen.getWidth()) {
      width = screen.getWidth();
    }
    if (height > screen.getHeight()) {
      height = screen.getHeight();
    }
    if ((x + width) > screen.getWidth()) {
      x = screen.getWidth() - width;
    }
    if ((y + height) > screen.getHeight()) {
      y = screen.getHeight() - height;
    }

    if (0 != surfaceHandle) {
      SetBounds0(
          surfaceHandle, getScreen().getWidth(), getScreen().getHeight(), x, y, width, height);
    }

    if (0 != (FLAG_CHANGE_VISIBILITY & flags)) {
      if (0 != (FLAG_IS_VISIBLE & flags)) {
        ((Display) getScreen().getDisplay()).setFocus(this);
      }
      visibleChanged(false, 0 != (FLAG_IS_VISIBLE & flags));
    }

    return true;
  }
Esempio n. 2
0
 public void reset() {
   if (this.pos.x < scr.getWidth() / 2 - 10) {
     this.pos.x = scr.p1.pos.x;
     this.pos.y = scr.getHeight() - scr.p1.size - this.size;
   }
   if (this.pos.x < scr.getWidth() / 2 + 10) {
     this.pos.x = scr.p2.pos.x;
     this.pos.y = scr.getHeight() - scr.p2.size - this.size;
   }
   this.v.y = 0;
   this.v.x = 0;
 }
Esempio n. 3
0
 public ScreenCharSequence(Screen s) {
   screen = s;
   width = screen.getWidth();
   height = screen.getHeight();
   text = renderer.render(s);
 }