Using noLoop() and Loop()
in
Integration and Hardware
•
3 years ago
I have been creating a project in eclipse that is essentially a network map of connections between people (each person is a node, and it graphs connections between people by drawing edges between nodes). The network map has several different options as to which type of people it maps (family members, non-family members, or all people) in the sketch. I'm trying to make these options available off to the side of the GUI so the user can simply click on what people they would like to display and the sketch will modify itself in real time. I know that in order to do that, I have to temporarily halt the draw() method so I can modify variables before resuming the draw method. Therefore, I use noLoop(), then reset and modify the variables, then use loop(), as shown below, but I still get the ConcurrentModificationException coming out of my hashMap... any ideas as to why this still happens?
Relevant code:
- if(e.getSource() == familyBtn {
- embed.setVariables(bloomfieldUsed, false, true);
- resetDisplay();
- }
- private void resetDisplay() { //embed is the Processing Applet contained in my GUI
- embed.clear(); //simply calls noLoop, then resets all global variables to 0 or null
- embed.loadData(); //modifies the data
- embed.reset(); //calls loop()
- }
1