Class Layer1ApiUserMessageNotification

java.lang.Object
velox.api.layer1.messages.Layer1ApiUserMessageNotification
All Implemented Interfaces:
velox.api.layer1.messages.EchoMessage

public class Layer1ApiUserMessageNotification extends Object implements velox.api.layer1.messages.EchoMessage
Can be used to print some text over chart with optional close icon
If message with id was already present, displayed message will be updated
Messages need to be removed with this message (note that you need to do this in response for close icon pressed as well)
  • Field Details

    • RESERVED_ID_HISTORICAL_DATA

      public static final long RESERVED_ID_HISTORICAL_DATA
    • alias

      public final String alias
    • text

      public final String text
    • id

      public final long id
    • isAdd

      public final boolean isAdd
    • minWidthPx

      public final int minWidthPx
    • onMessageClosedCallback

      public final Runnable onMessageClosedCallback
  • Constructor Details

    • Layer1ApiUserMessageNotification

      public Layer1ApiUserMessageNotification(String alias, long id, String text, boolean isAdd, int minWidthPx, Runnable onMessageClosedCallback)
      Parameters:
      alias - target alias of message, or null if notification is for all aliases
      id - unique id of message (use getNextId() to generate it first time)
      text -
      isAdd - if true, message is displayed (if message with this id is already displayed - it will be updated) otherwise message with this id will be removed
      minWidthPx - minimum width required to paint this string
      onMessageClosedCallback - if not null, message will have cross icon, and callback will be called when it's pressed
  • Method Details

    • getNextId

      public static long getNextId()
      Returns:
      unique id
    • toString

      public String toString()
      Overrides:
      toString in class Object