Skip to content

Commit

Permalink
removing justification from applet description.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Nov 18, 2010
1 parent 34295f0 commit 2170bb7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
17 changes: 8 additions & 9 deletions lib/templates/applet/index.html.erb
Expand Up @@ -32,7 +32,7 @@
#the_applet {
margin: 0 auto;
width: <%= @width.to_i %>px;
padding: 6px;
padding: 6px;
padding-top: 7px; padding-bottom: 2px;
background: #262626 url(images/top.png) top left repeat-x;
border: 1px solid #363636; border-top: 0;
Expand All @@ -48,7 +48,6 @@
width: <%= [@width.to_i, 200].max - 16 %>px;
padding: 7px 15px 7px 15px;
background: #111;
text-align: justify;
margin: 0 auto;
margin-top: 30px; margin-bottom: 10px;
border: 1px solid #363636;
Expand All @@ -65,15 +64,15 @@

<body>
<div id="container">

<div id="the_applet">
<object
type="application/x-java-applet"
code="<%= @starting_class %>"
codebase="."
style="margin: 0; padding: 0;"
width="<%= @width %>" height="<%= @height %>">

<param name="archive" value="<%= @file_list %>" />
<param name="jruby.eval" value="ARGV[0] = '<%= @main_file %>'; require 'ruby-processing/runners/run.rb'" />
<param name="image" value="images/ruby.jpg" />
Expand All @@ -82,33 +81,33 @@
<param name="mayscript" value="true" />
<param name="scriptable" value="true" />
<param name="progressbar" value="true" />

<% if @opengl %>
<param name="codebase_lookup" value="false" />
<param name="subapplet.classname" value="org.jruby.JRubyApplet" />
<param name="subapplet.displayname" value="<%= @title %>" />
<% end %>

<!-- And if you don't have java. -->
To view this content, you need to install Java from <a href="http://java.com">java.com</a>
</object>
</div>

<div id="built_with">
<a href="http://wiki.github.com/jashkenas/ruby-processing">
<img src="images/built_with.jpg" alt="Ruby-Processing" />
</a>
Via <a href="http://jruby.codehaus.org/">JRuby</a> and <a href="http://processing.org/">Processing</a><br />
Source: <a href="<%= @main_file %>"><%= @main_file %></a>
</div>

<% if @description && !@description.empty? %>
<div id="description">
<h1><%= @title %></h1>
<p><%= @description %></p>
</div>
<% end %>

</div>
</body>
</html>
14 changes: 7 additions & 7 deletions samples/contributed/empathy.rb
Expand Up @@ -2,7 +2,7 @@
# original by Kyle McDonald
# http://www.openprocessing.org/visuals/?visualID=1182

# This sketch takes advantage of multiple processors by running calculations
# This sketch takes advantage of multiple processors by running calculations
# in a separate thread.

CELL_COUNT = 5000
Expand All @@ -11,7 +11,7 @@
LINE_LENGTH = 37
MULTI_THREADED = true

def setup
def setup
size(500, 500, P3D)
stroke(0, 0, 0, 25)
initialize_cells
Expand Down Expand Up @@ -46,28 +46,28 @@ def mouse_pressed
end

class Cell

def initialize(x, y)
@x, @y = x, y
@spin = 0
@angle = 0
end

def reset
@spin, @angle = 0, 0
end

def update
det = ((pmouse_x-@x) * (mouse_y-@y) - (mouse_x-@x) * (pmouse_y-@y)).to_f
@spin += ROTATION * det / dist(@x, @y, mouse_x, mouse_y).to_f
@spin *= SLOW_DOWN
@angle += @spin
end

def sense
update unless MULTI_THREADED
d = LINE_LENGTH * @spin + 0.001
line(@x, @y, @x + d * Math.cos(@angle), @y + d * Math.sin(@angle))
end

end

0 comments on commit 2170bb7

Please sign in to comment.