| author | blanchet |
| Mon, 05 Oct 2015 23:03:50 +0200 | |
| changeset 61330 | 20af2ad9261e |
| parent 60074 | 38a64cc17403 |
| child 66205 | e9fa94f43a15 |
| permissions | -rw-r--r-- |
|
43282
5d294220ca43
moved sources -- eliminated Netbeans artifact of jedit package directory;
wenzelm
parents:
39588
diff
changeset
|
1 |
/* Title: Tools/jEdit/src/protocol_dockable.scala |
| 36760 | 2 |
Author: Makarius |
3 |
||
| 37067 | 4 |
Dockable window for protocol messages. |
| 36760 | 5 |
*/ |
| 34408 | 6 |
|
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
7 |
package isabelle.jedit |
|
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
8 |
|
|
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
9 |
|
| 36015 | 10 |
import isabelle._ |
11 |
||
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
12 |
import java.awt.BorderLayout |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
13 |
|
| 37067 | 14 |
import scala.swing.{TextArea, ScrollPane}
|
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
15 |
|
|
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
16 |
import org.gjt.sp.jedit.View |
| 34424 | 17 |
|
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
18 |
|
| 37067 | 19 |
class Protocol_Dockable(view: View, position: String) extends Dockable(view, position) |
| 34760 | 20 |
{
|
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
21 |
/* controls */ |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
22 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
23 |
private val ml_stats = new Isabelle.ML_Stats |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
24 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
25 |
private val controls = new Wrap_Panel(Wrap_Panel.Alignment.Right)(ml_stats) |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
26 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
27 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
28 |
/* text area */ |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
29 |
|
| 37067 | 30 |
private val text_area = new TextArea |
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
31 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
32 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
33 |
/* layout */ |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
34 |
|
| 37067 | 35 |
set_content(new ScrollPane(text_area)) |
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
36 |
add(controls.peer, BorderLayout.NORTH) |
| 34772 | 37 |
|
38 |
||
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56391
diff
changeset
|
39 |
/* main */ |
| 34671 | 40 |
|
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56391
diff
changeset
|
41 |
private val main = |
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
42 |
Session.Consumer[Any](getClass.getName) {
|
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56391
diff
changeset
|
43 |
case input: Prover.Input => |
|
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
56715
diff
changeset
|
44 |
GUI_Thread.later { text_area.append(input.toString + "\n\n") }
|
|
43721
fad8634cee62
echo prover input via raw_messages, for improved protocol tracing;
wenzelm
parents:
43520
diff
changeset
|
45 |
|
|
56715
52125652e82a
clarified Session.Consumer, with Session.Outlet managed by dispatcher thread;
wenzelm
parents:
56391
diff
changeset
|
46 |
case output: Prover.Output => |
|
57612
990ffb84489b
clarified module name: facilitate alternative GUI frameworks;
wenzelm
parents:
56715
diff
changeset
|
47 |
GUI_Thread.later { text_area.append(output.message.toString + "\n\n") }
|
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
48 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
49 |
case _: Session.Global_Options => |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
50 |
GUI_Thread.later { ml_stats.load() }
|
| 34772 | 51 |
} |
52 |
||
|
60074
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
53 |
override def init() |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
54 |
{
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
55 |
PIDE.session.all_messages += main |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
56 |
PIDE.session.global_options += main |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
57 |
} |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
58 |
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
59 |
override def exit() |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
60 |
{
|
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
61 |
PIDE.session.all_messages -= main |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
62 |
PIDE.session.global_options -= main |
|
38a64cc17403
GUI controls for ML_statistics, for more digestible protocol dump;
wenzelm
parents:
57612
diff
changeset
|
63 |
} |
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
64 |
} |