Record Class DrawEntry
- Record Components:
key- the command's key within its connectionkind- the primitive, ornullif this build does not know the name the producer usedspace- coordinate spacecolor- packed0xAARRGGBBthickness- stroke widthz- draw orderisFilled- filled rather than strokedisClosed- polyline closedgeometry- the command's four raw geometry slots, as the producer stores themisResolved- whether the producer currently holds a screen position for what this command marks. Permanently false, and harmless, for a screen-space primitive; a health bit only for a component highlight and for world-space commands, entity and tile highlights included. See the class javadoc before branching on itrect- the last resolved rect[x, y, w, h], in layout unitsremainingTtlMs- milliseconds left, or-1for no expirytext- the words this entry draws. Populated for aDrawKind.TEXTentry and — since the producer gained captions — for aDrawKind.COMPONENTentry too, where it carries the highlight's label. Empty when the entry has no caption. A fixed-point caption arrives already formatted, because the producer does the formatting and this wire has no float to send back.font- the style the caption is drawn in;DrawFont.NORMALwhen the entry has no caption
Answered by Draw.list(). This is the producer's view, not an echo of
what you sent, and two fields make that difference load-bearing:
remainingTtlMs()is what is left, not what you asked for. Round-tripping a TTL through this is not symmetric — a command sent withttl(3000)reports something under 3000 a moment later, and-1when it was sent withDrawLimits.TTL_UNTIL_CLEARED.rect()on aDrawKind.COMPONENTentry is the last rect the game thread resolved, in the client's layout units rather than surface pixels — the same unitsget_componentreports. Anyone comparing it against a screenshot needs to know the producer scales it by surface/layout before drawing. It is meaningful only whenisResolved().
isResolved() means two different things and this row does not say
which. Read it against kind() and space(), never on its own:
- For a screen-space primitive — a rect, line, ellipse, poly or text in
DrawSpace.SCREEN— it is permanentlyfalse, and the command is perfectly fine. Nothing was resolved because nothing needed resolving: the coordinates were already pixels. A consumer that readsfalsehere as "my drawing is broken" will be wrong about every screen command it ever sends. - For a component highlight, and for anything in
DrawSpace.WORLD— which includes everyDrawKind.ENTITYandDrawKind.TILErow, since the semantic highlights are world-space by construction — it is a health bit.falsemeans the producer has no usable screen position for what the command marks: no scene, no window, behind the camera, or a plane it cannot height. Nothing is drawn, andrect()is zeroed rather than left holding the last good value, so a stale-but-plausible rectangle can never be read back at the moment a marker goes invalid.
Two further traps on the world side. isResolved() == true does not promise a
paintable area — a footprint far enough away that all four projected corners round to
one pixel, and every text command, legitimately report a zero extent — so code
that needs somewhere to draw must check the extent, not only the flag. And the flag
cannot distinguish "outside the viewport but real and clampable" from "behind the
camera, no usable position exists"; the producer's project field carries that
distinction in five states and this record does not surface it yet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longMilliseconds reported for a command that never expires. -
Constructor Summary
ConstructorsConstructorDescriptionDrawEntry(String key, DrawKind kind, DrawSpace space, int color, int thickness, int z, boolean isFilled, boolean isClosed, List<Integer> geometry, boolean isResolved, List<Integer> rect, long remainingTtlMs, String text, DrawFont font) Creates an instance of aDrawEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.font()Returns the value of thefontrecord component.geometry()Returns the value of thegeometryrecord component.final inthashCode()Returns a hash code value for this object.booleanisClosed()Returns the value of theisClosedrecord component.booleanisFilled()Returns the value of theisFilledrecord component.booleanTrue when this command has no expiry and lives until replaced or cleared.booleanReturns the value of theisResolvedrecord component.key()Returns the value of thekeyrecord component.kind()Returns the value of thekindrecord component.rect()Returns the value of therectrecord component.longReturns the value of theremainingTtlMsrecord component.space()Returns the value of thespacerecord component.text()Returns the value of thetextrecord component.intReturns the value of thethicknessrecord component.final StringtoString()Returns a string representation of this record class.intz()Returns the value of thezrecord component.
-
Field Details
-
NO_EXPIRY
public static final long NO_EXPIRYMilliseconds reported for a command that never expires.- See Also:
-
-
Constructor Details
-
DrawEntry
public DrawEntry(String key, DrawKind kind, DrawSpace space, int color, int thickness, int z, boolean isFilled, boolean isClosed, List<Integer> geometry, boolean isResolved, List<Integer> rect, long remainingTtlMs, String text, DrawFont font) Creates an instance of aDrawEntryrecord class.- Parameters:
key- the value for thekeyrecord componentkind- the value for thekindrecord componentspace- the value for thespacerecord componentcolor- the value for thecolorrecord componentthickness- the value for thethicknessrecord componentz- the value for thezrecord componentisFilled- the value for theisFilledrecord componentisClosed- the value for theisClosedrecord componentgeometry- the value for thegeometryrecord componentisResolved- the value for theisResolvedrecord componentrect- the value for therectrecord componentremainingTtlMs- the value for theremainingTtlMsrecord componenttext- the value for thetextrecord componentfont- the value for thefontrecord component
-
-
Method Details
-
isPersistent
public boolean isPersistent()True when this command has no expiry and lives until replaced or cleared. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
key
-
kind
-
space
-
color
-
thickness
-
z
-
isFilled
-
isClosed
-
geometry
-
isResolved
public boolean isResolved()Returns the value of theisResolvedrecord component.- Returns:
- the value of the
isResolvedrecord component
-
rect
-
remainingTtlMs
public long remainingTtlMs()Returns the value of theremainingTtlMsrecord component.- Returns:
- the value of the
remainingTtlMsrecord component
-
text
-
font
-