예제 #1
0
  /**
   * Shows a string message in the client's log with the specified priority
   *
   * @param message
   * @param priority
   */
  public void show(String message, Priority priority) {
    switch (priority) {
      case LOW:
        backGC.add(Color.white);
        break;
      case NORMAL:
        backGC.add(Color.LIGHT_GRAY);
        break;
      case HIGH:
        backGC.add(Color.red);
        break;
      case SEVERE:
        backGC.add(Color.red);
        break;
    }

    if (priority.equals(Priority.SEVERE)) {
      foreGC.add(Color.white);
    } else {
      foreGC.add(Color.black);
    }

    lastMessage = message;

    listModel.addElement(formatMsg(message));
    render.setElements(backGC, foreGC);
    counter++;

    logText.ensureIndexIsVisible(logText.getLastVisibleIndex() + 1);
  }
예제 #2
0
  /**
   * Shows a string message in the client's log with the specified color
   *
   * @param message
   * @param color
   */
  public void show(String message, Color color) {
    backGC.add(Color.LIGHT_GRAY);
    foreGC.add(color);

    lastMessage = message;

    listModel.addElement(formatMsg(message));
    render.setElements(backGC, foreGC);
    counter++;

    logText.ensureIndexIsVisible(logText.getLastVisibleIndex() + 1);
  }