Ejemplo n.º 1
0
 @Override
 public boolean equals(Object object) {
   if (!(object instanceof TestStation)) {
     return false;
   }
   TestStation other = (TestStation) object;
   if ((this.creator == null && other.getCreator() != null)
       || (this.creator != null && !this.creator.equals(other.getCreator()))) {
     return false;
   }
   if ((this.hostName == null && other.getHostName() != null)
       || (this.hostName != null && !this.hostName.equals(other.getHostName()))) {
     return false;
   }
   return true;
 }
Ejemplo n.º 2
0
  public Fixtures(TestStation testStation, MainFrame fi) {
    cols = testStation.getPropertyInteger(STR_FIXTURE_COLUMNS, 1);
    rows = testStation.getPropertyInteger(STR_FIXTURE_ROWS, 1);
    gap = testStation.getPropertyInteger(STR_FIXTURE_GAP, 1);

    log.trace("Number of fixtures: " + testStation.getFixtures().size());
    if (testStation.getFixtures().size() > 0) {
      setLayout(new GridLayout(0, 1, 0, gap));
      fxs = new Hashtable<String, Fixture>();
      Iterator<TestFixture> it = testStation.getFixtures().iterator();
      for (int row = 0; row < rows; row++) {
        if (it.hasNext()) {
          JPanel panel = new JPanel();
          panel.setLayout(new GridLayout(1, 0, gap, 0));
          for (int col = 0; col < cols; col++) {
            log.trace("col: " + col + " of " + cols);
            if (it.hasNext()) {
              TestFixture fxt = it.next();
              Fixture fx = new Fixture(fxt, fi);
              if (firstFixture == null) {
                firstFixture = fx;
              }
              fxs.put(fx.getName(), fx);
              panel.add(fx);
            } else {
              log.trace("No more fixtures!");
            }
          }
          add(panel);
        }
      }
    }
    //        else {
    /* fixtureless configuration */
    // ...
    //        }
  }