示例#1
0
    public Object getValueAt(int row, int col) {
      Run r = null;
      Run last = null;

      if (data == null) return "";
      r = data.getRun(row + 1);
      if (r == null) return "";

      if (row > 0) last = data.getRun(row);

      switch (col) {
        case 0:
          return df.format(r.getRaw());
        case 2:
          return new String("(" + r.getCones() + "," + r.getGates() + ")");
        case 3:
          return df.format(r.getNet());

        case 1:
          if (r.getRawOrder() == 1) return "*";
          else return "";

        case 4:
          if (r.getNetOrder() <= 2) return r.getNetOrder();
          else return "";
      }
      return null;
    }
示例#2
0
    public Component getTableCellRendererComponent(
        JTable t, Object o, boolean is, boolean hf, int r, int c) {
      JLabel cell = (JLabel) super.getTableCellRendererComponent(t, o, is, hf, r, c);
      cell.setHorizontalAlignment(JLabel.CENTER);

      EntrantResultModel m = (EntrantResultModel) t.getModel();
      Run run = m.getRun(r);
      if ((run != null) && (run.getNetOrder() == 1)) {
        cell.setFont(bold);
        cell.setBackground(mygray);
      } else {
        cell.setFont(regular);
        cell.setBackground(Color.WHITE);
      }

      return cell;
    }