aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/cycling74/max
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-07-19 15:56:13 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2009-07-19 15:56:13 +0000
commit5d63b1b2a6968f9c0146e1946b72ca6073370fbe (patch)
treed8c9ef35e0f68c95aac11ebd1decd345ba1f82a8 /src/java/com/cycling74/max
parent0f770551cebca90c92b7a39b0e0135a445af51f9 (diff)
svn path=/trunk/externals/loaders/pdj/; revision=11874
Diffstat (limited to 'src/java/com/cycling74/max')
-rw-r--r--src/java/com/cycling74/max/Callback.java22
-rw-r--r--src/java/com/cycling74/max/MaxObject.java2
-rw-r--r--src/java/com/cycling74/max/MaxSystem.java6
-rw-r--r--src/java/com/cycling74/max/package.html2
4 files changed, 21 insertions, 11 deletions
diff --git a/src/java/com/cycling74/max/Callback.java b/src/java/com/cycling74/max/Callback.java
index 1eed30f..14d4848 100644
--- a/src/java/com/cycling74/max/Callback.java
+++ b/src/java/com/cycling74/max/Callback.java
@@ -130,6 +130,7 @@ public class Callback implements Executable {
try {
method.invoke(obj, args);
} catch (IllegalArgumentException e) {
+ e.printStackTrace();
MaxSystem.error("pdj: IllegalArgumentException:" + e);
} catch (IllegalAccessException e) {
MaxSystem.error("pdj: IllegalAccessException:" + e);
@@ -144,7 +145,7 @@ public class Callback implements Executable {
* @return the array of arguments
*/
public Object[] getArgs() {
- return args;
+ return (Object[]) args[0];
}
/**
@@ -176,7 +177,7 @@ public class Callback implements Executable {
* @param i int value
*/
public void setArgs(int i) {
- args = new Object[] { new Integer(i) };
+ setSubArgs(new Object[] { new Integer(i) });
}
/**
@@ -184,7 +185,7 @@ public class Callback implements Executable {
* @param f float argument
*/
public void setArgs(float f) {
- args = new Object[] { new Float(f) };
+ setSubArgs(new Object[] { new Float(f) });
}
/**
@@ -192,7 +193,7 @@ public class Callback implements Executable {
* @param value int value
*/
public void setArgs(String value) {
- args = new Object[] { value };
+ setSubArgs(new Object[] { value });
}
/**
@@ -200,7 +201,7 @@ public class Callback implements Executable {
* @param flag boolean value
*/
public void setArgs(boolean flag) {
- args = new Object[] { flag ? Boolean.TRUE : Boolean.FALSE };
+ setSubArgs(new Object[] { flag ? Boolean.TRUE : Boolean.FALSE });
}
/**
@@ -208,6 +209,15 @@ public class Callback implements Executable {
* @param args the array object to pass to the method
*/
public void setArgs(Object args[]) {
- this.args = (Object[]) args.clone();
+ setSubArgs((Object[]) args.clone());
+ }
+
+ /**
+ * Fix for <1.5 method.invoke.
+ * @param args
+ */
+ private void setSubArgs(Object args[]) {
+ this.args = new Object[1];
+ this.args[0] = args;
}
}
diff --git a/src/java/com/cycling74/max/MaxObject.java b/src/java/com/cycling74/max/MaxObject.java
index 15f2a16..5b93bc3 100644
--- a/src/java/com/cycling74/max/MaxObject.java
+++ b/src/java/com/cycling74/max/MaxObject.java
@@ -863,7 +863,7 @@ public class MaxObject {
} catch (NoSuchMethodException e) {
try {
Constructor c = clz.getConstructor(argType);
- obj = (MaxObject) c.newInstance(new Object[0]);
+ obj = (MaxObject) c.newInstance((Object[]) new Object[0]);
} catch ( Exception e1 ) {
popPdjPointer();
throw e1;
diff --git a/src/java/com/cycling74/max/MaxSystem.java b/src/java/com/cycling74/max/MaxSystem.java
index dd8fe48..cdecb0b 100644
--- a/src/java/com/cycling74/max/MaxSystem.java
+++ b/src/java/com/cycling74/max/MaxSystem.java
@@ -146,8 +146,8 @@ public class MaxSystem {
int ret[] = new int[3];
ret[0] = 0;
- ret[1] = 99;
- ret[2] = 0;
+ ret[1] = 8;
+ ret[2] = 5;
return ret;
}
@@ -171,7 +171,7 @@ public class MaxSystem {
}
// constants
- public static String MXJ_VERSION = "pdj 0.8.4";
+ public static String MXJ_VERSION = "pdj 0.8.5";
public static final int PATH_STYLE_COLON = 2;
public static final int PATH_STYLE_MAX = 0;
diff --git a/src/java/com/cycling74/max/package.html b/src/java/com/cycling74/max/package.html
index dcd23c3..1df006d 100644
--- a/src/java/com/cycling74/max/package.html
+++ b/src/java/com/cycling74/max/package.html
@@ -1,5 +1,5 @@
<html>
<body>
-<p>Basic package for PDJ</p>
+<p>Basic package for PDJ.</p>
</body>
</html> \ No newline at end of file