1 package com.irtimaled.bbor.client.gui;
3 import com.irtimaled.bbor.common.BoundingBoxType;
7 public class BoundingBoxTypeButton extends BoolSettingButton {
8 private final Color color;
10 BoundingBoxTypeButton(int id, int x, int y, int width, String label, BoundingBoxType type) {
11 super(id, x, y, width, label, type.shouldRenderSetting);
12 color = type.getColor();
15 public BoundingBoxTypeButton(int id, int x, int y, int width, String label, BoundingBoxType type, boolean enabled) {
16 this(id, x, y, width, label, type);
17 this.enabled = enabled;
21 protected void renderBackground() {
26 int right = left + width - 2;
27 int bottom = top + height - 2;
30 drawRectangle(left, top, right, top + 1, color);
31 drawRectangle(left, top, left + 1, bottom, color);
33 Color darker = color.darker();
34 // bottom left & top right
35 drawRectangle(left, bottom - 2, left + 1, bottom, darker);
36 drawRectangle(right - 1, top, right, top + 1, darker);
38 Color darkest = darker.darker();
40 drawRectangle(left + 1, bottom - 2, right, bottom, darkest);
41 drawRectangle(right - 1, top + 1, right, bottom, darkest);
44 private void drawRectangle(int left, int top, int right, int bottom, Color color) {
45 drawRect(left, top, right, bottom, color.getRGB());