1 21 package proguard.gui.splash; 22 23 import java.awt.Graphics ; 24 25 30 public class RectangleSprite implements Sprite 31 { 32 private boolean filled; 33 private VariableColor color; 34 private VariableInt x; 35 private VariableInt y; 36 private VariableInt width; 37 private VariableInt height; 38 private VariableInt arcWidth; 39 private VariableInt arcHeight; 40 41 42 51 public RectangleSprite(boolean filled, 52 VariableColor color, 53 VariableInt x, 54 VariableInt y, 55 VariableInt width, 56 VariableInt height) 57 { 58 this(filled, color, x, y, width, height, new ConstantInt(0), new ConstantInt(0)); 59 } 60 61 62 73 public RectangleSprite(boolean filled, 74 VariableColor color, 75 VariableInt x, 76 VariableInt y, 77 VariableInt width, 78 VariableInt height, 79 VariableInt arcWidth, 80 VariableInt arcHeight) 81 { 82 this.filled = filled; 83 this.color = color; 84 this.x = x; 85 this.y = y; 86 this.width = width; 87 this.height = height; 88 this.arcWidth = arcWidth; 89 this.arcHeight = arcHeight; 90 } 91 92 94 public void paint(Graphics graphics, long time) 95 { 96 graphics.setColor(color.getColor(time)); 97 98 int xt = x.getInt(time); 99 int yt = y.getInt(time); 100 int w = width.getInt(time); 101 int h = height.getInt(time); 102 int aw = arcWidth.getInt(time); 103 int ah = arcHeight.getInt(time); 104 105 if (filled) 106 { 107 graphics.fillRoundRect(xt, yt, w, h, aw, ah); 108 } 109 else 110 { 111 graphics.drawRoundRect(xt, yt, w, h, aw, ah); 112 } 113 } 114 } 115 | Popular Tags |