Exemple #1
0
  /**
   * Constructor.
   *
   * @param main reference to the main window
   */
  GUIStatus(final AGUI main) {
    super(main);
    BaseXLayout.setHeight(this, getFont().getSize() + 6);
    addMouseListener(this);
    addMouseMotionListener(this);

    layout(new BorderLayout(4, 0));
    label = new BaseXLabel(OK).border(0, 4, 0, 0);
    add(label, BorderLayout.CENTER);
    add(new BaseXMem(main, true), BorderLayout.EAST);
  }
Exemple #2
0
 /**
  * Adds a text field.
  *
  * @param pos position
  */
 private void addInput(final int pos) {
   final BaseXTextField txt = new BaseXTextField(gui);
   BaseXLayout.setWidth(txt, COMPW);
   BaseXLayout.setHeight(txt, txt.getFont().getSize() + 11);
   txt.setMargin(new Insets(0, 0, 0, 10));
   txt.addKeyListener(
       new KeyAdapter() {
         @Override
         public void keyReleased(final KeyEvent e) {
           query(false);
         }
       });
   txt.addKeyListener(main);
   panel.add(txt, pos);
 }
Exemple #3
0
  /**
   * Constructor.
   *
   * @param win parent reference
   * @param mouse mouse interaction
   */
  public BaseXMem(final Window win, final boolean mouse) {
    super(win);
    BaseXLayout.setWidth(this, DWIDTH);
    BaseXLayout.setHeight(this, getFont().getSize() + 6);
    if (mouse) {
      setCursor(CURSORHAND);
      addMouseListener(this);
      addMouseMotionListener(this);
    }

    final Thread t =
        new Thread() {
          @Override
          public void run() {
            repaint();
            Performance.sleep(500);
          }
        };
    t.setDaemon(true);
    t.start();
  }
  /**
   * Activates the specified radio button.
   *
   * @param src button reference
   */
  void change(final Object src) {
    int n = 0;
    for (int r = 0; r < radio.length; ++r) if (src == radio[r]) n = r;
    BaseXLayout.setHeight(input2, n == Data.ATTR ? 25 : 200);

    back.removeAll();
    back.layout(new BorderLayout(0, 4));
    if (n != Data.TEXT && n != Data.COMM) {
      final BaseXBack b = new BaseXBack(new BorderLayout(0, 4));
      b.add(label1, BorderLayout.NORTH);
      b.add(input1, BorderLayout.CENTER);
      back.add(b, BorderLayout.NORTH);
    }
    if (n != Data.ELEM) {
      final BaseXBack b = new BaseXBack(new BorderLayout(0, 4));
      b.add(label2, BorderLayout.NORTH);
      b.add(input2, BorderLayout.CENTER);
      back.add(b, BorderLayout.CENTER);
    }
    pack();
  }