Exemplo n.º 1
0
 public void drawListRow(ListField listField, Graphics g, int index, int y, int w) {
   String sColapsado = "";
   Item item = (Item) get(listField, index);
   if (listField.getSelectedIndex() == index) {
     g.setColor(Color.WHITE);
     g.setBackgroundColor(Estilos.getBGSelected());
   } else {
     if (item.isCabecera()) {
       g.setColor(Estilos.getColorInterlinea(0));
       g.setBackgroundColor(Estilos.getBGInterlinea(0));
     } else {
       g.setColor(Estilos.getColorInterlinea(1));
       g.setBackgroundColor(Estilos.getBGInterlinea(1));
     }
     g.clear();
   }
   if (item.isCabecera()) {
     if (item.isColapsado()) {
       sColapsado = Characters.BLACK_RIGHT_POINTING_TRIANGLE + " ";
     } else {
       sColapsado = Characters.BLACK_DOWN_POINTING_TRIANGLE + " ";
     }
   } else {
     sColapsado = Characters.SPACE + "";
   }
   g.drawText(sColapsado + item.getDescripcion(), 0, y, DrawStyle.LEFT, w);
   g.drawText(item.getValor(), 0, y, DrawStyle.RIGHT, w);
 }