⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guiutil.java

📁 ErGo是一个很早的Java通用围棋服务器(IGS/NNGS)客户端程序。有全部源码和文档
💻 JAVA
字号:
package ergo.ui;

// $Id: GUIUtil.java,v 1.2 1999/08/13 01:20:08 sigue Exp $

/*
 *  Copyright (C) 1999  Carl L. Gay and Antranig M. Basman.
 *  See the file copyright.txt, distributed with this software,
 *  for further information.
 */

import java.awt.*;
import java.awt.event.*;
import java.util.Vector;

// This is GUIUtil v1.1, Antranig Basman  amb26@eng.cam.ac.uk

/* unused
abstract class urButtonListener implements ActionListener {
  public Button addButton (String label) {
    Button togo = new Button(label);
    togo.addActionListener(this);
    return togo;
  }
}
*/

/* unused
abstract class urItemListener implements ItemListener {
  public Checkbox addCheckbox (String label) {
    Checkbox togo = new Checkbox(label);
    togo.addItemListener(this);
    return togo;
  }
}
*/






/* unused
class InfoDialog extends Dialog implements ActionListener {
  InfoDialog (Frame f, String s) {
    super(f, "Error");
    Rectangle rect = f.getBounds();
    Point center = new Point(rect.x + rect.width/2, rect.y + rect.height/2);
    setLayout(new BorderLayout());
    add("Center", new Label(s));
    Panel p = new Panel();
    Button b = new Button("OK");
    b.addActionListener(this);
    p.add(b);
    add("South", p);
    pack();
    Dimension size = getSize();
    setLocation(center.x - size.width/2, center.y - size.height/2);
    show();
  }
  public void actionPerformed (ActionEvent ae) {
    dispose();
  }
}
*/

// A wrapper for GridBarfLayout
/* unused
class GBLWrap {
  GridBagLayout gbl;
  GridBagConstraints gbc = new GridBagConstraints();
  Container target;
  GBLWrap (Container target) {
    this.target = target;
    target.setLayout(gbl = new GridBagLayout());
    gbc.weightx = gbc.weighty = 1;
  }
  GBLWrap apply (Component toadd, String align) {
    gbc.anchor = GridBagConstraints.CENTER;
    if (align.equals("l")) {
      gbc.anchor = GridBagConstraints.WEST;
    }
    else if (align.equals("c")) {
      gbc.anchor = GridBagConstraints.CENTER;
    }
    else if (align.equals("r")) {
      gbc.anchor = GridBagConstraints.EAST;
    }
    gbl.setConstraints(toadd, gbc);
    target.add(toadd);
    reset();
    return this;
  }
  GBLWrap endrow () {
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    return this;
  }
  GBLWrap endcol () {
    gbc.gridheight = GridBagConstraints.REMAINDER;
    return this;
  }
  GBLWrap reset () {
    gbc.gridwidth = gbc.gridheight = 1;
    return this;
  }
}
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -