//User interface for creating a .pdf file of a select tree class Console{ Button [] button; Console(int num){ button = new Button[num]; for(int i = 0; i < button.length; i++){ button[i] = new Button((width / (button.length + 1)) * (i + 1), 50, colorTable[i]); } } void draw(){ for(int i = 0; i < button.length; i++){ button[i].draw(); } } class Button{ int x, y, size, col; Button(int x, int y, int col){ this.x = x; this.y = y; this.size = 30; this.col = col; } void draw(){ strokeWeight(4); fill(0); if(over()){ fill(col); } noStroke(); noSmooth(); ellipse(x, y, size<<1, size<<1); stroke(200); noFill(); smooth(); ellipse(x, y, size<<1, size<<1); } boolean over(){ if(dist(mouseX, mouseY, x, y) < size){ return true; } return false; } } }