예제 #1
0
 /** Draws the domino at the position x, y */
 public void draw(double x, double y) {
   UI.setLineWidth(1);
   UI.setColor(Color.black);
   UI.fillRect(x, y, WIDTH, HEIGHT);
   UI.setColor(Color.red.darker());
   UI.drawRect(x + 1, y + 1, WIDTH - 3, HEIGHT - 3);
   UI.setLineWidth(2);
   UI.setColor(Color.gray);
   UI.drawLine(x + 2, y + WIDTH, x + WIDTH - 3, y + WIDTH);
   UI.setLineWidth(1);
   if (!flipped) {
     this.drawNumber(this.first, x, y);
     this.drawNumber(this.secnd, x, y + WIDTH);
   } else {
     this.drawNumber(this.secnd, x, y);
     this.drawNumber(this.first, x, y + WIDTH);
   }
 }