shoes/shoes4 — pull request #819 by KCErb (2014-07-30 14:17:47+00:00)
Title: Update image to use style

Hi all,

This one is pretty basic, no issues with the conversion.

However you'll notice that the specs don't pass because I tried to fix one minor problem unrelated to the styles issue (perhaps the wrong thing to do :) but it's so minor).

The issue I found was when I tried to give a relative file path. It should have simply thrown a [FileNotFoundException](http://docs.oracle.com/javase/7/docs/api/java/io/FileNotFoundException.html) but instead it went into some kind of loop:
```
java/lang/reflect/Constructor.java:513:in `newInstance': org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: ../static/man-ele-image.png (No such file or directory))
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/swt/image.rb:59:in `create_image'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/swt/image.rb:105:in `display_image'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/swt/image.rb:39:in `load_image'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/swt/image.rb:23:in `initialize'
from org/jruby/RubyMethod.java:132:in `call'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/configuration.rb:57:in `backend_for'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/image.rb:17:in `initialize'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/dsl.rb:192:in `create'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/dsl.rb:198:in `image'
from /Users/KC/Programming/Shoes/shoes4/local_tests/image_test.rb:2:in `(root)'
from org/jruby/RubyBasicObject.java:1533:in `instance_eval'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/internal_app.rb:136:in `execute_block'
from /Users/KC/.rvm/gems/jruby-1.7.13@shoes/gems/after_do-0.3.0/lib/after_do.rb:99:in `execute_block'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/internal_app.rb:171:in `create_execution_block'
from org/jruby/RubyProc.java:271:in `call'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/slot.rb:51:in `eval_block'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/slot.rb:64:in `append'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/internal_app.rb:165:in `eval_block'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/internal_app.rb:32:in `setup_gui'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/app.rb:48:in `initialize'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/app.rb:19:in `app'
from /Users/KC/Programming/Shoes/shoes4/local_tests/image_test.rb:1:in `(root)'
from org/jruby/RubyKernel.java:1081:in `load'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/ui/cli.rb:1:in `(root)'
from /Users/KC/Programming/Shoes/shoes4/lib/shoes/ui/cli.rb:73:in `execute_app'
from /Users/KC/Programming/Shoes/shoes4/bin/ruby-shoes:6:in `(root)'
from Users/KC/Programming/Shoes/shoes4/bin//Users/KC/Programming/Shoes/shoes4/bin/ruby-shoes:6:in `(root)'
Caused by:
FileInputStream.java:-2:in `open': java.io.FileNotFoundException: ../static/man-ele-image.png (No such file or directory)
from FileInputStream.java:120:in `'
from FileInputStream.java:79:in `'
from null:-1:in `newFileInputStream'
from null:-1:in `load'
from null:-1:in `load'
from null:-1:in `'
from null:-1:in `'
from NativeConstructorAccessorImpl.java:-2:in `newInstance0'
from NativeConstructorAccessorImpl.java:39:in `newInstance'
from DelegatingConstructorAccessorImpl.java:27:in `newInstance'
from Constructor.java:513:in `newInstance'
from JavaConstructor.java:291:in `newInstanceDirect'
from ConstructorInvoker.java:104:in `call'
from ConstructorInvoker.java:197:in `call'
from CachingCallSite.java:356:in `cacheAndCall'
from CachingCallSite.java:213:in `callBlock'
from CachingCallSite.java:217:in `call'
from ConcreteJavaProxy.java:56:in `call'
from CachingCallSite.java:211:in `callBlock'
from CachingCallSite.java:217:in `call'
from RubyClass.java:811:in `newInstance'
from RubyClass$INVOKER$i$newInstance.gen:-1:in `call'
from JavaMethod.java:314:in `call'
from ConcreteJavaProxy.java:155:in `call'
from CachingCallSite.java:346:in `cacheAndCall'
from CachingCallSite.java:204:in `call'
from CallTwoArgNode.java:59:in `interpret'
from InstAsgnNode.java:95:in `interpret'
from NewlineNode.java:105:in `interpret'
from RescueNode.java:221:in `executeBody'
from RescueNode.java:116:in `interpret'
from BeginNode.java:83:in `interpret'
from NewlineNode.java:105:in `interpret'
from BlockNode.java:71:in `interpret'
from ASTInterpreter.java:74:in `INTERPRET_METHOD'
from InterpretedMethod.java:182:in `call'
from DefaultMethod.java:198:in `call'
from CachingCallSite.java:326:in `cacheAndCall'
from CachingCallSite.java:170:in `call'
from FCallOneArgNode.java:36:in `interpret'
from NewlineNode.java:105:in `interpret'
from BlockNode.java:71:in `interpret'
from ASTInterpreter.java:74:in `INTERPRET_METHOD'
from InterpretedMethod.java:182:in `call'
from DefaultMethod.java:198:in `call'
from CachingCallSite.java:326:in `cacheAndCall'
from CachingCallSite.java:170:in `call'
from FCallOneArgNode.java:36:in `interpret'
from NewlineNode.java:105:in `interpret'
from IfNode.java:118:in `interpret'
# etc etc
```

So I tried throwing a simple `Swt::SWTException` but that didn't work (I still don't know why). So I ended up with the solution you see here but ultimately couldn't figure out how to write the spec for it.

So on the one hand I'm happy to just not try to fix this problem in this PR. But on the other hand it seems like something that should be simple (throw an exception when bad file path given) so why not include it on an otherwise innocuous PR?

Your opinions?