/** Creates new form GrafkomView */
  public GrafkomView() {
    initComponents();

    iteratioResult = new ArrayList<IterationModel>();

    model = new GrafkomModel();
    model.setListener(this);
    controller = new GrafkomController(this);
    controller.setModel(model);
    tableModel = new TableIteration();
    IterationModel sample = new IterationModel();
    sample.setItterationK(2);
    sample.setParameterPx(3);
    Koordinat point = new Koordinat();
    point.setX(2);
    point.setY(4);
    sample.setPoint(point);
    iteratioResult.add(sample);
    tableModel.setListResult(iteratioResult);

    table1.setModel(tableModel);
    resultString = new ArrayList<String>();

    listModel = new ListResultModel();
    listModel.setResult(resultString);
    listGlass1.getList().setModel(listModel);
  }
  @Override
  public void hitungAlgoritma(BressenhamModel hitung, List<IterationModel> result) {
    tableModel.setListResult(result);
    table1.removeAll();
    table1.setModel(tableModel);
    listModel.removeAll();
    listModel.add(
        "Start Point (X,Y) = "
            + hitung.getStartPoint().getX()
            + ","
            + hitung.getStartPoint().getY());
    listModel.add(
        "End Point (X,Y) = " + hitung.getEndPoint().getX() + "," + hitung.getEndPoint().getY());
    listModel.add("Delta X = " + hitung.getDelta().getX());
    listModel.add("Delta Y = " + hitung.getDelta().getY());
    listModel.add("2*Delta X = " + hitung.getDuaDeltaX());
    listModel.add("2*Delta Y = " + hitung.getDuaDeltaY());
    listModel.add("(2*Delta Y) - (2*Delta X) = " + hitung.getDuaDeltaYMinDuaDeltaY());
    listModel.add("P(0) = (2*Delta Y) - Delta X  = " + hitung.getParameterKeNol());

    System.out.println("opened");
  }