Example #1
0
 /**
  * The constructor
  *
  * @param title dialog's title
  */
 public FileDialog(String title) {
   this(
       Toolkit.getScreenWidth() / 4,
       Toolkit.getScreenHeight() / 4,
       Toolkit.getScreenWidth() / 2,
       Toolkit.getScreenHeight() / 2,
       title);
 }
Example #2
0
 @Override
 protected void doRepaint() {
   repaintSelf();
   Toolkit.setClipRectangle(getChildsClippingRectangle());
   for (int i = 0; i < _widgets.size(); i++) {
     Widget widget = (Widget) _widgets.elementAt(i);
     widget.repaint();
   }
   Toolkit.unsetClipRectangle();
 }
Example #3
0
 protected void doPaint() {
   super.doPaint();
   // Begrenzer malen
   Toolkit.printString(getDelimiterString(), getAbsoluteX(), getAbsoluteY(), getDelimiterColors());
   Toolkit.printString(
       getDelimiterString(),
       getAbsoluteX() + getSize().getWidth() - 1,
       getAbsoluteY(),
       getDelimiterColors());
 }
Example #4
0
 public void run() {
   while (true) {
     InputChar c = Toolkit.readCharacter();
     String a = "" + c.getCharacter();
     Tetris.test.turnGamePiece(Tetris.test.GameObjects.get(0), a);
   }
 }
Example #5
0
 @Override
 protected void doPaint() {
   Rectangle rect = (Rectangle) getSize().clone();
   rect.setLocation(getAbsoluteX(), getAbsoluteY());
   String text = "[" + getText() + "]";
   CharColor colors = hasFocus() ? getFocusedPopUpColors() : getColors();
   Toolkit.printString(text, rect, colors);
 }
Example #6
-1
  private static int getWidth(String label, String title) {

    StringTokenizer tokenizer = new StringTokenizer(label, "\n");
    int result = 0;
    while (tokenizer.hasMoreElements()) {
      String token = tokenizer.nextToken();
      if (result < token.length()) {
        result = token.length();
      }
    }
    if (title.length() > result) {
      result = title.length();
    }
    // message nust fit on the schreen

    if (result > jcurses.system.Toolkit.getScreenWidth() - 3) {
      result = jcurses.system.Toolkit.getScreenWidth() - 3;
    }

    return result;
  }