diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-21 18:07:12 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-21 18:07:12 +0100 |
| commit | e836f48216ed1ce23ad59a57bf81474cf864b347 (patch) | |
| tree | 5a23c7cc2471cb5f3d4ff2fda0a086b3769f3e46 | |
| parent | 0e1704bbcb3279e4779f09c06127a7c76cc8fb04 (diff) | |
Add source and dest
| -rw-r--r-- | structure/Graph.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/structure/Graph.java b/structure/Graph.java index 3092a4f..fde99f8 100644 --- a/structure/Graph.java +++ b/structure/Graph.java @@ -26,9 +26,25 @@ public class MyGraph extends SingleGraph{ // Assign grid this.grid=grid; + int i=0; + int ll=this.grid.getGrid().size(); // Build node for(Router r : this.grid.getGrid()){ - this.addNode(r.name); + if(i==0){ + this.addNode(r.name).setAttribute("ui.label", "Source"); + } + else{ + if(i==ll-1){ + this.addNode(r.name).setAttribute("ui.label", "Destination"); + + } + else{ + this.addNode(r.name); + + } + + } + i++; } |
