mirror of
https://codeberg.org/qg-info-unterricht/zpg-graphentester.git
synced 2026-03-25 04:58:24 +01:00
Sync with upstream
This commit is contained in:
parent
39a2f13410
commit
66e8fa72bf
135 changed files with 38902 additions and 37757 deletions
|
|
@ -456,6 +456,7 @@ public class Graph
|
|||
if (!isKnotenEnthalten(k)){
|
||||
kList.add(k);
|
||||
adList.add(new ArrayList<Kante>());
|
||||
k.setGraph(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -493,6 +494,7 @@ public class Graph
|
|||
}
|
||||
adList.remove(index);
|
||||
kList.remove(k);
|
||||
k.setGraph(null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -577,6 +579,7 @@ public class Graph
|
|||
adList.get(kList.indexOf(e.getStart())).add(e);
|
||||
if(!gerichtet) adList.get(kList.indexOf(e.getZiel())).add(e);
|
||||
kaList.add(e);
|
||||
e.setGraph(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -625,8 +628,10 @@ public class Graph
|
|||
}
|
||||
}
|
||||
kaList.remove(e1);
|
||||
e1.setGraph(null);
|
||||
if(!gerichtet) {
|
||||
kaList.remove(e2);
|
||||
e2.setGraph(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -654,6 +659,8 @@ public class Graph
|
|||
* Loescht den gesamten Graphen
|
||||
*/
|
||||
public void loescheAlles() {
|
||||
for(Kante k : kaList) k.setGraph(null);
|
||||
for(Knoten k : kList) k.setGraph(null);
|
||||
adList.clear();
|
||||
kList.clear();
|
||||
kaList.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue