Пример #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(64, 64, 64, 192);
   g.frect(Coord.z, sz);
   int i = s;
   int y = 0;
   synchronized (chls) {
     while (i < chls.size()) {
       DarkChannel ch = chls.get(i);
       if (ch.chan == sel) {
         g.chcolor(128, 128, 192, 255);
         g.frect(new Coord(0, y), new Coord(sz.x, 19));
       }
       g.chcolor(255, 255, 255, 255);
       if ((ch.rname == null) || !ch.rname.text.equals(ch.chan.name()))
         ch.rname = nf.render(ch.chan.name());
       g.aimage(ch.rname.tex(), new Coord(sz.x / 2, y + 10), 0.5, 0.5);
       g.line(new Coord(5, y + 19), new Coord(sz.x - 5, y + 19), 1);
       y += 20;
       if (y >= sz.y) break;
       i++;
     }
   }
   g.chcolor();
 }