Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

backported from java1.6 to java1.5 - should run on 1.5 JVMs now

  • Loading branch information...
commit 4d0dcb01f2a6a9a9b25d3c74b98da66b6c9ff4c8 1 parent d4a9153
danbernier authored
View
2  .classpath
@@ -3,10 +3,10 @@
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry excluding="**/.svn/*" kind="src" path="ideExample"/>
<classpathentry excluding="**/.svn/*" kind="src" path="test"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/processing/core.jar"/>
<classpathentry kind="lib" path="lib/junit/junit-4.8.2.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.3.3.jar"/>
<classpathentry kind="lib" path="lib/mockito-all-1.8.5.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK 1.5"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
8 .settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,12 @@
-#Sat Oct 03 12:26:23 EDT 2009
+#Sun Feb 13 12:59:12 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.5
View
2  build.xml
@@ -48,7 +48,7 @@ svnant task: http://subclipse.tigris.org/svnant/svn.html
<target name="test" depends="compile">
<mkdir dir="build/tests" />
- <javac srcdir="test" destdir="build/tests" classpath="${classpath};lib/junit/junit-4.8.2.jar;lib/mockito-all-1.8.5.jar;build/classes" includeantruntime="false" />
+ <javac srcdir="test" destdir="build/tests" classpath="${classpath};lib/junit/junit-4.8.2.jar;lib/mockito-all-1.8.5.jar;build/classes" source="1.5" target="1.5" includeantruntime="false" />
<junit dir="build/tests" haltonfailure="true">
<classpath path="${classpath};lib/junit/junit-4.8.2.jar;lib/mockito-all-1.8.5.jar;build/classes;build/tests" />
<formatter type="brief" usefile="false" />
View
1  src/wordcram/PlottingWordNudger.java
@@ -29,7 +29,6 @@ public PlottingWordNudger(PApplet _parent, WordNudger _wrappedNudger) {
wrappedNudger = _wrappedNudger;
}
- @Override
public PVector nudgeFor(Word word, int attempt) {
PVector v = wrappedNudger.nudgeFor(word, attempt);
parent.pushStyle();
View
1  src/wordcram/PlottingWordPlacer.java
@@ -28,7 +28,6 @@ public PlottingWordPlacer(PApplet _parent, WordPlacer _wrappedPlacer) {
wrappedPlacer = _wrappedPlacer;
}
- @Override
public PVector place(Word word, int wordIndex, int wordsCount, int wordImageWidth, int wordImageHeight, int fieldWidth, int fieldHeight) {
PVector v = wrappedPlacer.place(word, wordIndex, wordsCount, wordImageWidth, wordImageHeight, fieldWidth, fieldHeight);
parent.pushStyle();
View
1  src/wordcram/RandomWordNudger.java
@@ -47,7 +47,6 @@ public RandomWordNudger(float stdDev) {
this.stdDev = stdDev;
}
- @Override
public PVector nudgeFor(Word w, int attempt) {
return new PVector(next(attempt), next(attempt));
}
View
1  src/wordcram/SpiralWordNudger.java
@@ -25,7 +25,6 @@
// bigger fonts need a bigger thetaIncrement.
private float thetaIncrement = (float) (Math.PI * 0.03);
- @Override
public PVector nudgeFor(Word w, int attempt) {
float rad = powerMap(0.6f, attempt, 0, 600, 1, 100);
View
1  src/wordcram/SwirlWordPlacer.java
@@ -20,7 +20,6 @@
public class SwirlWordPlacer implements WordPlacer {
- @Override
public PVector place(Word word, int wordIndex, int wordsCount,
int wordImageWidth, int wordImageHeight, int fieldWidth,
int fieldHeight) {
View
1  src/wordcram/UpperLeftWordPlacer.java
@@ -25,7 +25,6 @@
private Random r = new Random();
- @Override
public PVector place(Word word, int wordIndex, int wordsCount, int wordImageWidth, int wordImageHeight, int fieldWidth, int fieldHeight) {
int x = getOneUnder(fieldWidth - wordImageWidth);
int y = getOneUnder(fieldHeight - wordImageHeight);
View
1  src/wordcram/WaveWordPlacer.java
@@ -20,7 +20,6 @@
public class WaveWordPlacer implements WordPlacer, PConstants {
- @Override
public PVector place(Word word, int wordIndex, int wordsCount,
int wordImageWidth, int wordImageHeight, int fieldWidth,
int fieldHeight) {
View
1  src/wordcram/Word.java
@@ -260,7 +260,6 @@ public String toString() {
/**
* Compares Words based on weight only. Words with equal weight are arbitrarily sorted.
*/
- @Override
public int compareTo(Word w) {
if (w.weight < weight) {
return -1;
View
5 src/wordcram/WordCramEngine.java
@@ -17,8 +17,7 @@
*/
import java.awt.*;
-import java.awt.geom.Path2D;
-import java.awt.geom.Rectangle2D;
+import java.awt.geom.*;
import java.util.ArrayList;
import processing.core.*;
@@ -196,7 +195,7 @@ private int calculateMaxAttemptsFromWordWeight(Word word) {
}
private void drawWordImage(EngineWord word) {
- Path2D.Float path2d = new Path2D.Float(word.getShape());
+ GeneralPath path2d = new GeneralPath(word.getShape());
Graphics2D g2 = (Graphics2D)destination.image.getGraphics();
View
13 src/wordcram/WordSorterAndScaler.java
@@ -24,7 +24,7 @@
public Word[] sortAndScale(Word[] rawWords) {
- Word[] words = Arrays.copyOf(rawWords, rawWords.length);
+ Word[] words = copy(rawWords);
Arrays.sort(words);
double maxWeight = words[0].weight;
@@ -34,4 +34,15 @@
return words;
}
+
+ private Word[] copy(Word[] rawWords) {
+
+ // was Arrays.copyOf(rawWords, rawWords.length);
+
+ Word[] copy = new Word[rawWords.length];
+ for(int i = 0; i < copy.length; i++) {
+ copy[i] = rawWords[i];
+ }
+ return copy;
+ }
}
View
1  src/wordcram/text/Html.java
@@ -24,7 +24,6 @@ public Html(String htmlSrc) {
src = htmlSrc;
}
- @Override
public String getText() {
return new Html2Text().text(src);
}
View
1  src/wordcram/text/Text.java
@@ -24,7 +24,6 @@ public Text(String _text) {
text = _text;
}
- @Override
public String getText() {
return text;
}
View
1  src/wordcram/text/TextFile.java
@@ -31,7 +31,6 @@ public TextFile(String path, PApplet parent) {
this.parent = parent;
}
- @Override
public String getText() {
return PApplet.join(parent.loadStrings(path), ' ');
}
View
1  src/wordcram/text/WebPage.java
@@ -28,7 +28,6 @@ public WebPage(String url, PApplet parent) {
this.parent = parent;
}
- @Override
public String getText() {
String html = PApplet.join(parent.loadStrings(url), ' ');
return new Html2Text().text(html);
View
2  test/wordcram/AWordCramEngine.java
@@ -7,8 +7,6 @@
import java.util.LinkedList;
import java.util.List;
-import javax.xml.ws.ServiceMode;
-
import junit.framework.Assert;
import org.junit.Before;
Please sign in to comment.
Something went wrong with that request. Please try again.