예제 #1
0
파일: TableInput.java 프로젝트: johoe/basex
 @Override
 public void run() {
   while (text != null) {
     flashing ^= true;
     panel.repaint();
     Performance.sleep(500);
   }
   flashing = false;
   panel.repaint();
 }
예제 #2
0
 @Override
 public final void setEnabled(final boolean enabled) {
   super.setEnabled(enabled);
   rend.setEnabled(enabled);
   scroll.setEnabled(enabled);
   caret(enabled);
 }
예제 #3
0
 @Override
 public final void setEnabled(final boolean e) {
   super.setEnabled(e);
   rend.setEnabled(e);
   scroll.setEnabled(e);
   cursor(e);
 }
예제 #4
0
 @Override
 public final void setFont(final Font f) {
   super.setFont(f);
   if (rend != null) {
     rend.setFont(f);
     scrollCode.invokeLater(true);
   }
 }
예제 #5
0
 @Override
 public final void setFont(final Font f) {
   super.setFont(f);
   if (rend != null) {
     rend.setFont(f);
     rend.repaint();
   }
 }
예제 #6
0
  @Override
  public void paintComponent(final Graphics g) {
    super.paintComponent(g);
    final Data data = gui.context.data();
    if (!main.visible() || data == null) return;

    final boolean pi = data.meta.pathindex;
    if (!pi || panel.getComponentCount() != 0) {
      if (!pi) init();
      return;
    }
    if (!pi) return;

    all.help(HELPSEARCHXML);
    addKeys(gui.context.data());
    panel.revalidate();
    panel.repaint();
  }
예제 #7
0
  @Override
  public void paintComponent(final Graphics g) {
    super.paintComponent(g);

    final int w = getWidth();
    final int h = getHeight();
    final int hh = h / 2;
    final int s = (int) (3 * GUIConstants.SCALE);

    g.setColor(hasFocus() ? GUIConstants.BACK : GUIConstants.lgray);
    g.fillRect(0, hh - s, w, s * 2 - 1);
    g.setColor(GUIConstants.TEXT);
    g.drawLine(0, hh - s, w, hh - s);
    g.drawLine(0, hh - s, 0, hh + s - 1);
    g.setColor(GUIConstants.gray);
    g.drawLine(w - 1, hh - s, w - 1, hh + s - 1);
    g.drawLine(0, hh + s - 1, w, hh + s - 1);

    final double x = (value - min) * (w - SLIDERW) / (max - min);
    BaseXLayout.drawCell(g, (int) x, (int) (x + SLIDERW), hh - s * 2, hh + s * 2, oldValue != -1);
  }
예제 #8
0
  @Override
  public void paintComponent(final Graphics g) {
    super.paintComponent(g);

    final Runtime rt = Runtime.getRuntime();
    final long max = rt.maxMemory();
    final long total = rt.totalMemory();
    final long used = total - rt.freeMemory();
    final int ww = getWidth();
    final int hh = getHeight();

    // draw memory box
    g.setColor(Color.white);
    g.fillRect(0, 0, ww - 3, hh - 3);
    g.setColor(GRAY);
    g.drawLine(0, 0, ww - 4, 0);
    g.drawLine(0, 0, 0, hh - 4);
    g.drawLine(ww - 3, 0, ww - 3, hh - 3);
    g.drawLine(0, hh - 3, ww - 3, hh - 3);

    // show total memory usage
    g.setColor(color1);
    g.fillRect(2, 2, Math.max(1, (int) (total * (ww - 6) / max)), hh - 6);

    // show current memory usage
    final boolean full = used * 6 / 5 > max;
    g.setColor(full ? colormark4 : color3);
    g.fillRect(2, 2, Math.max(1, (int) (used * (ww - 6) / max)), hh - 6);

    // print current memory usage
    final FontMetrics fm = g.getFontMetrics();
    final String mem = Performance.format(used, true);
    final int fw = (ww - fm.stringWidth(mem)) / 2;
    final int h = fm.getHeight() - 3;
    g.setColor(full ? colormark3 : DGRAY);
    g.drawString(mem, fw, h);
  }