Changeset 2076 for trunk/lang
- Timestamp:
- Jan 31, 2011, 3:06:56 PM (14 years ago)
- Location:
- trunk/lang/java
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lang/java/Library.java
r1753 r2076 100 100 } 101 101 102 public String xml(){ 103 return jRpXml(libPtr); 104 } 105 102 106 103 107 // Native Functions---------------------------------------------------------- … … 118 122 119 123 private native void jRpResult(long libPtr, int exitStatus); 124 private native String jRpXml(long libPtr); 120 125 121 126 // Private Attributes-------------------------------------------------------- -
trunk/lang/java/Units.java
r1753 r2076 23 23 } 24 24 25 public static String convert(String fromVal, String to, boolean units){ 25 // Public Methods------------------------------------------------------------ 26 public static double convertDouble(double fromVal, String to){ 27 return Double.parseDouble( 28 jRpUnitsConvert(Double.toString(fromVal), to, false)); 29 } 30 31 public static String convertString(String fromVal, String to, boolean units){ 26 32 return jRpUnitsConvert(fromVal, to, units); 27 33 } 28 34 29 public static String convert (String fromVal, String to){35 public static String convertString(String fromVal, String to){ 30 36 return jRpUnitsConvert(fromVal, to, true); 31 37 } 32 38 33 private static native String jRpUnitsConvert(String fromVal, String to, boolean units); 39 // Native Functions---------------------------------------------------------- 40 private static native String jRpUnitsConvert(String fromVal, String to, 41 boolean units); 34 42 } 35 43 -
trunk/lang/java/Utils.java
r1732 r2076 26 26 } 27 27 28 public static void progress(int percent){ 29 jRpUtilsProgress(percent, ""); 30 } 31 28 32 private static native void jRpUtilsProgress(int percent, String text); 29 33 -
trunk/lang/java/jRpLibrary.cc
r1753 r2076 145 145 } 146 146 147 // xml 148 JNIEXPORT jstring JNICALL Java_rappture_Library_jRpXml 149 (JNIEnv *env, jobject obj, jlong libPtr) { 150 std::string retStr = ((RpLibrary*)libPtr)->xml(); 151 return(env->NewStringUTF(retStr.c_str())); 152 } 153 -
trunk/lang/java/jRpUnits.cc
r1753 r2076 17 17 #include "rappture.h" 18 18 19 // convert 19 // convertString 20 20 JNIEXPORT jstring JNICALL Java_rappture_Units_jRpUnitsConvert 21 21 (JNIEnv *env, jclass cls, jstring javaFromVal, jstring javaTo, jboolean units){ … … 34 34 ex = env->FindClass("java/lang/RuntimeException"); 35 35 if (ex){ 36 errorMsg = "C onnot convert ";36 errorMsg = "Cannot convert "; 37 37 errorMsg += nativeFromVal; 38 38 errorMsg += " to ";
Note: See TracChangeset
for help on using the changeset viewer.