Skip to content

Commit

Permalink
about time we updated to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
monkstone committed Apr 24, 2017
1 parent 5c196dd commit eff5fa5
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 37 deletions.
4 changes: 2 additions & 2 deletions arcball.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ['README.md', 'LICENSE.md']
s.authors = ['Martin Prout']
s.date = %q{2016-03-13}
s.description = %q{A ArcBall in java for processing on ruby}
s.description = %q{A ArcBall in java for propane}
s.summary = %q{Provides arcball functionality to processing, from a ruby environment}
s.email = %q{martin_p@lineone.net}
s.files = ['Rakefile', 'lib/arcball.rb', 'lib/arcball.jar', 'lib/arcball/version.rb']
s.homepage = %q{http://rubygems.org/gems/arcball}
s.require_paths = ['lib']
s.add_development_dependency 'rake', '~> 10.0'
s.add_development_dependency 'rake', '~> 12'
s.platform='java'
s.rubygems_version = %q{2.5.2}
end
Binary file modified lib/arcball.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions lib/arcball/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# encoding: utf-8
# frozen_string_literal: true
module ArcBall
VERSION = '0.0.2'.freeze
VERSION = '1.0'.freeze
end
28 changes: 14 additions & 14 deletions pom.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'fileutils'
project 'arcball', 'https://github.com/ruby-processing/ArcBall' do
model_version '4.0.0'
id 'arcball:arcball', '0.0.2'
id 'arcball:arcball', '1.0.0'
packaging 'jar'
description 'arcball for arcball'
organization 'ruby-processing', 'https://ruby-processing.github.io'
Expand All @@ -11,42 +11,42 @@
roles 'developer'
end
end

issue_management 'https://github.com/monkstone/arcball/issues', 'Github'

source_control(
url: 'https://github.com/ruby-processing/ArcBall',
connection: 'scm:git:git://github.com/ruby-processing/ArcBall',
developer_connection: 'scm:git:git@github.com/ruby-processing/ArcBall.git'
)

properties('source.directory' => 'src',
'arcball.basedir' => '${project.basedir}',
'polyglot.dump.pom' => 'pom.xml',
'maven.compiler.source' => '1.7',
'maven.compiler.source' => '1.8',
'project.build.sourceEncoding' => 'utf-8',
'maven.compiler.target' => '1.7',
'maven.compiler.target' => '1.8',
'jruby.api' => 'http://jruby.org/apidocs/',
'processing.api' => 'http://processing.github.io/processing-javadocs/core/',
'jruby.api' => 'http://jruby.org/apidocs/',
)
pom('org.jruby:jruby:9.0.5.0')
jar('org.processing:core:2.2.1')

pom('org.jruby:jruby:9.1.8.0')
jar('org.processing:core:3.2.3')

plugin_management do
plugin :resources, '2.6'
plugin :dependency, '2.10'
plugin( :compiler, '3.3',

plugin( :compiler, '3.5.1',
source: '${maven.compiler.source}',
target: '${maven.compiler.target}'
)
plugin( :javadoc, '2.10.3',
plugin( :javadoc, '2.10.4',
detect_offline_links: 'false',
links: ['${jruby.api}', '${processing.api}']
)
plugin( :jar, '2.6',
plugin( :jar, '3.0.2',
archive: { manifestFile: 'MANIFEST.MF' }
)
end
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
<modelVersion>4.0.0</modelVersion>
<groupId>arcball</groupId>
<artifactId>arcball</artifactId>
<version>0.0.2</version>
<version>1.0.0</version>
<name>arcball</name>
<description>arcball for arcball</description>
<url>https://github.com/ruby-processing/ArcBall</url>
Expand Down Expand Up @@ -43,21 +43,21 @@ DO NOT MODIFIY - GENERATED CODE
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
<arcball.basedir>${project.basedir}</arcball.basedir>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.source>1.8</maven.compiler.source>
<jruby.api>http://jruby.org/apidocs/</jruby.api>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>9.0.5.0</version>
<version>9.1.8.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.processing</groupId>
<artifactId>core</artifactId>
<version>2.2.1</version>
<version>3.2.3</version>
</dependency>
</dependencies>
<build>
Expand All @@ -76,17 +76,17 @@ DO NOT MODIFIY - GENERATED CODE
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<version>3.5.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<version>2.10.4</version>
<configuration>
<detect_offline_links>false</detect_offline_links>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
<link>${jruby.api}</link>
<link>${processing.api}</link>
Expand All @@ -95,7 +95,7 @@ DO NOT MODIFIY - GENERATED CODE
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<version>3.0.2</version>
<configuration>
<archive>
<manifestFile>MANIFEST.MF</manifestFile>
Expand Down
7 changes: 2 additions & 5 deletions src/monkstone/arcball/Arcball.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ public class Arcball {
* @param radius double radius of arcball
*/
public Arcball(PApplet parent, double center_x, double center_y, double radius) {
this.zoomWheelHandler = new WheelHandler() {
@Override
public void handleWheel(int delta) {
zoom += delta * 0.05;
}
this.zoomWheelHandler = (int delta) -> {
zoom += delta * 0.05;
};
this.parent = parent;
this.center_x = center_x;
Expand Down
17 changes: 12 additions & 5 deletions src/monkstone/arcball/Rarcball.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyFloat;
import org.jruby.RubyFixnum;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
import org.jruby.RubySymbol;
Expand Down Expand Up @@ -69,15 +71,20 @@ public static void init(ThreadContext context, IRubyObject self, IRubyObject arg
int count = Arity.checkArgumentCount(context.getRuntime(), args, 1, 4);
if (count == 4) {
PApplet parent = (PApplet) args[0].toJava(PApplet.class);
double cx = (double) args[1].toJava(Double.class);
double cy = (double) args[2].toJava(Double.class);
double radius = (double) args[3].toJava(Double.class);
double cx = (args[1] instanceof RubyFloat)
? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
double cy = (args[2] instanceof RubyFloat)
? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
double radius = (args[3] instanceof RubyFloat)
? ((RubyFloat) args[3]).getValue() : ((RubyFixnum) args[3]).getDoubleValue();
new Arcball(parent, cx, cy, radius).setActive(true);
}
if (count == 3) {
PApplet parent = (PApplet) args[0].toJava(PApplet.class);
double cx = (double) args[1].toJava(Double.class);
double cy = (double) args[2].toJava(Double.class);
double cx = (args[1] instanceof RubyFloat)
? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
double cy = (args[2] instanceof RubyFloat)
? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
new Arcball(parent, cx, cy, parent.width * 0.8f).setActive(true);
}
if (count == 1) {
Expand Down

0 comments on commit eff5fa5

Please sign in to comment.