blob: 382293a0a070b5c3d08c0ceb5ab81442d91d4de5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package me.shedaniel.rei.gui.widget;
import java.awt.*;
public abstract class HighlightableWidget extends Widget {
abstract public Shape getBounds();
public boolean isHighlighted(int mouseX, int mouseY) {
return getBounds().contains(mouseX, mouseY);
}
public boolean isHighlighted(Point point) {
return this.isHighlighted(point.x, point.y);
}
public boolean isHighlighted(double mouseX, double mouseY) {
return this.isHighlighted((int) mouseX, (int) mouseY);
}
}
|