equal
deleted
inserted
replaced
17 |
17 |
18 import scala.util.matching.Regex |
18 import scala.util.matching.Regex |
19 import scala.swing.{Component, ScrollPane, BorderPanel, Label, TextField, Button, CheckBox, Action} |
19 import scala.swing.{Component, ScrollPane, BorderPanel, Label, TextField, Button, CheckBox, Action} |
20 |
20 |
21 |
21 |
22 class Tree_Panel(val graphview: Graphview, graph_panel: Graph_Panel) extends BorderPanel |
22 class Tree_Panel(val graphview: Graphview, graph_panel: Graph_Panel) |
23 { |
23 extends BorderPanel { |
24 /* main actions */ |
24 /* main actions */ |
25 |
25 |
26 private def selection_action(): Unit = |
26 private def selection_action(): Unit = { |
27 { |
|
28 if (tree != null) { |
27 if (tree != null) { |
29 graphview.current_node = None |
28 graphview.current_node = None |
30 graphview.Selection.clear() |
29 graphview.Selection.clear() |
31 val paths = tree.getSelectionPaths |
30 val paths = tree.getSelectionPaths |
32 if (paths != null) { |
31 if (paths != null) { |
43 } |
42 } |
44 graph_panel.repaint() |
43 graph_panel.repaint() |
45 } |
44 } |
46 } |
45 } |
47 |
46 |
48 private def point_action(path: TreePath): Unit = |
47 private def point_action(path: TreePath): Unit = { |
49 { |
|
50 if (tree_pane != null && path != null) { |
48 if (tree_pane != null && path != null) { |
51 val action_node = |
49 val action_node = |
52 path.getLastPathComponent match { |
50 path.getLastPathComponent match { |
53 case tree_node: DefaultMutableTreeNode => |
51 case tree_node: DefaultMutableTreeNode => |
54 tree_node.getUserObject match { |
52 tree_node.getUserObject match { |
147 Wrap_Panel(List(selection_label, selection_field, selection_apply)) |
145 Wrap_Panel(List(selection_label, selection_field, selection_apply)) |
148 |
146 |
149 |
147 |
150 /* main layout */ |
148 /* main layout */ |
151 |
149 |
152 def refresh(): Unit = |
150 def refresh(): Unit = { |
153 { |
|
154 val new_nodes = graphview.visible_graph.topological_order |
151 val new_nodes = graphview.visible_graph.topological_order |
155 if (new_nodes != nodes) { |
152 if (new_nodes != nodes) { |
156 tree.clearSelection |
153 tree.clearSelection |
157 |
154 |
158 nodes = new_nodes |
155 nodes = new_nodes |