Exemplo n.º 1
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);
   }
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
  void displayLines(Graphics g, int yStart) {
    // (1 + 2, depends on font size)

    if (isSelection && (xStartSelection != xEndSelection || yStartSelection != yEndSelection)) {
      for (int y = Math.max(0, yStart);
          y < Math.min(yStart + linesOnScreen + 1 + 2, vectorLines.size());
          y++) {
        String currentLine = vectorLines.elementAt(y).toString();
        int width = 0;

        for (int x = 0; x < currentLine.length(); x++) {
          int previousWidth = (x == 0) ? 0 : inputFont.charWidth(currentLine.charAt(x - 1));
          width += previousWidth;

          if (isSelected(x, y)) {
            g.setColor(0x000000);
            g.fillRect(
                width, y * inputHeight, inputFont.charWidth(currentLine.charAt(x)), inputHeight);

            g.setColor(0xffffff);
            g.drawChar(currentLine.charAt(x), width, y * inputHeight, Graphics.LEFT | Graphics.TOP);
          } else {
            g.setColor(0x000000);
            g.drawChar(currentLine.charAt(x), width, y * inputHeight, Graphics.LEFT | Graphics.TOP);
          }
        }

        if (currentLine.length() == 0) {
          if (isSelected(0, y)) {
            g.setColor(0x000000);
            g.fillRect(0, y * inputHeight, 5, inputHeight);
          }
        }
      }
    } else {
      for (int y = Math.max(0, yStart);
          y < Math.min(yStart + linesOnScreen + 1 + 2, vectorLines.size());
          y++) {
        g.drawString(
            vectorLines.elementAt(y).toString(), 0, y * inputHeight, Graphics.LEFT | Graphics.TOP);
      }
    }
  }
Exemplo n.º 4
0
 // display
 // not used
 void displayLines(Graphics g) {
   for (int y = 0; y < vectorLines.size(); y++) {
     g.drawString(
         vectorLines.elementAt(y).toString(), 0, y * inputHeight, Graphics.LEFT | Graphics.TOP);
   }
 }