Exemplo n.º 1
0
 public void draw(UShape shape) {
   final double x = translate.getDx();
   final double y = translate.getDy();
   if (shape instanceof UText) {
     drawText(x, y, (UText) shape);
   } else if (shape instanceof UHorizontalLine) {
     // Definitively a Horizontal line
   } else if (shape instanceof ULine) {
     // Probably a Horizontal line
   } else if (shape instanceof UImage) {
     drawImage(x, y, (UImage) shape);
   } else {
     throw new UnsupportedOperationException(shape.getClass().toString());
   }
 }
Exemplo n.º 2
0
 public Snake translate(UTranslate translate) {
   return move(translate.getDx(), translate.getDy());
 }