javaclass

Changeset

152:805aa0c63c2f
2005-01-23 Paul Boddie raw files shortlog changelog graph Changed the stylesheet and added licensing details.
docs/index.html (file) docs/styles.css (file)
     1.1 --- a/docs/index.html	Sun Jan 23 01:53:35 2005 +0100
     1.2 +++ b/docs/index.html	Sun Jan 23 01:53:35 2005 +0100
     1.3 @@ -29,76 +29,63 @@
     1.4  <p>You can run Java classes by finding one with a main method and executing
     1.5  it. Here's a comparison of a freshly prepared Java class being run in Python
     1.6  and in a Java virtual machine respectively:</p>
     1.7 -
     1.8 -<p class="prompt">cd tests/</p>
     1.9 -
    1.10 -<p class="prompt">javac Value.java</p>
    1.11 -
    1.12 -<p class="prompt">runclass.py Value</p>
    1.13 -
    1.14 -<p class="result">v.getValue() correct: 123<br />
    1.15 -v.getValue() correct: 456<br />
    1.16 -v.isPositive() correct: 1<br />
    1.17 -v.isPositive() correct: 0<br />
    1.18 -v.compare(-790) correct: -1<br />
    1.19 -v.compare(-788) correct: 1<br />
    1.20 -v.compare(-789) correct: 0<br />
    1.21 -v.getValue() == v2.getValue() correct: 0<br />
    1.22 -v2.add(-123) correct: 0<br />
    1.23 -v2.getValue() correct: 255</p>
    1.24 -
    1.25 -<p class="prompt">java Value</p>
    1.26 -
    1.27 -<p class="result">v.getValue() correct: 123<br />
    1.28 -v.getValue() correct: 456<br />
    1.29 -v.isPositive() correct: true<br />
    1.30 -v.isPositive() correct: false<br />
    1.31 -v.compare(-790) correct: -1<br />
    1.32 -v.compare(-788) correct: 1<br />
    1.33 -v.compare(-789) correct: 0<br />
    1.34 -v.getValue() == v2.getValue() correct: false<br />
    1.35 -v2.add(-123) correct: 0<br />
    1.36 -v2.getValue() correct: 255</p>
    1.37 +<pre class="Prompt">cd tests/</pre>
    1.38 +<pre class="Prompt">javac Value.java</pre>
    1.39 +<pre class="PromptRequest">runclass.py Value</pre>
    1.40 +<pre class="PromptResponse">v.getValue() correct: 123
    1.41 +v.getValue() correct: 456
    1.42 +v.isPositive() correct: 1
    1.43 +v.isPositive() correct: 0
    1.44 +v.compare(-790) correct: -1
    1.45 +v.compare(-788) correct: 1
    1.46 +v.compare(-789) correct: 0
    1.47 +v.getValue() == v2.getValue() correct: 0
    1.48 +v2.add(-123) correct: 0
    1.49 +v2.getValue() correct: 255</pre>
    1.50 +<pre class="PromptRequest">java Value</pre>
    1.51 +<pre class="PromptResponse">v.getValue() correct: 123
    1.52 +v.getValue() correct: 456
    1.53 +v.isPositive() correct: true
    1.54 +v.isPositive() correct: false
    1.55 +v.compare(-790) correct: -1
    1.56 +v.compare(-788) correct: 1
    1.57 +v.compare(-789) correct: 0
    1.58 +v.getValue() == v2.getValue() correct: false
    1.59 +v2.add(-123) correct: 0
    1.60 +v2.getValue() correct: 255</pre>
    1.61  
    1.62  <h3>The Slightly More Credible Example</h3>
    1.63  
    1.64  <p>It can be more interesting to get into Python's interactive mode and then
    1.65  start playing around with Java classes:</p>
    1.66 -
    1.67 -<p class="python-result">Python 2.2.2 (#2, Jan 21 2005, 16:16:57)<br />
    1.68 -[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2<br />
    1.69 -Type "help", "copyright", "credits" or "license" for more information.</p>
    1.70 -
    1.71 -<p class="python-prompt">import javaclass.classhook</p>
    1.72 -
    1.73 -<p class="python-prompt">from __this__ import Value</p>
    1.74 -
    1.75 -<p class="python-prompt">dir()</p>
    1.76 -
    1.77 -<p class="python-result">['Value', '__builtins__', '__doc__', '__name__',
    1.78 -'javaclass']</p>
    1.79 -
    1.80 -<p class="python-prompt">dir(Value)</p>
    1.81 -
    1.82 -<p class="python-result">['__class__', '__delattr__', '__dict__', '__doc__',
    1.83 +<pre class="PromptResponse">Python 2.2.2 (#2, Jan 21 2005, 16:16:57)
    1.84 +[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
    1.85 +Type "help", "copyright", "credits" or "license" for more information.</pre>
    1.86 +<pre class="PythonPrompt">import javaclass.classhook</pre>
    1.87 +<pre class="PythonPrompt">from __this__ import Value</pre>
    1.88 +<pre class="PythonPrompt">dir()</pre>
    1.89 +<pre class="PromptResponse">['Value', '__builtins__', '__doc__', '__name__',
    1.90 +'javaclass']</pre>
    1.91 +<pre class="PythonPrompt">dir(Value)</pre>
    1.92 +<pre class="PromptResponse">['__class__', '__delattr__', '__dict__', '__doc__',
    1.93  '__getattribute__', '__hash__', '__init__', '__init______I_', '__module__',
    1.94  '__new__', '__reduce__', '__repr__', '__setattr__', '__str__', '__weakref__',
    1.95  'add', 'add____I_', 'compare', 'compare____I_', 'getClass', 'getClass___',
    1.96  'getValue', 'getValue___', 'isPositive', 'isPositive___', 'main',
    1.97  'main___java__lang__String_array_', 'newValue', 'newValue___', 'setValue',
    1.98 -'setValue____I_']</p>
    1.99 -
   1.100 -<p class="python-prompt">v = Value(20050121)</p>
   1.101 -
   1.102 -<p class="python-prompt">v.getValue()</p>
   1.103 +'setValue____I_']</pre>
   1.104 +<pre class="PythonPrompt">v = Value(20050121)</pre>
   1.105 +<pre class="PythonPrompt">v.getValue()</pre>
   1.106 +<pre class="PromptResponse">20050121</pre>
   1.107 +<pre class="PythonPrompt">v.setValue(20050401)</pre>
   1.108 +<pre class="PythonPrompt">v.getValue()</pre>
   1.109 +<pre class="PromptResponse">20050401</pre>
   1.110  
   1.111 -<p class="python-result">20050121</p>
   1.112 -
   1.113 -<p class="python-prompt">v.setValue(20050401)</p>
   1.114 +<h2>Copyright and Licence</h2>
   1.115  
   1.116 -<p class="python-prompt">v.getValue()</p>
   1.117 -
   1.118 -<p class="python-result">20050401</p>
   1.119 +<p>The javaclass software is distributed under the terms of the GNU Lesser
   1.120 +General Public Licence (LGPL). See the file <code>COPYING.txt</code> in the
   1.121 +<code>docs</code> directory within the source code distribution.</p>
   1.122  
   1.123  <h2>Getting Started</h2>
   1.124  
     2.1 --- a/docs/styles.css	Sun Jan 23 01:53:35 2005 +0100
     2.2 +++ b/docs/styles.css	Sun Jan 23 01:53:35 2005 +0100
     2.3 @@ -1,77 +1,116 @@
     2.4 -body {
     2.5 +.Selected {
     2.6 +background-color: silver;
     2.7 +color: black;
     2.8 +font-family: sans-serif;
     2.9 +}
    2.10 +
    2.11 +.Selected A:link { color: black; }
    2.12 +.Selected A:visited { color: black; }
    2.13 +.Selected A:active { color: black; }
    2.14 +
    2.15 +.Unselected {
    2.16 +background-color: gray;
    2.17 +color: black;
    2.18 +font-family: sans-serif;
    2.19 +}
    2.20 +
    2.21 +.Unselected A:link { color: black; }
    2.22 +.Unselected A:visited { color: black; }
    2.23 +.Unselected A:active { color: black; }
    2.24 +
    2.25 +.Main { vertical-align: top; }
    2.26 +
    2.27 +BODY {
    2.28  background-color: white;
    2.29  font-size: 12pt;
    2.30  }
    2.31  
    2.32 -h1 {
    2.33 +H1 {
    2.34  color: navy;
    2.35  font-family: sans-serif;
    2.36  font-size: 20pt;
    2.37  }
    2.38  
    2.39 -h2 {
    2.40 +H2 {
    2.41  color: navy;
    2.42  font-family: sans-serif;
    2.43  font-size: 18pt;
    2.44  }
    2.45  
    2.46 -h3 {
    2.47 +H3 {
    2.48  color: navy;
    2.49  font-family: sans-serif;
    2.50  font-size: 16pt;
    2.51  }
    2.52  
    2.53 -h4 {
    2.54 +H4 {
    2.55  color: navy;
    2.56  font-family: sans-serif;
    2.57  font-size: 15pt;
    2.58  }
    2.59  
    2.60 -h5 {
    2.61 +H5 {
    2.62  color: navy;
    2.63  font-family: sans-serif;
    2.64  font-size: 14pt;
    2.65  }
    2.66  
    2.67 -ul {
    2.68 +UL {
    2.69  list-style-type: disc;
    2.70  }
    2.71  
    2.72 -pre {
    2.73 -background-color: silver;
    2.74 +.MainHeading {
    2.75  color: black;
    2.76 +background-color: gray;
    2.77 +font-family: sans-serif;
    2.78 +font-size: 14pt;
    2.79 +font-weight: bold;
    2.80 +vertical-align: top;
    2.81  }
    2.82  
    2.83 -p.prompt {
    2.84 -font-family: fixed;
    2.85 +.SubHeading {
    2.86 +color: black;
    2.87  background-color: silver;
    2.88 -color: black;
    2.89 +font-family: sans-serif;
    2.90 +font-size: 14pt;
    2.91 +font-weight: bold;
    2.92 +vertical-align: top;
    2.93  }
    2.94  
    2.95 -p.prompt:before {
    2.96 -content: "$ ";
    2.97 +.CellHeading {
    2.98 +color: black;
    2.99 +background-color: silver;
   2.100 +font-family: sans-serif;
   2.101 +font-size: 12pt;
   2.102 +font-weight: bold;
   2.103 +vertical-align: top;
   2.104  }
   2.105  
   2.106 -p.result {
   2.107 -font-family: fixed;
   2.108 -background-color: white;
   2.109 -color: black;
   2.110 -margin-left: 1em;
   2.111 +.CellContent {
   2.112 +font-size: 12pt;
   2.113 +vertical-align: top;
   2.114 +}
   2.115 +
   2.116 +PRE.Python {
   2.117 +background-color: #e0e0e0;
   2.118 +width: 100%;
   2.119 +}
   2.120 +
   2.121 +.Submodule {
   2.122 +color: #ff0000
   2.123  }
   2.124  
   2.125 -p.python-prompt {
   2.126 -font-family: fixed;
   2.127 -background-color: silver;
   2.128 -color: black;
   2.129 +PRE.Prompt {
   2.130 +background-color: #c0c0c0;
   2.131 +width: 100%;
   2.132  }
   2.133  
   2.134 -p.python-prompt:before {
   2.135 -content: ">>> ";
   2.136 +PRE.PromptRequest {
   2.137 +background-color: #b0d0b0;
   2.138 +width: 100%;
   2.139  }
   2.140  
   2.141 -p.python-result {
   2.142 -font-family: fixed;
   2.143 -background-color: white;
   2.144 -color: black;
   2.145 -margin-left: 2em;
   2.146 +PRE.PromptResponse {
   2.147 +background-color: #d0b0b0;
   2.148 +width: 100%;
   2.149  }