title: Width and height of a saved Netlogo applet?
body: <p>Given (x_top_left, y_top_left) and (x_low_right, y_low_right) in the Netlogo source, what should the width and height of the saved Netlogo applet be?</p>
  
  <h2>Background</h2>
  
  <p>I have a ton of authentic Netlogo files, prepared for courses and demos.  Using Perl or Ruby, I'd like to export them in batch as an applet in different files, possibly related by a table of contents in a left frame or so.  Much like  "save as applet", but then in batch, to different HTML files.</p>
  
  <p>All is trivial to do were it not that I got stuck in finding out which applet dimensions I am supposed to use in writing</p>
  
  <pre><code>&lt;applet code="org.nlogo.lite.Applet" archive="NetLogoLite.jar"
         width="???" height="???"&gt;
  &lt;param name="DefaultModel" value="netlogofile.nlogo"&gt;
  &lt;/applet&gt;
  </code></pre>
  
  <p>Notice the ???.  I searched for other Netlogo file parsers and encountered <a href="https://github.com/NetLogo/NetLogo/wiki/Model-file-format" rel="nofollow">https://github.com/NetLogo/NetLogo/wiki/Model-file-format</a>, which is not specific enough and <a href="https://github.com/rikblok/dokuwiki-plugin-netlogo/blob/master/syntax/applet.php" rel="nofollow">https://github.com/rikblok/dokuwiki-plugin-netlogo/blob/master/syntax/applet.php</a> which is a parser but yields results which appear useless to me.  (I got it running but it seems to parse the Netlogo source wrongly.)</p>
  
  <h2>Netlogo file format</h2>
  
  <p>I figured out that the Netlogo file format is like the following (comments after semicolon)</p>
  
  <pre><code>@#$#@#$#@
  GRAPHICS-WINDOW
  210 ; x-coord of upper left corner
  10  ; y-coord of upper left corner
  544 ; x-coord of lower right corner?
  215 ; y-coord of lower right corner?
  -1
  -1
  2.77 ; patch size
  1
  10 ; font size
  1
  1
  1
  0
  1
  0 ; world-wrap
  1 world-wrap
  -45 ; min-pxcor
  71 ; max-pcor
  -33 ; min-pycor
  29 max-pycor
  0
  0
  1 ; show tick counter
  ticks ; tick counter label
  </code></pre>
  
  <p>To get a feeling for the logics I parsed a few saved applets and got the following results:</p>
  
  <pre><code>(x_top_left, y_top_left) = (210, 10).
  (x_low_right, y_low_right) = (649, 470).
  Netlogo saves applet with width x height: 794 x 480.
  
  (x_top_left, y_top_left) = (96, 10).
  (x_low_right, y_low_right) = (535, 470).
  Netlogo saves applet with width x height: 629 x 480.
  
  (x_top_left, y_top_left) = (96, 10).
  (x_low_right, y_low_right) = (483, 340).
  Netlogo saves applet with width x height: 575 x 350.
  
  (x_top_left, y_top_left) = (96, 10).
  (x_low_right, y_low_right) = (396, 271).
  Netlogo saves applet with width x height: 690 x 300.
  </code></pre>
  
  <p>From these data I tried to discover a pattern in these numbers but the relation between them frankly is beyond me.</p>
  
  <p>My question is: given (x_top_left, y_top_left) and (x_low_right, y_low_right) in the Netlogo source, what should the width and height of the saved Netlogo applet be?</p>