*** empty log message ***
authorcg
Sun, 31 Dec 2000 12:27:50 +0000
changeset 706 ddadb8eb2297
parent 705 3919d07d0a02
child 707 aa9b0bb5cafd
*** empty log message ***
Java.st
JavaVM.st
--- a/Java.st	Mon Dec 18 22:12:09 2000 +0000
+++ b/Java.st	Sun Dec 31 12:27:50 2000 +0000
@@ -324,6 +324,8 @@
      jHome jClasses jSources mozillaHome tryNetscape4_0
      tryMS tryBorland tryVA tryJRE1_1 fn d classPath|
 
+    JavaNativeMethod flushAllCachedNativeMethods.
+
     InternedStrings := Dictionary new.
     FailedToLoadClasses := nil.
     classPath := OperatingSystem getEnvironment:'CLASSPATH'.
@@ -400,10 +402,10 @@
 "/    tryMS := true.              "/ MS-java; not really working
 "/    tryBorland := true.         "/ borland jbuilder-java; not really working
 
-    tryJDK1_18 := true.       "/ standard sun jdk's - work more or less
-    tryJDK1_17 := true.       
-    tryJDK1_16 := true.       
-    tryJDK1_15 := true.
+"/    tryJDK1_18 := true.       "/ standard sun jdk's - work more or less
+"/    tryJDK1_17 := true.       
+"/    tryJDK1_16 := true.       
+"/    tryJDK1_15 := true.
     tryJDK1_13 := true.
     tryJDK1_11 := true.
 "/    tryJDK1_03 := true.
@@ -1541,6 +1543,6 @@
 !Java class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/Java.st,v 1.128 2000/12/18 22:12:09 cg Exp $'
+    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/Java.st,v 1.129 2000/12/31 12:27:28 cg Exp $'
 ! !
 Java initialize!
--- a/JavaVM.st	Mon Dec 18 22:12:09 2000 +0000
+++ b/JavaVM.st	Sun Dec 31 12:27:50 2000 +0000
@@ -1681,6 +1681,7 @@
     "/ otherwise, class-inits would not be called
     "/ by resolver ... (sigh)
 
+    JavaNativeMethod flushAllCachedNativeMethods.
     JavaMethod allSubInstancesDo:[:m |
         m checked:false.
         m code:nil.
@@ -2544,6 +2545,26 @@
     "Modified: / 5.12.1998 / 13:47:52 / cg"
 !
 
+replacementFontFor:name style:styleNr size:size
+    |font family style|
+
+    style := 'roman'.
+    styleNr = 0 ifTrue:[
+        style := 'roman'
+    ].
+
+    font := Font family:name style:style size:size.
+    font notNil ifTrue:[^ font].
+
+    name = 'Dialog' ifTrue:[
+        family := 'helvetica'
+    ] ifFalse:[
+        family := 'courier'
+    ].
+
+    ^ Font family:name style:style size:size.
+!
+
 topViewsMenu:view
     |idx|
 
@@ -8391,17 +8412,21 @@
 !
 
 _MComponentPeer_pSetFont:nativeContext
-    |view jFont stFont |
+    |view jFont stFont name style size|
 
     view := self viewForWPeer:nativeContext.
     jFont := nativeContext argAt:1.
 
     stFont := jFont instVarNamed:'pData'.
     (stFont isNil or:[stFont == 0]) ifTrue:[
-self halt.
-    ] ifFalse:[
-        view font:stFont
-    ].
+        name := jFont instVarNamed:'name'.
+        style := jFont instVarNamed:'style'.
+        size := jFont instVarNamed:'size'.
+
+        stFont := self replacementFontFor:(Java as_ST_String:name) style:style size:size.
+        jFont instVarNamed:'pData' put:stFont.
+    ].
+    view font:stFont.
 
     ^ nil
 !
@@ -12822,6 +12847,6 @@
 !JavaVM class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.179 2000/12/18 22:11:53 cg Exp $'
+    ^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaVM.st,v 1.180 2000/12/31 12:27:50 cg Exp $'
 ! !
 JavaVM initialize!