/** * 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); }
@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(); }
protected void doPaint() { super.doPaint(); // Begrenzer malen Toolkit.printString(getDelimiterString(), getAbsoluteX(), getAbsoluteY(), getDelimiterColors()); Toolkit.printString( getDelimiterString(), getAbsoluteX() + getSize().getWidth() - 1, getAbsoluteY(), getDelimiterColors()); }
public void run() { while (true) { InputChar c = Toolkit.readCharacter(); String a = "" + c.getCharacter(); Tetris.test.turnGamePiece(Tetris.test.GameObjects.get(0), a); } }
@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); }
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; }