src/Tools/Graphview/visualizer.scala
changeset 59303 15cd9bcd6ddb
parent 59302 4d985afc0565
child 59305 b5e33012180e
equal deleted inserted replaced
59302:4d985afc0565 59303:15cd9bcd6ddb
    21 
    21 
    22 
    22 
    23   /* layout state */
    23   /* layout state */
    24 
    24 
    25   // owned by GUI thread
    25   // owned by GUI thread
    26   private var layout: Layout = Layout.empty
    26   private var _layout: Layout = Layout.empty
       
    27   def layout: Layout = _layout
    27 
    28 
    28   def metrics: Metrics = layout.metrics
    29   def metrics: Metrics = layout.metrics
    29   def visible_graph: Graph_Display.Graph = layout.input_graph
    30   def visible_graph: Graph_Display.Graph = layout.input_graph
    30 
    31 
    31   def get_vertex(v: Layout.Vertex): Layout.Point = layout.get_vertex(v)
    32   def translate_vertex(v: Layout.Vertex, dx: Double, dy: Double): Unit =
    32   def translate_vertex(v: Layout.Vertex, dx: Double, dy: Double)
    33     _layout = _layout.translate_vertex(v, dx, dy)
    33   {
       
    34     layout = layout.translate_vertex(v, dx, dy)
       
    35   }
       
    36 
       
    37   def dummies_iterator(edge: Graph_Display.Edge): Iterator[Layout.Point] =
       
    38     layout.dummies_iterator(edge)
       
    39 
       
    40   def find_dummy(pred: Layout.Point => Boolean): Option[Layout.Dummy] =
       
    41     layout.find_dummy(pred)
       
    42 
    34 
    43   def bounding_box(): Rectangle2D.Double =
    35   def bounding_box(): Rectangle2D.Double =
    44   {
    36   {
    45     var x0 = 0.0
    37     var x0 = 0.0
    46     var y0 = 0.0
    38     var y0 = 0.0
    66   {
    58   {
    67     val metrics = Metrics(make_font())
    59     val metrics = Metrics(make_font())
    68     val visible_graph = model.make_visible_graph()
    60     val visible_graph = model.make_visible_graph()
    69 
    61 
    70     // FIXME avoid expensive operation on GUI thread
    62     // FIXME avoid expensive operation on GUI thread
    71     layout = Layout.make(metrics, visible_graph)
    63     _layout = Layout.make(metrics, visible_graph)
    72   }
    64   }
    73 
    65 
    74 
    66 
    75   /* tooltips */
    67   /* tooltips */
    76 
    68