Class LiveFavicon

java.lang.Object
com.jbstrap.ui.LiveFavicon

public class LiveFavicon extends Object

Live Favicon

With this class, we can give additional information to the user. This information is put inside a bubble, that appears on the application's icon (favicon) For example, this could be used to inform the user if there's a new message, or inform them about the amount of unread messages, etc.

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • LiveFavicon

      public LiveFavicon(String iconText)
      Creates a favicon bubble with the specified text content
      Parameters:
      iconText - The text that will be in the bubble
    • LiveFavicon

      public LiveFavicon(String iconText, String backgroundColor)
      Creates a bubble on the icon, with the specified text and background color
      Parameters:
      iconText - The text that will be in the bubble
      backgroundColor - The background color of the bubble. Can be specified using the #RRGGBB format. If specified as null the default color will be red (#ff0000).
    • LiveFavicon

      public LiveFavicon(String iconText, String textColor, Integer width, Integer height, String backgroundColor)
      Creates a bubble on the icon, with the specified parameters
      Parameters:
      iconText - The text that will be in the bubble
      textColor - The text color. If specified as null, the color will be #fff.
      width - The width in pixels. If specified as null it will be 7px.
      height - The height in pixels. If specified as null it will be 9px.
      backgroundColor - The background color of the bubble. Can be specified using the #RRGGBB format. If specified as null the default color will be red (#ff0000).
  • Method Details

    • getIconText

      public final String getIconText()
      Gets the bubble text.
      Returns:
      The bubble text
    • setIconText

      public final void setIconText(String iconText)
      Sets the bubble text
      Parameters:
      iconText - The text that will be in the bubble
    • getTextColor

      public final String getTextColor()
      Gets the bubble text color
      Returns:
      The bubble text color
    • setTextColor

      public final void setTextColor(String color)
      Sets the bubble text color
      Parameters:
      color - The text color. If specified as null, the color will be #fff.
    • getWidth

      public final int getWidth()
      Gets the bubble width
      Returns:
      The bubble width in pixels
    • setWidth

      public final void setWidth(Integer width)
      Sets the bubble width
      Parameters:
      width - The width in pixels. If specified as null it will be 7px.
    • getHeight

      public final int getHeight()
      Gets the bubble height
      Returns:
      The bubble height in pixels
    • setHeight

      public final void setHeight(Integer height)
      Sets the bubble height
      Parameters:
      height - The height in pixels. If specified as null it will be 9px.
    • getBackgroundColor

      public final String getBackgroundColor()
      Gets the bubble background color
      Returns:
      The bubble background color
    • setBackgroundColor

      public final void setBackgroundColor(String backgroundColor)
      Sets the bubble background color
      Parameters:
      backgroundColor - The background color of the bubble. Can be specified using the #RRGGBB format. If specified as null the default color will be red (#ff0000).
    • setCurrentUi

      public final void setCurrentUi(UI ui)
      Parameters:
      ui - The UI instance where the bubble will appear
    • redraw

      public final void redraw()
      Redraws the bubble
    • draw

      public void draw()