Rectangle rectangle = new Rectangle(100,100)
rectangle.setFill(Model.Materials.AIR.getColor()); Color rectangleColor = (Color) rectangle.getFill(); rectangle.setOnMouseClicked(event -> rectangle.setFill(model.nextMaterialColor(rectangleColor)));