Class Marquee

java.lang.Object
uk.co.caprica.vlcj.player.base.Marquee

public final class Marquee extends Object
Builder for a Marquee.

Use like this, with a static import of marquee():

   marquee()
     .opacity(200)
     .position(MarqueePosition.BOTTOM)
     .colour(Color.white)
     .timeout(5000)
     .text("vlcj is just great")
     .size(20)
     .enable()
     .apply(mediaPlayer)
   ;
 
  • Method Details

    • marquee

      public static Marquee marquee()
      Create a marquee.
      Returns:
      marquee
    • text

      public Marquee text(String text)
      Apply the text.

      Format variables are available:

       Time related:
        %Y = year
        %d = day
        %H = hour
        %M = minute
        %S = second
       
      See http://wiki.videolan.org/index.php?title=Documentation:Modules/marq.

      If you want to use new-lines in the marquee text make sure you use the "\r\n" escape sequence - "\n" on its own will not work.

      Parameters:
      text - text
      Returns:
      this
    • colour

      public Marquee colour(Color colour)
      Apply the text colour.
      Parameters:
      colour - text colour
      Returns:
      this
    • colour

      public Marquee colour(int rgb)
      Apply the text colour as RGB components.
      Parameters:
      rgb - integer encoded red, green, blue colour components
      Returns:
      this
    • opacity

      public Marquee opacity(int opacity)
      Apply the text opacity.
      Parameters:
      opacity - opacity, 0 to 255, where 255 is fully opaque
      Returns:
      this
    • opacity

      public Marquee opacity(float opacity)
      Apply the text opacity.
      Parameters:
      opacity - opacity, 0.0 to 1.0, where 1.0 is fully opaque
      Returns:
      this
    • size

      public Marquee size(int size)
      Apply the text size.
      Parameters:
      size - text size
      Returns:
      this
    • timeout

      public Marquee timeout(int timeout)
      Apply the timeout.

      The marquee will be removed when the timeout expires.

      Parameters:
      timeout - timeout, in milliseconds
      Returns:
      this
    • location

      public Marquee location(int x, int y)
      Apply the text location in video co-ordinates.
      Parameters:
      x - x ordinate
      y - y ordinate
      Returns:
      this
    • position

      public Marquee position(MarqueePosition position)
      Apply the text position.
      Parameters:
      position - predefined text position
      Returns:
      this
    • refresh

      public Marquee refresh(int refresh)
      Set the time before the marquee text will refresh.
      Parameters:
      refresh - refresh time, milliseconds
      Returns:
      this
    • enable

      public Marquee enable(boolean enable)
      Apply the initial enabled/disabled state.
      Parameters:
      enable - true to enable the marquee; false to disable it
      Returns:
      this
    • enable

      public Marquee enable()
      Enable the marquee.
      Returns:
      this
    • disable

      public Marquee disable()
      Disable the marquee.
      Returns:
      this
    • getText

      public String getText()
      Get the text.
      Returns:
      text
    • getColour

      public Color getColour()
      Get the colour if set as Color.
      Returns:
      colour
    • getRgb

      public Integer getRgb()
      Get the colour if set as RGB.
      Returns:
      RGB
    • getIntegerOpacity

      public Integer getIntegerOpacity()
      Get the opacity if set as integer.
      Returns:
      opacity
    • getFloatOpacity

      public Float getFloatOpacity()
      Get the opacity if set as float.
      Returns:
      opacity
    • getSize

      public Integer getSize()
      Get the text size.
      Returns:
      text size
    • getTimeout

      public Integer getTimeout()
      Get the timeout.
      Returns:
      timeout
    • getX

      public Integer getX()
      Get the location x co-ordinate.
      Returns:
      location x
    • getY

      public Integer getY()
      Get the location y co-ordinate.
      Returns:
      location y
    • getPosition

      public MarqueePosition getPosition()
      Get the position.
      Returns:
      position
    • getRefresh

      public Integer getRefresh()
      Get the text refresh.
      Returns:
      refresh time, milliseconds
    • getEnable

      public boolean getEnable()
      Get the enabled flag.
      Returns:
      enabled/disabled
    • apply

      public void apply(MediaPlayer mediaPlayer)
      Apply the marquee to the media player.
      Parameters:
      mediaPlayer - media player
    • toString

      public String toString()
      Overrides:
      toString in class Object