2 import java
.awt
.Dimension
;
3 import java
.awt
.Graphics2D
;
4 import java
.awt
.GradientPaint
;
8 protected Graphics2D g2d
;
10 public CommitPainter(Graphics2D g2d
) {
14 public void paintCommit(GraphCommit c
) {
15 final int HEIGHT
= 30;
17 final int SPACING
= 20;
19 int xPos
= c
.getXPos() * (WIDTH
+SPACING
);
20 int yPos
= c
.getYPos() * (HEIGHT
+SPACING
);
22 Color color1
= Color
.LIGHT_GRAY
;
23 Color color2
= color1
.darker();
25 GradientPaint gp
= new GradientPaint(
27 xPos
, yPos
+ HEIGHT
, color2
);
30 g2d
.fillRect(xPos
, yPos
, WIDTH
, HEIGHT
);
31 g2d
.setColor(Color
.GRAY
);
32 g2d
.drawRect(xPos
, yPos
, WIDTH
, HEIGHT
);