class FilterButton { int id; String name; color fillColor; boolean display; int centerX, centerY; int buttonSize = 17; public FilterButton(int id, String name) { this.id = id; this.name = name; this.fillColor = (Integer) statusColors.get(name); this.display = true; this.centerX = 25; this.centerY = 90 + id * 30; } void draw() { stroke(0); strokeWeight(1); textSize(13); if (display) { fill(fillColor); } else { fill(255); } rectMode(CENTER); rect(centerX, centerY, buttonSize, buttonSize); fill(0); textAlign(LEFT, CENTER); text(name, centerX + buttonSize + 3, centerY); } void filter() { display = !display; for (int i = 0; i < appCount; i++) { apps[i].filter(this.name); } } boolean clicked() { return dist(mouseX, mouseY, centerX, centerY) < buttonSize / 2; } }