示例#1
0
  public void drawsmall(GOut g, Coord br, int h) {
    Coord c;
    if (qline != null) {
      if ((rqline == null) || !rqline.text.equals(qline.line)) {
        String pre = String.format("%s> ", qline.chan.name());
        rqline = qfnd.render(pre + qline.line);
        rqpre = pre.length();
      }
      c = br.sub(0, 20);
      g.chcolor(24, 24, 16, 200);
      g.frect(c, rqline.tex().sz());
      g.chcolor();
      g.image(rqline.tex(), c);
      int lx = rqline.advance(qline.point + rqpre);
      g.line(new Coord(br.x + lx + 1, br.y - 18), new Coord(br.x + lx + 1, br.y - 6), 1);
    } else {
      c = br.sub(0, 5);
    }
    long now = System.currentTimeMillis();
    synchronized (notifs) {
      for (Iterator<Notification> i = notifs.iterator(); i.hasNext(); ) {
        Notification n = i.next();
        if (now - n.time > 5000) {
          i.remove();
          continue;
        }
        if ((c.y -= n.msg.sz().y) < br.y - h) break;

        g.chcolor(24, 24, 16, 200);
        g.frect(c, n.chnm.tex().sz().add(n.msg.tex().sz().x + selw, 0));
        g.chcolor();
        g.image(n.chnm.tex(), c, br.sub(0, h), br.add(selw - 10, 0));
        g.image(n.msg.tex(), c.add(selw, 0));
      }
    }
  }
示例#2
0
 public void draw(GOut g) {
   g.chcolor(24, 24, 16, 200);
   g.frect(Coord.z, sz);
   g.chcolor();
   int y = 0;
   boolean sel = false;
   synchronized (msgs) {
     for (Message msg : msgs) {
       if ((selstart != null) && (msg == selstart.msg)) sel = true;
       int y1 = y - sb.val;
       int y2 = y1 + msg.sz().y;
       if ((y2 > 0) && (y1 < ih())) {
         if (sel) drawsel(g, msg, y1);
         g.image(msg.tex(), new Coord(0, y1));
       }
       if ((selend != null) && (msg == selend.msg)) sel = false;
       y += msg.sz().y;
     }
   }
   sb.max = y - ih();
   super.draw(g);
 }