return;
}
// If we are in the middle of creating an area flow
if (creatingNewElement) {
AreaFlow newFlow = (AreaFlow) newElement;
newFlow.constructionPhase++;
// If the construction has finished (4 clicks needed)
if (newFlow.constructionPhase == 3) {
newFlow.createHandles();
currentTrafficLayer.AddTrafficElement(newElement);
// Reset helper variables
creatingNewElement = false;
newElement = null;
repaint();
}
}
// First click - construction beginning
else {
// Create temporary area flow and set its starting location
newElement = new AreaFlow();
((AreaFlow) newElement).setStartAreaCenter(transformedPoint);
((AreaFlow) newElement).constructionPhase = 0;
creatingNewElement = true;