Thank you guys for your answer!!
@TfGuy44 can you describe how i can check if there is a node or not? My idea was to initialize a variable int noNodeexists = 0; and in mousePressed i check this with an if-clause.
So kinda like this…
void mousePressed(){
if( noNodeexists == 0){
Node node = new Node();
}
else {
// draw edge
}
@quark i understand your point. Every node needs to know where he is and every edge needs to know the beginning and ending… but i dont know how to start