程序包 app.desktop.ui
Record Class GradientEventPayload
java.lang.Object
java.lang.Record
app.desktop.ui.GradientEventPayload
- 所有已实现的接口:
EventPoolService.EventPayload
public record GradientEventPayload(GradientColor[] colors, float startX, float startY, float endX, float endY)
extends Record
implements EventPoolService.EventPayload
An identifier payload for deploying Gradient Events to the Poprock
application. It contains information for the Poprock app to process at
runtime. Thus, you should only listen to this payload type from the EventPool
if you are using the Poprock app as well.
Listening to EventPool
Please note that the above also requires theimport pkg.exoad.Poprock.core.events.*; //... EventPool.attachListener(GradientEventPayload.class, () -> System.out.println("It got dispatched!"));
GradientEventPayload.class
to actually be registered to the EventPool
or else the EventPool will throw an error.
Dispatching to EventPool
Highly unsuggested as messing with the pre-exsiting ephemeral dispatching of this payload class within the Poprock app can result in this Payload being ignored, overwritten, corrupted, or just causing errors because of synchronization errors (race conditions, among others).
import pkg.exoad.Poprock.core.events.*; //... EventPool.dispatchEvent(GradientEventPayload.class,GradientEventPayload.EMPTY);
- 作者:
- Jack Meng
- 另请参阅:
-
字段概要
修饰符和类型字段说明private final GradientColor[]
colors
记录组件的字段。static final GradientEventPayload
private final float
endX
记录组件的字段。private final float
endY
记录组件的字段。private final float
startX
记录组件的字段。private final float
startY
记录组件的字段。 -
构造器概要
构造器说明GradientEventPayload
(GradientColor[] colors, float startX, float startY, float endX, float endY) 创建GradientEventPayload
记录的实例。 -
方法概要
-
字段详细资料
-
colors
colors
记录组件的字段。 -
startX
private final float startXstartX
记录组件的字段。 -
startY
private final float startYstartY
记录组件的字段。 -
endX
private final float endXendX
记录组件的字段。 -
endY
private final float endYendY
记录组件的字段。 -
EMPTY
-
-
构造器详细资料
-
GradientEventPayload
public GradientEventPayload(GradientColor[] colors, float startX, float startY, float endX, float endY) 创建GradientEventPayload
记录的实例。- 参数:
colors
-colors
记录组件的值startX
-startX
记录组件的值startY
-startY
记录组件的值endX
-endX
记录组件的值endY
-endY
记录组件的值
-
-
方法详细资料
-
makeRandomColor
-
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用Objects::equals(Object,Object)
对参考组件进行比较;使用 '==' 对基元组件进行比较 -
hashCode
public int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
toString
返回此记录的字符串表示形式。此表示形式包含类型的名称,后跟每个记录组件的名称和值。 -
colors
返回colors
记录组件的值。- 返回:
colors
记录组件的值
-
startX
public float startX()返回startX
记录组件的值。- 返回:
startX
记录组件的值
-
startY
public float startY()返回startY
记录组件的值。- 返回:
startY
记录组件的值
-
endX
public float endX()返回endX
记录组件的值。- 返回:
endX
记录组件的值
-
endY
public float endY()返回endY
记录组件的值。- 返回:
endY
记录组件的值
-