Ejemplo n.º 1
0
  void displayCharacterMap(Graphics g) {
    if (currentChars != null) {
      g.setColor(0xffffff);
      g.fillRect(0, getHeight() - inputHeight - 2, getWidth(), inputHeight + 2);
      g.setColor(0x000000);
      g.drawLine(0, getHeight() - inputHeight - 2, getWidth(), getHeight() - inputHeight - 2);
      for (int i = 0; i < currentChars.length; i++) {
        char ch = currentChars[i];
        if (isUppercase) {
          ch = String.valueOf(currentChars[i]).toUpperCase().charAt(0);
        }

        // TODO: if i*12 > getWidth() ?

        g.drawChar(ch, i * 12, getHeight() - inputHeight, Graphics.LEFT | Graphics.TOP);
        if (currentChars[currentKeyStep] == currentChars[i]) {
          g.drawRect(
              i * 12 - 2,
              getHeight() - inputHeight - 2,
              inputFont.charWidth(ch) + 4,
              inputHeight + 4);
        }
      }
    }
  }
Ejemplo n.º 2
0
 void displayStatus(Graphics g) {
   if (statusString != null) {
     g.setColor(0xffffff);
     g.fillRect(0, getHeight() - inputHeight - 2, getWidth(), inputHeight + 2);
     g.setColor(0x000000);
     g.drawLine(0, getHeight() - inputHeight - 2, getWidth(), getHeight() - inputHeight - 2);
     g.drawString(statusString, 0, getHeight() - inputHeight - 2, Graphics.LEFT | Graphics.TOP);
   }
 }
Ejemplo n.º 3
0
 void displayCurrentCommand(Graphics g) {
   g.setColor(0xffffff);
   g.fillRect(0, getHeight() - inputHeight - 2, getWidth(), inputHeight + 2);
   g.setColor(0x000000);
   g.drawLine(0, getHeight() - inputHeight - 2, getWidth(), getHeight() - inputHeight - 2);
   g.drawString(
       "Ctrl" + " + " + currentCharCommand,
       0,
       getHeight() - inputHeight,
       Graphics.LEFT | Graphics.TOP);
 }
Ejemplo n.º 4
0
 void displayCursor(Graphics g) {
   int x = getCursorX();
   int y = getCursorY();
   if (x >= 0 && x <= vectorLines.elementAt(y).toString().length()) {
     if (isSelected(x, y)) {
       g.setColor(0xffffff);
     } else {
       g.setColor(0x000000);
     }
     g.drawLine(caretLeft, (y) * inputHeight, caretLeft, (y + 1) * inputHeight);
   }
 }
Ejemplo n.º 5
0
  void displayScrollBar(Graphics g) {
    int x = getCursorX();
    int y = getCursorY();
    g.setColor(0xffffff);
    g.fillRect(getWidth() - 5, 0, 5, getHeight());
    g.setColor(0x000000);
    g.drawLine(getWidth() - 5, 0, getWidth() - 5, getHeight());

    int hScrollMin = inputHeight;

    int yScroll = (((linesOnScreen - 1) * y) * inputHeight) / getLinesCount();

    g.fillRect(getWidth() - 5, yScroll, 5, hScrollMin);
  }