Ejemplo n.º 1
0
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      if (isSelected) this.setBackground(table.getSelectionBackground());
      else this.setBackground(table.getBackground());

      Node node = nodes.get(row);
      Request request = nodeIDToRequest.get(node.getNodeID());
      if (request == null) {
        this.setString("NONE");
        this.setValue(0);
      } else {
        int percent = (int) Math.round(request.getPercentDone());
        this.setString(request.getType().toString() + "  " + percent + "%");
        this.setValue(percent);
      }
      return this;
    }