private void updlayout() { synchronized (ui.sess.glob.paginae) { List<Pagina> cur = new ArrayList<Pagina>(); loading = !cons(this.cur, cur); Collections.sort(cur, sorter); int i = curoff; hotmap.clear(); for (int y = 0; y < gsz.y; y++) { for (int x = 0; x < gsz.x; x++) { Pagina btn = null; if ((this.cur != null) && (x == gsz.x - 1) && (y == gsz.y - 1)) { btn = bk; } else if ((cur.size() > ((gsz.x * gsz.y) - 1)) && (x == gsz.x - 2) && (y == gsz.y - 1)) { btn = next; } else if (i < cur.size()) { Resource.AButton ad = cur.get(i).act(); if (ad.hk != 0) hotmap.put(Character.toUpperCase(ad.hk), cur.get(i)); btn = cur.get(i++); } layout[x][y] = btn; } } pagseq = ui.sess.glob.pagseq; } }
private static Text rendertt(Resource res, boolean withpg) { Resource.AButton ad = res.layer(Resource.action); Resource.Pagina pg = res.layer(Resource.pagina); String tt = ad.name; int pos = tt.toUpperCase().indexOf(Character.toUpperCase(ad.hk)); if (pos >= 0) tt = tt.substring(0, pos) + "$b{$col[255,128,0]{" + tt.charAt(pos) + "}}" + tt.substring(pos + 1); else if (ad.hk != 0) tt += " [" + ad.hk + "]"; if (withpg && (pg != null)) { tt += "\n\n" + pg.text; } return (ttfnd.render(tt, 300)); }
public boolean globtype(char k, KeyEvent ev) { if ((k == 27) && (this.cur != null)) { this.cur = null; curoff = 0; updlayout(); return (true); } else if ((k == 8) && (this.cur != null)) { this.cur = paginafor(this.cur.act().parent); curoff = 0; updlayout(); return (true); } else if ((k == 'N') && (layout[gsz.x - 2][gsz.y - 1] == next)) { use(next, false); return (true); } Pagina r = hotmap.get(Character.toUpperCase(k)); if (r != null) { use(r, true); return (true); } return (false); }