Program: 86591
Project: 86591
Buggy source:
/** 
 * Draw Mesh in the JPanel : triangles and edges. If duration is positive, also display it Must be used only when using package drawing
 * @param g
 */
protected void displayObject(Graphics g){
  getBoundingBox();
  double scaleX, scaleY;
  double minX, minY;
  scaleX=1200 / (theBox.maxx - theBox.minx);
  scaleY=600 / (theBox.maxy - theBox.miny);
  if (scaleX > scaleY)   scaleX=scaleY;
 else   scaleY=scaleX;
  minX=theBox.minx;
  minY=theBox.miny;
  int decalageX=10;
  int decalageY=630;
  scaleY=-scaleY;
  int legende=650;
  g.setColor(Color.white);
  g.fillRect(0,0,decalageX + 5 + 1200,decalageY + 10);
  g.fillRect(0,legende,decalageX + 5 + 1200,legende + 100);
  g.setColor(Color.black);
  g.drawString(triangles.size() + "String_Node_Str" + edges.size()+ "String_Node_Str"+ points.size()+ "String_Node_Str",decalageX,legende + 10);
  if (duration > 0) {
    g.drawString("String_Node_Str" + duration + "String_Node_Str",decalageX,legende + 25);
  }
  if (!triangles.isEmpty()) {
    for (    MyTriangle aTriangle : triangles) {
      aTriangle.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
    }
    if (displayCircles)     for (    MyTriangle aTriangle : triangles) {
      aTriangle.displayObjectCircles(g,decalageX,decalageY);
    }
  }
  if (!constraintsEdges.isEmpty())   for (  MyEdge aVertex : constraintsEdges) {
    aVertex.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
  }
  if (!edges.isEmpty())   for (  MyEdge aVertex : edges) {
    if (aVertex.isLocked()) {
      aVertex.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
    }
  }
  int psize=points.size();
  if (psize > 0) {
    for (    MyPoint aPoint : points) {
      aPoint.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
    }
  }
}

Fixed version (ground truth):
/** 
 * Draw Mesh in the JPanel : triangles and edges. If duration is positive, also display it Must be used only when using package drawing
 * @param g
 */
protected void displayObject(Graphics g){
  getBoundingBox();
  double scaleX, scaleY;
  double minX, minY;
  int XSize=1200;
  int YSize=600;
  int decalageX=10;
  int decalageY=YSize + 30;
  int legende=YSize + 60;
  int bordure=10;
  scaleX=XSize / (theBox.maxx - theBox.minx);
  scaleY=YSize / (theBox.maxy - theBox.miny);
  if (scaleX > scaleY)   scaleX=scaleY;
 else   scaleY=scaleX;
  minX=theBox.minx;
  minY=theBox.miny;
  scaleY=-scaleY;
  g.setColor(Color.white);
  g.fillRect(decalageX - bordure,decalageY - YSize - bordure,2 * bordure + XSize,2 * bordure + YSize);
  g.fillRect(decalageX - bordure,legende - bordure,2 * bordure + XSize,2 * bordure + 50);
  g.setColor(Color.black);
  g.drawString(triangles.size() + "String_Node_Str" + edges.size()+ "String_Node_Str"+ points.size()+ "String_Node_Str",decalageX,legende + 10);
  if (duration > 0) {
    g.drawString("String_Node_Str" + duration + "String_Node_Str",decalageX,legende + 25);
  }
  if (!triangles.isEmpty()) {
    for (    MyTriangle aTriangle : triangles) {
      aTriangle.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
    }
    if (displayCircles)     for (    MyTriangle aTriangle : triangles) {
      aTriangle.displayObjectCircles(g,decalageX,decalageY);
    }
  }
  if (!constraintsEdges.isEmpty())   for (  MyEdge aVertex : constraintsEdges) {
    aVertex.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
  }
  if (!edges.isEmpty())   for (  MyEdge aVertex : edges) {
    if (aVertex.isLocked()) {
      aVertex.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
    }
  }
  int psize=points.size();
  if ((psize > 0) && (psize < 100)) {
    for (    MyPoint aPoint : points) {
      aPoint.displayObject(g,decalageX,decalageY,minX,minY,scaleX,scaleY);
    }
  }
}