Author: ilya_shaikovsky
Date: 2008-06-10 05:45:27 -0400 (Tue, 10 Jun 2008)
New Revision: 8969
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java
Log:
http://jira.jboss.com/jira/browse/RF-3599
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java 2008-06-10
09:45:25 UTC (rev 8968)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/paint2d/PaintBean.java 2008-06-10
09:45:27 UTC (rev 8969)
@@ -12,14 +12,17 @@
public void paint(Graphics2D g2d, Object obj) {
- PaintData data = (PaintData) obj;
+ PaintData data = (PaintData) obj;
+
+ g2d.setColor(Color.WHITE);
+ g2d.fillRect(0, 0, 300, 120);
- int testLenght = data.text.length();
- fontSize = testLenght < 8? 40 : 40 - (testLenght - 8);
+ int testLenght = data.text.length();
+ fontSize = testLenght < 8? 40 : 40 - (testLenght - 8);
if (fontSize < 12)fontSize = 12;
Font font = new Font("Serif", Font.HANGING_BASELINE, fontSize);
g2d.setFont(font);
-
+
int x = 10;
int y = fontSize*5/2;
g2d.translate(x, y);