コード例 #1
0
  @Override
  public void paint(Graphics g) {
    g.setColor(Color.white);
    g.fillRect(0, 0, getWidth(), getHeight());
    if (self == null) {
      self = new Self(1000, maxX, maxY);
    }

    drawCells(g, self);
    if (testing.isView()) {
      g.setColor(Color.white);
      g.fillRect(0, 0, getWidth(), getHeight());

      drawCells(g, antigen);
      drawCells(g, testing);
      button.setLabel(testing.printAccuracy(antigen));
      // drawStepCells(g);
      antigen = null;
      testing.setView(false);
    }

    if (antigen != null) {
      if (antigen.isLastView()) {
        drawCells(g, antigen);
        antigen.setLastView(false);
        testing.setView(true);
        button.setLabel("Calculating Accuracy");
        testing.countAccuracy(antigen);
        button.setLabel("Viewing Accuracy");
        // antigen = null;
      } else {
        drawStepCells(g);
      }
    }
  }
コード例 #2
0
 public void drawStepCells(Graphics g) {
   Cell[] c = antigen.getCells();
   int j = antigen.getStep();
   int i = 0;
   while (i < j) {
     drawCircle(g, c[i].posX, c[i].posY, c[i].radian, antigen.getColor());
     i++;
   }
   if (j == antigen.getFilled()) {
     antigen.resetStep();
     antigen.setStillStep(false);
     antigen.setLastView(true);
   } else {
     antigen.setStep();
   }
 }