equal
deleted
inserted
replaced
21 |
21 |
22 Gnome::Canvas::Points coos; |
22 Gnome::Canvas::Points coos; |
23 coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y)); |
23 coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y)); |
24 coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y)); |
24 coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y)); |
25 |
25 |
26 //edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos); |
|
27 edgesmap[i]=new BrokenEdge(displayed_graph, coos); |
26 edgesmap[i]=new BrokenEdge(displayed_graph, coos); |
28 *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green"); |
27 *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green"); |
29 edgesmap[i]->property_width_pixels().set_value(10); |
28 edgesmap[i]->property_width_pixels().set_value(10); |
30 |
29 |
31 //initializing edge-text as well, to empty string |
30 //initializing edge-text as well, to empty string |
390 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
389 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
391 |
390 |
392 nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2); |
391 nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2); |
393 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
392 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
394 |
393 |
395 edgesmap[e]->property_points().set_value(coos); |
394 edgesmap[e]->set_points(coos); |
396 |
395 |
397 edgesmap[e]->get_bounds(x1, y1, x2, y2); |
396 edgesmap[e]->get_bounds(x1, y1, x2, y2); |
398 |
397 |
399 edgetextmap[e]->property_x().set_value((x1+x2)/2); |
398 edgetextmap[e]->property_x().set_value((x1+x2)/2); |
400 edgetextmap[e]->property_y().set_value((y1+y2)/2); |
399 edgetextmap[e]->property_y().set_value((y1+y2)/2); |
410 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
409 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
411 |
410 |
412 nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2); |
411 nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2); |
413 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
412 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
414 |
413 |
415 edgesmap[e]->property_points().set_value(coos); |
414 edgesmap[e]->set_points(coos); |
416 |
415 |
417 edgesmap[e]->get_bounds(x1, y1, x2, y2); |
416 edgesmap[e]->get_bounds(x1, y1, x2, y2); |
418 |
417 |
419 edgetextmap[e]->property_x().set_value((x1+x2)/2); |
418 edgetextmap[e]->property_x().set_value((x1+x2)/2); |
420 edgetextmap[e]->property_y().set_value((y1+y2)/2); |
419 edgetextmap[e]->property_y().set_value((y1+y2)/2); |
541 |
540 |
542 target_item->get_bounds(x1, y1, x2, y2); |
541 target_item->get_bounds(x1, y1, x2, y2); |
543 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
542 coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2)); |
544 |
543 |
545 //drawing new edge |
544 //drawing new edge |
546 edgesmap[active_edge]=new Gnome::Canvas::Line(displayed_graph, coos); |
545 edgesmap[active_edge]=new BrokenEdge(displayed_graph, coos); |
547 *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("green"); |
546 *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("green"); |
548 edgesmap[active_edge]->property_width_pixels().set_value(10); |
547 edgesmap[active_edge]->property_width_pixels().set_value(10); |
549 |
548 |
550 //redraw nodes to blank terminations of the new edge |
549 //redraw nodes to blank terminations of the new edge |
551 target_item->raise_to_top(); |
550 target_item->raise_to_top(); |