~vaifrax/inkscape/bugfix170049

« back to all changes in this revision

Viewing changes to src/dom/Filt.java

  • Committer: mental
  • Date: 2006-01-16 02:36:01 UTC
  • Revision ID: mental@users.sourceforge.net-20060116023601-wkr0h7edl5veyudq
moving trunk for module inkscape

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
import java.io.*;
 
4
 
 
5
public class Filt
 
6
{
 
7
 
 
8
void p(String s)
 
9
{
 
10
    System.out.println(s);
 
11
}
 
12
 
 
13
void output(String s)
 
14
{
 
15
    String name = s.trim();
 
16
    if (name == null || name.length()<2)
 
17
        return;
 
18
    String ucName = name.substring(0,1).toUpperCase() +
 
19
                    name.substring(1);
 
20
        
 
21
    p("/**");
 
22
    p(" *  return the '" + name + "' property" );
 
23
    p(" */");
 
24
    p("DOMString CSS2PropertiesImpl::get" + ucName + "()");
 
25
    p("{");
 
26
    p("    return " + name + ";");
 
27
    p("}");
 
28
    p("");
 
29
    p("/**");
 
30
    p(" *  set the '" + name + "' property");
 
31
    p(" */");
 
32
    p("void CSS2PropertiesImpl::set" + ucName + "(const DOMString &val)");
 
33
    p("                         throw (dom::DOMException)");
 
34
    p("{");
 
35
    p("    " + name + " = val;");
 
36
    p("}");
 
37
    p("");
 
38
 
 
39
 
 
40
}
 
41
 
 
42
 
 
43
void doIt()
 
44
{
 
45
    try
 
46
        {
 
47
        BufferedReader in = new BufferedReader(new FileReader("cssprop.txt"));
 
48
    
 
49
        while (true)
 
50
            {
 
51
            String s = in.readLine();
 
52
            if (s == null)
 
53
                break;
 
54
            output(s);
 
55
            }
 
56
        
 
57
        in.close();
 
58
        }
 
59
    catch (Exception e)
 
60
        {
 
61
        }
 
62
 
 
63
}
 
64
 
 
65
 
 
66
 
 
67
public static void main(String argv[])
 
68
{
 
69
    Filt f = new Filt();
 
70
    f.doIt();
 
71
 
 
72
}
 
73
 
 
74
 
 
75
 
 
76
}
 
77