class ZoomButton { int x, y; String name; boolean display; int h, w; public ZoomButton(int x, int y) { this.x = x; this.y = y; this.name = "Click to zoom out"; this.display = false; this.h = 30; this.w = 130; } void draw() { if (display) { strokeWeight(1); fill(255); rect(x, y, w, h); fill(0); textAlign(CENTER, CENTER); text(name, x, y); } } void display() { display = true; } boolean isDisplay() { return display; } void reset() { xAxisMin = xStats.getMin(); xAxisMax = xStats.getMax(); yAxisMin = yStats.getMin(); yAxisMax = yStats.getMax(); display = false; } boolean clicked() { return (mouseX > x - w/2) && (mouseX < x + w/2) && (mouseY > y - h/2) && (mouseY < y + h/2); } }