import java.awt.*;
import javax.swing.*;
public class DrawDomino extends Canvas
{
    Tableau dominoTableau;
    int scale = 50;
    int offset = 10;
    int titleHeight = 30;
    public int width;
    public int height;

    public DrawDomino(Tableau input) {
	dominoTableau = input;
	width = scale*input.maxWidth() + 2*offset;
	height = scale*input.maxHeight() + 2*offset + titleHeight;
    }

    public void paint(Graphics graphics) {
	int longSide = 2*scale;
	int shortSide = scale;
	for (int i = 0; i < dominoTableau.getSize(); i++) {
	    Domino current = dominoTableau.getDomino(i);
	    int xVal = current.getFirstBlock().getXVal();
	    int yVal = current.getFirstBlock().getYVal();
	    int labelInt = current.getLabel();
	    String labelSt = Integer.toString(labelInt);
	    int xCoord = scale*(xVal-1)+offset;
	    int yCoord = scale*(yVal-1)+offset;

	    if (dominoTableau.getDomino(i).getIsVertical()) {
		graphics.drawRect(xCoord, yCoord, shortSide, longSide);
		graphics.drawString(labelSt, xCoord+scale/2, yCoord+scale);
	    }
	    else {
		graphics.drawRect(xCoord, yCoord, longSide, shortSide);
		graphics.drawString(labelSt, xCoord+scale, yCoord+scale/2);
	    }
	}
    }


}
@@ -169,16 +169,82 @@
 t = 30;%0A
+    int xLabelOffset = scale/15;%0A    int yLabelOffset = scale/15;%0A
     publ
@@ -1083,16 +1083,29 @@
 +scale/2
+-xLabelOffset
 , yCoord
@@ -1110,16 +1110,29 @@
 rd+scale
++yLabelOffset
 );%0A%09    
@@ -1246,16 +1246,29 @@
 rd+scale
+-xLabelOffset
 , yCoord
@@ -1275,16 +1275,29 @@
 +scale/2
++yLabelOffset
 );%0A%09    

Fix domino labels