author | wenzelm |
Fri, 02 Jan 2015 21:19:34 +0100 | |
changeset 59240 | e411afcfaa29 |
parent 59236 | 346aada8eb53 |
child 59241 | 541b95e94dc7 |
permissions | -rw-r--r-- |
59202 | 1 |
/* Title: Tools/Graphview/visualizer.scala |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
2 |
Author: Markus Kaiser, TU Muenchen |
59240 | 3 |
Author: Makarius |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
4 |
|
50475 | 5 |
Graph visualization parameters and interface state. |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
6 |
*/ |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
7 |
|
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
8 |
package isabelle.graphview |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
9 |
|
50464 | 10 |
|
49565
ea4308b7ef0f
ML support for generic graph display, with browser and graphview backends (via print modes);
wenzelm
parents:
49557
diff
changeset
|
11 |
import isabelle._ |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
12 |
|
59220 | 13 |
import java.awt.{Font, FontMetrics, Color, Shape, RenderingHints, Graphics2D} |
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
14 |
import java.awt.font.FontRenderContext |
50476
1cb983bccb5b
more official graphics context with font metrics;
wenzelm
parents:
50475
diff
changeset
|
15 |
import java.awt.image.BufferedImage |
49729 | 16 |
import javax.swing.JComponent |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
17 |
|
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
18 |
|
50465 | 19 |
class Visualizer(val model: Model) |
20 |
{ |
|
50472
bad1a1ca61e1
separate instance of class Parameters for each Main_Panel -- avoid global program state;
wenzelm
parents:
50471
diff
changeset
|
21 |
visualizer => |
bad1a1ca61e1
separate instance of class Parameters for each Main_Panel -- avoid global program state;
wenzelm
parents:
50471
diff
changeset
|
22 |
|
50476
1cb983bccb5b
more official graphics context with font metrics;
wenzelm
parents:
50475
diff
changeset
|
23 |
|
59233 | 24 |
/* tooltips */ |
25 |
||
26 |
def make_tooltip(parent: JComponent, x: Int, y: Int, body: XML.Body): String = null |
|
27 |
||
28 |
||
59228
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
29 |
/* main colors */ |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
30 |
|
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
31 |
def foreground_color: Color = Color.BLACK |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
32 |
def foreground1_color: Color = Color.GRAY |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
33 |
def background_color: Color = Color.WHITE |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
34 |
def selection_color: Color = Color.GREEN |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
35 |
def error_color: Color = Color.RED |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
36 |
|
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
37 |
|
50475 | 38 |
/* font rendering information */ |
39 |
||
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
40 |
def font_size: Int = 14 |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
41 |
def font(): Font = new Font("IsabelleText", Font.BOLD, font_size) |
50475 | 42 |
|
43 |
val rendering_hints = |
|
44 |
new RenderingHints( |
|
45 |
RenderingHints.KEY_ANTIALIASING, |
|
46 |
RenderingHints.VALUE_ANTIALIAS_ON) |
|
47 |
||
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
48 |
val font_render_context = new FontRenderContext(null, true, false) |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
49 |
|
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
50 |
def graphics_context(): Graphics2D = |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
51 |
{ |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
52 |
val gfx = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB).createGraphics |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
53 |
gfx.setFont(font()) |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
54 |
gfx.setRenderingHints(rendering_hints) |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
55 |
gfx |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
56 |
} |
50476
1cb983bccb5b
more official graphics context with font metrics;
wenzelm
parents:
50475
diff
changeset
|
57 |
|
59236 | 58 |
class Metrics private[Visualizer](f: Font, frc: FontRenderContext) |
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
59 |
{ |
59236 | 60 |
def string_bounds(s: String) = f.getStringBounds(s, frc) |
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
61 |
private val specimen = string_bounds("mix") |
50476
1cb983bccb5b
more official graphics context with font metrics;
wenzelm
parents:
50475
diff
changeset
|
62 |
|
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
63 |
def char_width: Double = specimen.getWidth / 3 |
59236 | 64 |
def height: Double = specimen.getHeight |
65 |
def ascent: Double = font.getLineMetrics("", frc).getAscent |
|
66 |
def gap: Double = specimen.getWidth |
|
67 |
def pad: Double = char_width |
|
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
68 |
} |
59236 | 69 |
def metrics(): Metrics = new Metrics(font(), font_render_context) |
70 |
def metrics(gfx: Graphics2D): Metrics = new Metrics(gfx.getFont, gfx.getFontRenderContext) |
|
50475 | 71 |
|
72 |
||
73 |
/* rendering parameters */ |
|
74 |
||
75 |
var arrow_heads = false |
|
76 |
||
77 |
object Colors |
|
78 |
{ |
|
79 |
private val filter_colors = List( |
|
59220 | 80 |
new Color(0xD9, 0xF2, 0xE2), // blue |
81 |
new Color(0xFF, 0xE7, 0xD8), // orange |
|
82 |
new Color(0xFF, 0xFF, 0xE5), // yellow |
|
83 |
new Color(0xDE, 0xCE, 0xFF), // lilac |
|
84 |
new Color(0xCC, 0xEB, 0xFF), // turquoise |
|
85 |
new Color(0xFF, 0xE5, 0xE5), // red |
|
86 |
new Color(0xE5, 0xE5, 0xD9) // green |
|
50475 | 87 |
) |
88 |
||
89 |
private var curr : Int = -1 |
|
59220 | 90 |
def next(): Color = |
50475 | 91 |
{ |
92 |
curr = (curr + 1) % filter_colors.length |
|
93 |
filter_colors(curr) |
|
94 |
} |
|
95 |
} |
|
96 |
||
50472
bad1a1ca61e1
separate instance of class Parameters for each Main_Panel -- avoid global program state;
wenzelm
parents:
50471
diff
changeset
|
97 |
|
50465 | 98 |
object Coordinates |
99 |
{ |
|
59232 | 100 |
private var layout = Layout.empty |
50465 | 101 |
|
102 |
def apply(k: String): (Double, Double) = |
|
50470 | 103 |
layout.nodes.get(k) match { |
50465 | 104 |
case Some(c) => c |
105 |
case None => (0, 0) |
|
106 |
} |
|
107 |
||
108 |
def apply(e: (String, String)): List[(Double, Double)] = |
|
50470 | 109 |
layout.dummies.get(e) match { |
50465 | 110 |
case Some(ds) => ds |
111 |
case None => Nil |
|
112 |
} |
|
113 |
||
114 |
def reposition(k: String, to: (Double, Double)) |
|
115 |
{ |
|
50470 | 116 |
layout = layout.copy(nodes = layout.nodes + (k -> to)) |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
117 |
} |
50465 | 118 |
|
119 |
def reposition(d: ((String, String), Int), to: (Double, Double)) |
|
120 |
{ |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
121 |
val (e, index) = d |
50470 | 122 |
layout.dummies.get(e) match { |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
123 |
case None => |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
124 |
case Some(ds) => |
50470 | 125 |
layout = layout.copy(dummies = |
126 |
layout.dummies + (e -> |
|
127 |
(ds.zipWithIndex :\ List.empty[(Double, Double)]) { |
|
128 |
case ((t, i), n) => if (index == i) to :: n else t :: n |
|
129 |
})) |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
130 |
} |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
131 |
} |
50465 | 132 |
|
133 |
def translate(k: String, by: (Double, Double)) |
|
134 |
{ |
|
135 |
val ((x, y), (dx, dy)) = (Coordinates(k), by) |
|
136 |
reposition(k, (x + dx, y + dy)) |
|
137 |
} |
|
138 |
||
139 |
def translate(d: ((String, String), Int), by: (Double, Double)) |
|
140 |
{ |
|
141 |
val ((e, i),(dx, dy)) = (d, by) |
|
142 |
val (x, y) = apply(e)(i) |
|
143 |
reposition(d, (x + dx, y + dy)) |
|
144 |
} |
|
145 |
||
50470 | 146 |
def update_layout() |
50465 | 147 |
{ |
50474
6ee044e2d1a7
initial layout coordinates more like old browser;
wenzelm
parents:
50472
diff
changeset
|
148 |
layout = |
59232 | 149 |
if (model.current_graph.is_empty) Layout.empty |
50474
6ee044e2d1a7
initial layout coordinates more like old browser;
wenzelm
parents:
50472
diff
changeset
|
150 |
else { |
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
151 |
val m = metrics() |
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
152 |
|
50474
6ee044e2d1a7
initial layout coordinates more like old browser;
wenzelm
parents:
50472
diff
changeset
|
153 |
val max_width = |
59228
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
154 |
model.current_graph.iterator.map({ case (_, (info, _)) => |
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
155 |
m.string_bounds(info.name).getWidth }).max |
59236 | 156 |
val box_distance = max_width + m.pad + m.gap |
157 |
def box_height(n: Int): Double = m.char_width * 1.5 * (5 max n) |
|
59231
6dea47cf6c6b
more dynamic visualizer -- re-use jEdit font info;
wenzelm
parents:
59228
diff
changeset
|
158 |
|
59232 | 159 |
Layout.make(model.current_graph, box_distance, box_height _) |
50474
6ee044e2d1a7
initial layout coordinates more like old browser;
wenzelm
parents:
50472
diff
changeset
|
160 |
} |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
161 |
} |
50465 | 162 |
|
163 |
def bounds(): (Double, Double, Double, Double) = |
|
56372
fadb0fef09d7
more explicit iterator terminology, in accordance to Scala 2.8 library;
wenzelm
parents:
55618
diff
changeset
|
164 |
model.visible_nodes_iterator.toList match { |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
165 |
case Nil => (0, 0, 0, 0) |
50465 | 166 |
case nodes => |
167 |
val X: (String => Double) = (n => apply(n)._1) |
|
168 |
val Y: (String => Double) = (n => apply(n)._2) |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
169 |
|
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
170 |
(X(nodes.minBy(X)), Y(nodes.minBy(Y)), |
50465 | 171 |
X(nodes.maxBy(X)), Y(nodes.maxBy(Y))) |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
172 |
} |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
173 |
} |
50465 | 174 |
|
50464 | 175 |
object Drawer |
176 |
{ |
|
50465 | 177 |
def apply(g: Graphics2D, n: Option[String]) |
178 |
{ |
|
179 |
n match { |
|
180 |
case None => |
|
181 |
case Some(_) => Shapes.Growing_Node.paint(g, visualizer, n) |
|
182 |
} |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
183 |
} |
50465 | 184 |
|
185 |
def apply(g: Graphics2D, e: (String, String), head: Boolean, dummies: Boolean) |
|
186 |
{ |
|
187 |
Shapes.Cardinal_Spline_Edge.paint(g, visualizer, e, head, dummies) |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
188 |
} |
50465 | 189 |
|
50464 | 190 |
def paint_all_visible(g: Graphics2D, dummies: Boolean) |
191 |
{ |
|
50465 | 192 |
g.setFont(font) |
50464 | 193 |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
194 |
g.setRenderingHints(rendering_hints) |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
195 |
|
56372
fadb0fef09d7
more explicit iterator terminology, in accordance to Scala 2.8 library;
wenzelm
parents:
55618
diff
changeset
|
196 |
model.visible_edges_iterator.foreach(e => { |
50475 | 197 |
apply(g, e, arrow_heads, dummies) |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
198 |
}) |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
199 |
|
56372
fadb0fef09d7
more explicit iterator terminology, in accordance to Scala 2.8 library;
wenzelm
parents:
55618
diff
changeset
|
200 |
model.visible_nodes_iterator.foreach(l => { |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
201 |
apply(g, Some(l)) |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
202 |
}) |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
203 |
} |
50465 | 204 |
|
205 |
def shape(g: Graphics2D, n: Option[String]): Shape = |
|
206 |
n match { |
|
207 |
case None => Shapes.Dummy.shape(g, visualizer, None) |
|
208 |
case Some(_) => Shapes.Growing_Node.shape(g, visualizer, n) |
|
209 |
} |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
210 |
} |
50465 | 211 |
|
212 |
object Selection |
|
213 |
{ |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
214 |
private var selected: List[String] = Nil |
50465 | 215 |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
216 |
def apply() = selected |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
217 |
def apply(s: String) = selected.contains(s) |
50465 | 218 |
|
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
219 |
def add(s: String) { selected = s :: selected } |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
220 |
def set(ss: List[String]) { selected = ss } |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
221 |
def clear() { selected = Nil } |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
222 |
} |
50465 | 223 |
|
59220 | 224 |
sealed case class Node_Color(border: Color, background: Color, foreground: Color) |
50464 | 225 |
|
59220 | 226 |
def node_color(l: Option[String]): Node_Color = |
227 |
l match { |
|
59228
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
228 |
case None => |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
229 |
Node_Color(foreground1_color, background_color, foreground_color) |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
230 |
case Some(c) if Selection(c) => |
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
231 |
Node_Color(foreground_color, selection_color, foreground_color) |
59220 | 232 |
case Some(c) => |
59228
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
233 |
Node_Color(foreground_color, model.colors.getOrElse(c, background_color), foreground_color) |
59220 | 234 |
} |
235 |
||
59228
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
236 |
def edge_color(e: (String, String)): Color = foreground_color |
50465 | 237 |
|
238 |
object Caption |
|
50464 | 239 |
{ |
59228
56b34fc7a015
more dynamic visualizer -- re-use Isabelle/jEdit options;
wenzelm
parents:
59220
diff
changeset
|
240 |
def apply(key: String) = model.complete_graph.get_node(key).name |
49557
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
241 |
} |
61988f9df94d
added Graphview tool, based on Isabelle/Scala and Swing/Graphics2D;
Markus Kaiser <markus.kaiser@in.tum.de>
parents:
diff
changeset
|
242 |
} |