Esempio n. 1
0
 public void drawicons(GOut g) {
   OCache oc = ui.sess.glob.oc;
   synchronized (oc) {
     for (Gob gob : oc) {
       try {
         GobIcon icon = gob.getattr(GobIcon.class);
         if (icon != null) {
           Coord gc = p2c(gob.rc);
           Tex tex = icon.tex();
           g.image(tex, gc.sub(tex.sz().div(2)));
         }
       } catch (Loading l) {
       }
     }
   }
 }
Esempio n. 2
0
 public Gob findicongob(Coord c) {
   OCache oc = ui.sess.glob.oc;
   synchronized (oc) {
     for (Gob gob : oc) {
       try {
         GobIcon icon = gob.getattr(GobIcon.class);
         if (icon != null) {
           Coord gc = p2c(gob.rc);
           Coord sz = icon.tex().sz();
           if (c.isect(gc.sub(sz.div(2)), sz)) return (gob);
         }
       } catch (Loading l) {
       }
     }
   }
   return (null);
 }