Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ResizeMessage

A message class for 'resize' messages. The namespace for the ResizeMessage class statics.

Hierarchy

  • Message
    • ResizeMessage

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ResizeMessage(width: number, height: number): ResizeMessage
  • Construct a new resize message.

    Parameters

    • width: number

      The offset width of the widget, or -1 if the width is not known.

    • height: number

      The offset height of the widget, or -1 if the height is not known.

    Returns ResizeMessage

Properties

height

height: number

The offset height of the widget.

Notes

This will be -1 if the height is unknown.

isConflatable

isConflatable: boolean

Test whether the message is conflatable.

Notes

Message conflation is an advanced topic. Most message types will not make use of this feature.

If a conflatable message is posted to a handler while another conflatable message of the same type has already been posted to the handler, the conflate() method of the existing message will be invoked. If that method returns true, the new message will not be enqueued. This allows messages to be compressed, so that only a single instance of the message type is processed per cycle, no matter how many times messages of that type are posted.

Custom message types may reimplement this property.

The default implementation is always false.

type

type: string

The type of the message.

Notes

The type of a message should be related directly to its actual runtime type. This means that type can and will be used to cast the message to the relevant derived Message subtype.

width

width: number

The offset width of the widget.

Notes

This will be -1 if the width is unknown.

Static UnknownSize

UnknownSize: ResizeMessage = new ResizeMessage(-1, -1)

A singleton 'resize' message with an unknown size.

Methods

conflate

  • conflate(other: Message): boolean
  • Conflate this message with another message of the same type.

    Parameters

    • other: Message

      A conflatable message of the same type.

    Returns boolean

    true if the message was successfully conflated, or false otherwise.

    Notes

    Message conflation is an advanced topic. Most message types will not make use of this feature.

    This method is called automatically by the message loop when the given message is posted to the handler paired with this message. This message will already be enqueued and conflatable, and the given message will have the same type and also be conflatable.

    This method should merge the state of the other message into this message as needed so that when this message is finally delivered to the handler, it receives the most up-to-date information.

    If this method returns true, it signals that the other message was successfully conflated and that message will not be enqueued.

    If this method returns false, the other message will be enqueued for normal delivery.

    Custom message types may reimplement this method.

    The default implementation always returns false.

Generated using TypeDoc