Record Class AbstractPainter.Hit
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.paint.AbstractPainter.Hit
- Enclosing class:
AbstractPainter
public static record AbstractPainter.Hit(float x0, float y0, float x1, float y1, Runnable action, @Nullable GuidePainter.Drag drag, @Nullable GuidePainter.Scroll scroll)
extends Record
A rectangle that can be pressed, dragged or scrolled over, in page pixels. One that takes the wheel is never pressed.
-
Constructor Summary
ConstructorsConstructorDescriptionHit(float x0, float y0, float x1, float y1, Runnable action, @Nullable GuidePainter.Drag drag) Hit(float x0, float y0, float x1, float y1, Runnable action, @Nullable GuidePainter.Drag drag, @Nullable GuidePainter.Scroll scroll) Creates an instance of aHitrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.booleancontains(double x, double y) @Nullable GuidePainter.Dragdrag()Returns the value of thedragrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable GuidePainter.Scrollscroll()Returns the value of thescrollrecord component.static @Nullable GuidePainter.ScrollscrollAt(List<AbstractPainter.Hit> hits, double x, double y) The wheel handler of the last place among these the pointer is over that takes it; null for none.final StringtoString()Returns a string representation of this record class.floatx0()Returns the value of thex0record component.floatx1()Returns the value of thex1record component.floaty0()Returns the value of they0record component.floaty1()Returns the value of they1record component.
-
Constructor Details
-
Hit
-
Hit
public Hit(float x0, float y0, float x1, float y1, Runnable action, @Nullable @Nullable GuidePainter.Drag drag) -
Hit
public Hit(float x0, float y0, float x1, float y1, Runnable action, @Nullable @Nullable GuidePainter.Drag drag, @Nullable @Nullable GuidePainter.Scroll scroll) Creates an instance of aHitrecord class.- Parameters:
x0- the value for thex0record componenty0- the value for they0record componentx1- the value for thex1record componenty1- the value for they1record componentaction- the value for theactionrecord componentdrag- the value for thedragrecord componentscroll- the value for thescrollrecord component
-
-
Method Details
-
scrollAt
@Nullable public static @Nullable GuidePainter.Scroll scrollAt(List<AbstractPainter.Hit> hits, double x, double y) The wheel handler of the last place among these the pointer is over that takes it; null for none. -
contains
public boolean contains(double x, double y) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
x0
public float x0()Returns the value of thex0record component.- Returns:
- the value of the
x0record component
-
y0
public float y0()Returns the value of they0record component.- Returns:
- the value of the
y0record component
-
x1
public float x1()Returns the value of thex1record component.- Returns:
- the value of the
x1record component
-
y1
public float y1()Returns the value of they1record component.- Returns:
- the value of the
y1record component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
drag
Returns the value of thedragrecord component.- Returns:
- the value of the
dragrecord component
-
scroll
Returns the value of thescrollrecord component.- Returns:
- the value of the
scrollrecord component
-