Permalink
Browse files

issue-36: Create branch 11.0.0

- Source/Target compatibility bumped to 1.9
- Core can be used as dependency on any project with Java 9, 10, 11
- Sampler runs standalone in JDK: 9, 10, 11
- Added Launcher class to Sampler to allow running via shadow jar
- Remove private API
  • Loading branch information...
jose.pereda
jose.pereda committed Oct 6, 2018
1 parent 7957be6 commit edbfff17cce90d2c2d264bb960fa4c3880a13b41
@@ -8,7 +8,7 @@ buildscript {
}
plugins {
id 'com.github.hierynomus.license' version '0.13.1'
//id 'com.github.hierynomus.license' version '0.13.1'
id 'maven-publish'
id 'net.nemerosa.versioning' version '2.6.1'
id 'com.jfrog.bintray' version '1.7.2'
@@ -25,37 +25,23 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransf
version = fxyz_sampler_version
apply plugin: 'com.github.johnrengelman.shadow'
configurations {
//samples.extendsFrom mainRuntime
jdk
}
sourceSets {
main {
compileClasspath += configurations.jdk
}
}
if (!hasProperty('mainClass')) {
ext.mainClass = 'org.fxyz3d.client.FXyzClient'
}
dependencies {
compile 'org.controlsfx:controlsfx:8.40.14'
compile 'org.reactfx:reactfx:2.0-M5'
try {
jdk files(jfxrtJar)
} catch (MissingPropertyException pne) {
jdk files("${System.properties['java.home']}/lib/jfxrt.jar")
jdk files("${System.properties['java.home']}/lib/ext/jfxrt.jar")
if (JavaVersion.current().isJava9Compatible()) {
compile 'org.controlsfx:controlsfx:9.0.0'
} else {
compile 'org.controlsfx:controlsfx:8.40.14'
}
compile 'org.reactfx:reactfx:2.0-M5'
}
javadoc {
exclude 'impl/*'
failOnError = false
classpath = project.sourceSets.main.runtimeClasspath + configurations.jdk
classpath = project.sourceSets.main.runtimeClasspath
options.windowTitle("FXSampler Project ${version}")
options.links("http://docs.oracle.com/javase/8/docs/api/");
@@ -45,7 +45,8 @@ jar {
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
'Implementation-Version': project.version,
'Automatic-Module-Name' : "org.fxyz3d.client"
)
}
}
@@ -1,5 +1,5 @@
plugins {
id 'com.github.hierynomus.license' version '0.13.1'
//id 'com.github.hierynomus.license' version '0.13.1'
id 'maven-publish'
id 'net.nemerosa.versioning' version '2.6.1'
id 'com.jfrog.bintray' version '1.7.2'
@@ -45,7 +45,8 @@ jar {
'Specification-Title': project.name,
'Specification-Version': project.version,
'Implementation-Title': project.name,
'Implementation-Version': project.version
'Implementation-Version': project.version,
'Automatic-Module-Name' : "org.fxyz3d.core"
)
}
}
@@ -0,0 +1,256 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
* - Neither the name of Oracle Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.fxyz3d.utils;
/**
* A 3-dimensional, double-precision, floating-point vector.
*/
public class Vec3d {
/**
* The x coordinate.
*/
public double x;
/**
* The y coordinate.
*/
public double y;
/**
* The z coordinate.
*/
public double z;
public Vec3d() {
}
public Vec3d(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
public Vec3d(Vec3d v) {
set(v);
}
public Vec3d(Vec3f v) {
set(v);
}
public void set(Vec3f v) {
this.x = v.x;
this.y = v.y;
this.z = v.z;
}
public void set(Vec3d v) {
this.x = v.x;
this.y = v.y;
this.z = v.z;
}
public void set(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
/**
* Multiplies this vector by the specified scalar value.
*
* @param scale the scalar value
*/
public void mul(double scale) {
x *= scale;
y *= scale;
z *= scale;
}
/**
* Sets the value of this vector to the difference
* of vectors t1 and t2 (this = t1 - t2).
*
* @param t1 the first vector
* @param t2 the second vector
*/
public void sub(Vec3f t1, Vec3f t2) {
this.x = t1.x - t2.x;
this.y = t1.y - t2.y;
this.z = t1.z - t2.z;
}
/**
* Sets the value of this vector to the difference
* of vectors t1 and t2 (this = t1 - t2).
*
* @param t1 the first vector
* @param t2 the second vector
*/
public void sub(Vec3d t1, Vec3d t2) {
this.x = t1.x - t2.x;
this.y = t1.y - t2.y;
this.z = t1.z - t2.z;
}
/**
* Sets the value of this vector to the difference of
* itself and vector t1 (this = this - t1) .
*
* @param t1 the other vector
*/
public void sub(Vec3d t1) {
this.x -= t1.x;
this.y -= t1.y;
this.z -= t1.z;
}
/**
* Sets the value of this vector to the sum
* of vectors t1 and t2 (this = t1 + t2).
*
* @param t1 the first vector
* @param t2 the second vector
*/
public void add(Vec3d t1, Vec3d t2) {
this.x = t1.x + t2.x;
this.y = t1.y + t2.y;
this.z = t1.z + t2.z;
}
/**
* Sets the value of this vector to the sum of
* itself and vector t1 (this = this + t1) .
*
* @param t1 the other vector
*/
public void add(Vec3d t1) {
this.x += t1.x;
this.y += t1.y;
this.z += t1.z;
}
/**
* Returns the length of this vector.
*
* @return the length of this vector
*/
public double length() {
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
}
/**
* Normalize this vector.
*/
public void normalize() {
double norm = 1.0 / length();
this.x = this.x * norm;
this.y = this.y * norm;
this.z = this.z * norm;
}
/**
* Sets this vector to be the vector cross product of vectors v1 and v2.
*
* @param v1 the first vector
* @param v2 the second vector
*/
public void cross(Vec3d v1, Vec3d v2) {
double tmpX;
double tmpY;
tmpX = v1.y * v2.z - v1.z * v2.y;
tmpY = v2.x * v1.z - v2.z * v1.x;
this.z = v1.x * v2.y - v1.y * v2.x;
this.x = tmpX;
this.y = tmpY;
}
/**
* Computes the dot product of this vector and vector v1.
*
* @param v1 the other vector
* @return the dot product of this vector and v1
*/
public double dot(Vec3d v1) {
return this.x * v1.x + this.y * v1.y + this.z * v1.z;
}
/**
* Returns the hashcode for this <code>Vec3f</code>.
*
* @return a hash code for this <code>Vec3f</code>.
*/
@Override
public int hashCode() {
long bits = 7L;
bits = 31L * bits + Double.doubleToLongBits(x);
bits = 31L * bits + Double.doubleToLongBits(y);
bits = 31L * bits + Double.doubleToLongBits(z);
return (int) (bits ^ (bits >> 32));
}
/**
* Determines whether or not two 3D points or vectors are equal.
* Two instances of <code>Vec3d</code> are equal if the values of their
* <code>x</code>, <code>y</code> and <code>z</code> member fields,
* representing their position in the coordinate space, are the same.
*
* @param obj an object to be compared with this <code>Vec3d</code>
* @return <code>true</code> if the object to be compared is
* an instance of <code>Vec3d</code> and has
* the same values; <code>false</code> otherwise.
*/
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof Vec3d) {
Vec3d v = (Vec3d) obj;
return (x == v.x) && (y == v.y) && (z == v.z);
}
return false;
}
/**
* Returns a <code>String</code> that represents the value
* of this <code>Vec3f</code>.
*
* @return a string representation of this <code>Vec3f</code>.
*/
@Override
public String toString() {
return "Vec3d[" + x + ", " + y + ", " + z + "]";
}
}
Oops, something went wrong.

0 comments on commit edbfff1

Please sign in to comment.