1 21 package proguard.gui.splash; 22 23 import java.awt.Graphics ; 24 25 30 public class CircleSprite implements Sprite 31 { 32 private boolean filled; 33 private VariableInt x; 34 private VariableInt y; 35 private VariableInt radius; 36 37 38 45 public CircleSprite(boolean filled, 46 VariableInt x, 47 VariableInt y, 48 VariableInt radius) 49 { 50 this.filled = filled; 51 this.x = x; 52 this.y = y; 53 this.radius = radius; 54 } 55 56 57 59 public void paint(Graphics graphics, long time) 60 { 61 int xt = x.getInt(time); 62 int yt = y.getInt(time); 63 int r = radius.getInt(time); 64 65 if (filled) 66 { 67 graphics.fillOval(xt - r, yt - r, 2 * r, 2 * r); 68 } 69 else 70 { 71 graphics.drawOval(xt - r, yt - r, 2 * r, 2 * r); 72 } 73 } 74 } 75 | Popular Tags |