26 |
* Written by Benja Fallenstein |
* Written by Benja Fallenstein |
27 |
*/ |
*/ |
28 |
package org.nongnu.libvob.lava; |
package org.nongnu.libvob.lava; |
29 |
|
import org.nongnu.libvob.util.ScalableFont; |
30 |
import java.awt.*; |
import java.awt.*; |
31 |
|
|
32 |
/** A demo of the capabilities of the |
/** A demo of the capabilities of the |
46 |
new Box(Vob.Y), |
new Box(Vob.Y), |
47 |
300, Vob.X); |
300, Vob.X); |
48 |
|
|
49 |
Vob r1 = new Colorize(new RectVob(50, 20), Color.blue); |
ScalableFont font = new ScalableFont("serif", 0, 12); |
50 |
for(int i=0; i<25; i++) { |
String string = "A little experiment 'ad hominem.' " |
51 |
Vob r2 = new Colorize(new FilledRect(5*i, 30), Color.blue); |
+ "(What 'ad hominem' means? I wouldn't know. " |
52 |
seq.add(r1); seq.add(r2); |
+ "I just use it to sound impressive. This is " |
53 |
|
+ "really about linebreaking :-) )"; |
54 |
|
|
55 |
|
for(int i=0; i<string.length(); i++) { |
56 |
|
if((i+1) % 30 == 0) |
57 |
|
seq.add(new RectVob(20, 12)); |
58 |
|
seq.add(new TextVob(string.substring(i, i+1), font)); |
59 |
} |
} |
60 |
|
|
61 |
g.add(new Translate(seq.close(), 300, 70)); |
g.add(new Translate(new Colorize(seq.close(), Color.blue), |
62 |
|
300, 70)); |
63 |
|
|
64 |
Vob rect = new RectVob(300, (int)seq.getSize(Vob.Y)); |
Vob rect = new RectVob(300, (int)seq.getSize(Vob.Y)); |
65 |
g.add(new Translate(new Colorize(rect, Color.red), |
g.add(new Translate(new Colorize(rect, Color.red), |