11 * @author Richard Gradischnegg RG |
11 * @author Richard Gradischnegg RG |
12 * @version 1.1 |
12 * @version 1.1 |
13 */ |
13 */ |
14 import isac.util.BridgeMainPaths; |
14 import isac.util.BridgeMainPaths; |
15 import isac.util.FixedPortRMISocketFactory; |
15 import isac.util.FixedPortRMISocketFactory; |
16 import info.hupel.isabelle.api.*; |
16 import edu.tum.cs.isabelle.api.Configuration; |
17 import info.hupel.isabelle.japi.*; |
17 import edu.tum.cs.isabelle.api.Environment; |
18 import info.hupel.isabelle.setup.*; |
18 import edu.tum.cs.isabelle.api.Version; |
|
19 import edu.tum.cs.isabelle.japi.JPlatform; |
|
20 import edu.tum.cs.isabelle.japi.JSetup; |
|
21 import edu.tum.cs.isabelle.japi.JSystem; |
|
22 import edu.tum.cs.isabelle.setup.Setup; |
19 |
23 |
20 import java.awt.BorderLayout; |
24 import java.awt.BorderLayout; |
21 import java.awt.Color; |
25 import java.awt.Color; |
22 import java.awt.Font; |
26 import java.awt.Font; |
23 import java.awt.event.WindowAdapter; |
27 import java.awt.event.WindowAdapter; |
24 import java.awt.event.WindowEvent; |
28 import java.awt.event.WindowEvent; |
25 import java.awt.event.WindowListener; |
29 import java.awt.event.WindowListener; |
26 import java.io.BufferedReader; |
30 import java.io.BufferedReader; |
27 import java.io.IOException; |
31 import java.io.IOException; |
28 import java.io.Serializable; |
32 import java.io.Serializable; |
29 import java.nio.file.Path; |
|
30 import java.nio.file.Paths; |
33 import java.nio.file.Paths; |
31 import java.rmi.RemoteException; |
34 import java.rmi.RemoteException; |
32 import java.rmi.server.RMISocketFactory; |
35 import java.rmi.server.RMISocketFactory; |
33 import java.util.Arrays; |
|
34 |
36 |
35 import javax.swing.JFrame; |
37 import javax.swing.JFrame; |
36 import javax.swing.JPanel; |
38 import javax.swing.JPanel; |
37 import javax.swing.JScrollPane; |
39 import javax.swing.JScrollPane; |
38 import javax.swing.JTextArea; |
40 import javax.swing.JTextArea; |
78 |
80 |
79 bridge_logger_ = new BridgeLogger(log_path); |
81 bridge_logger_ = new BridgeLogger(log_path); |
80 new ClientList(); |
82 new ClientList(); |
81 setUpBridgeLog(); |
83 setUpBridgeLog(); |
82 //*TTY*/startThreadsFirstTime(); |
84 //*TTY*/startThreadsFirstTime(); |
83 /* cp from last working version: |
|
84 * https://hg.risc.uni-linz.ac.at/wneuper/isac/file/84f1ca6a6dd9/isac-java/src/java/isac/bridge/BridgeMain.java#l85 |
|
85 85 log(1, "-->ISA: try connection with ISABELLE_HOME=\"" + isabelle_home + "\"..."); |
|
86 86 Setup setup = new Setup(Paths.get(isabelle_home), JPlatform.guess(), |
|
87 87 new Version("2015"), Setup.defaultPackageName()); |
|
88 88 Environment env = JSetup.makeEnvironment(setup); // without Duration |
|
89 89 Configuration config = Configuration.fromBuiltin("libisabelle_Isac"); |
|
90 90 JSystem sys = JSystem.create(env, config); |
|
91 92 |
|
92 93 connection_to_kernel_ = sys; |
|
93 94 log(1, "<--ISA: connection established"); |
|
94 */ |
|
95 /* cp from downloaded libisabelle, current version: |
|
96 package info.hupel.isabelle.examples.java; |
|
97 |
|
98 import java.nio.file.Path; |
|
99 import java.nio.file.Paths; |
|
100 import java.util.Arrays; |
|
101 import info.hupel.isabelle.api.*; |
|
102 import info.hupel.isabelle.japi.*; |
|
103 import info.hupel.isabelle.setup.*; |
|
104 |
|
105 public class Hello_PIDE { |
|
106 |
|
107 public static void main(String args[]) { |
|
108 JResources res = JResources.dumpIsabelleResources(); |
|
109 Configuration config = Configuration.simple("Protocol"); |
|
110 Environment env = JSetup.makeEnvironment(JSetup.defaultSetup(new Version.Stable("2017")), res); |
|
111 JSystem sys = JSystem.create(env, config); |
|
112 String response = sys.invoke(Operations.HELLO, "world"); |
|
113 System.out.println(response); |
|
114 sys.dispose(); |
|
115 } |
|
116 } |
|
117 */ |
|
118 /*PIDE*/log(1, "-->ISA: try connection with ISABELLE_HOME=\"" + isabelle_home + "\"..."); |
85 /*PIDE*/log(1, "-->ISA: try connection with ISABELLE_HOME=\"" + isabelle_home + "\"..."); |
119 |
86 Setup setup = new Setup(Paths.get(isabelle_home), JPlatform.guess(), |
120 //these two values shall come from BridgeMail.properties |
87 new Version("2015"), Setup.defaultPackageName()); |
121 Path path = java.nio.file.Paths.get // |
88 Environment env = JSetup.makeEnvironment(setup); // ohne Duration |
122 ("/home/wneuper/.isabelle/isabisac/heaps/polyml-5.7.1_x86-linux/libisabelle_Isac"); |
89 Configuration config = Configuration.fromBuiltin("libisabelle_Isac"); |
123 String vers = "2018"; |
|
124 |
|
125 JResources res = JResources.dumpIsabelleResources(); |
|
126 Setup setup = new Setup(path, JPlatform.guess(), new Version.Stable(vers)); |
|
127 Environment env = JSetup.makeEnvironment(setup, res); |
|
128 //Configuration config = Configuration.fromBuiltin("libisabelle_Isac"); //fromBuiltin is undefined |
|
129 JSystem sys = JSystem.create(env, config); |
90 JSystem sys = JSystem.create(env, config); |
130 |
91 |
131 /*PIDE*/connection_to_kernel_ = sys; |
92 /*PIDE*/connection_to_kernel_ = sys; |
132 /*PIDE*/log(1, "<--ISA: connection established"); |
93 /*PIDE*/log(1, "<--ISA: connection established"); |
133 |
94 |