private void delete() { if (this.clusterNum <= 0) return; if (!WindowTools.confirmationWindow( "Are you sure you want to delete this cluster?", "Delete confirmation")) return; if (selectedCluster == this) { selectCluster(null); structureBeingMoved = false; } for (int i = 0; i < neurons.size(); i++) if (neurons.get(i).cluster == this) { neurons.remove(i); i--; } clusters.remove(this); redraw = true; }