/[libvob]/libvob/org/nongnu/libvob/lava/Demo.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/lava/Demo.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by benja, Sat Apr 5 18:51:19 2003 UTC revision 1.4 by benja, Sun Apr 6 12:30:30 2003 UTC
# Line 26  Demo.java Line 26  Demo.java
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
# Line 45  public class Demo { Line 46  public class Demo {
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),

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26