示例#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);
 }
 protected void paintBackground(Graphics gfx) {
   if (drawBtnStyle) {
     gfx.setBackgroundColor(Color.BLACK);
     gfx.clear();
   }
   super.paintBackground(gfx);
 }
 public void paint(Graphics graphics) {
   // Sets the BackgroundColor
   graphics.setBackgroundColor(Color.BLACK);
   graphics.setColor(Color.WHITESMOKE);
   graphics.drawText("Black", 0, 10);
   // Clears the entire graphic area to the current background
   graphics.clear();
 }
 protected void drawFocus(Graphics gfx, boolean on) {
   // we don't call super.drawFocus(), completely overriding native behavior,
   // otherwise some devices (e.g. Storm) draw some native focus graphics
   // that looks a bit ugly for us
   if (on) {
     gfx.setBackgroundColor(0x005DE7);
     gfx.clear();
     paint(gfx);
   }
 }
示例#5
0
  public void drawListRow(ListField list, Graphics g, int index, int y, int w) {

    Font font = g.getFont();
    int xPos = 30;
    int yPos = y + (list.getRowHeight() - imagee1.getHeight()) / 2;
    int yPosTxt = y + (list.getRowHeight() - font.getHeight()) / 2;

    if (g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS)) {
      g.setBackgroundColor(0x005A6971);
      // g.setBackgroundColor(0x005A6971);
      // g.drawRoundRect(0, 0, 630, 80, 15, 15);
      g.clear();
    } else {
      g.setColor(Color.WHITE);
      // g.drawRoundRect(0, 0, 630, 80, 15, 15);
    }

    for (int i = 0; i < bit.length; i++) {
      image = bit[index];
      g.drawBitmap(5, yPos + 3, image.getWidth(), image.getHeight(), image, 0, 0);
    }

    g.setFont(Constants.fontBold);
    xPos = xPos + image.getWidth();
    String text = (String) listElements.elementAt(index);
    g.drawText(text, xPos, yPosTxt);
    g.setFont(Constants.fontVerySmall);

    //		for (int i = 0; i < bit.length; i++) {
    //			xPos = 30 + image.getWidth();
    //			String textSubText = Constants.selectedBranch;
    //			g.drawText(textSubText, xPos, yPosTxt + 25);
    //		}

    xPos = 30 + image.getWidth();

    switch (index) {
      case 0:
        String textSubText = Constants.selectedBranch;
        g.drawText(textSubText, xPos, yPosTxt + 25);
        break;

      case 1:
        String textProcessText = Constants.selectedProcess;
        g.drawText(textProcessText, xPos, yPosTxt + 25);
        break;

      case 2:
        String textLocationText = Constants.selectedLocation;
        g.drawText(textLocationText, xPos, yPosTxt + 25);
        break;
    }

    g.drawBitmap(580, yPos + 3, arrowImage.getWidth(), arrowImage.getHeight(), arrowImage, 0, 0);
  }
示例#6
0
 public void drawListRow(ListField list, Graphics g, int index, int y, int w) {
   if (list.getSelectedIndex() == index) {
   } else {
     g.setColor(Color.WHITE);
     if (get(index).equals("Consultoras") || get(index).equals("Pedidos")) {
       g.setBackgroundColor(Estilos.getBGModulo());
     } else {
       g.setBackgroundColor(Estilos.getBGSubModulo());
     }
     g.clear();
   }
   g.drawText(get(index), 0, y, 0, w);
 }
示例#7
0
  public void drawListRow(ListField list, Graphics g, int index, int y, int w) {

    Font font = g.getFont();
    int xPos = 30;
    //		int yPos = y + (list.getRowHeight() - bit[1].getHeight()) / 2;
    int yPos = y + (list.getRowHeight() - imagee2.getHeight()) / 2;
    int yPosTxt = y + (list.getRowHeight() - font.getHeight()) / 2;

    // Bitmap imageBackground = Bitmap
    // .getBitmapResource("button_for_thumbnails_inactive.png");
    // if (list.getSelectedIndex() != index) {
    // g.drawBitmap(0, 0, 640, 80, imageBackground, 0, 0);
    // }

    if (g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS)) {
      g.setBackgroundColor(0x005A6971);
      // g.drawRoundRect(0, 0, 630, 80, 15, 15);
      g.clear();
    } else {
      g.setColor(Color.WHITE);
      // g.drawRoundRect(0, 0, 630, 80, 15, 15);
    }

    //		for (int i = 0; i < bit.length; i++) {
    //			image = bit[index];
    //			g.drawBitmap(5, yPos + 3, image.getWidth(), image.getHeight(),
    //					image, 0, 0);
    //		}

    g.drawBitmap(5, yPos + 3, imagee2.getWidth(), imagee2.getHeight(), imagee2, 0, 0);

    xPos = xPos + imagee2.getWidth();
    String text = (String) listElements.elementAt(index);
    g.drawText(text, xPos, yPosTxt + 3);

    g.drawBitmap(580, yPos + 7, arrowImage.getWidth(), arrowImage.getHeight(), arrowImage, 0, 0);
  }