Class TipOfTheDay

java.lang.Object
megamek.common.util.TipOfTheDay

public class TipOfTheDay extends Object
  • Constructor Details

    • TipOfTheDay

      public TipOfTheDay(String title, String bundleName, Component referenceComponent)
      Constructor for TipOfTheDay
      Parameters:
      bundleName - The name of the resource bundle containing the tips
      referenceComponent - A component to determine scaling
  • Method Details

    • startCycling

      public void startCycling()
      Starts the tip cycling animation
    • stopCycling

      public void stopCycling()
      Stops the tip cycling animation
    • getCurrentAlpha

      @Deprecated(since="0.51.0", forRemoval=true) public float getCurrentAlpha()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the current alpha value for fade animations
    • isVisible

      public boolean isVisible()
      Returns whether the tip is currently visible
    • setVisible

      public void setVisible(boolean visible)
      Sets the visibility of the tip
    • updateScaleFactor

      public void updateScaleFactor(Component referenceComponent)
      Updates the scale factor and adjusts the font sizes accordingly.
      Parameters:
      referenceComponent - A component to determine scaling
    • getTodaysTip

      @Deprecated(since="0.51.0", forRemoval=true) public String getTodaysTip()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the tip for today based on the current date
      Returns:
      A tip string for today
    • getRandomTip

      public String getRandomTip()
      Gets a random tip from the list
      Returns:
      A random tip string
    • drawTipOfTheDay

      @Deprecated(since="0.51.0", forRemoval=true) public void drawTipOfTheDay(Graphics2D graphics2D, Rectangle referenceBounds, TipOfTheDay.Position position)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Draws the Tip of the Day text with word wrap and styling.
      Parameters:
      graphics2D - The Graphics2D object to draw on
      referenceBounds - The bounds of the reference component
      position - The position of the tip (BOTTOM_BORDER, etc.)
    • drawTipOfTheDay

      public void drawTipOfTheDay(Graphics2D graphics2D, Rectangle referenceBounds, TipOfTheDay.Position position, boolean useRadialGradient)
      Draws the Tip of the Day text with word wrap and styling.
      Parameters:
      graphics2D - The Graphics2D object to draw on
      referenceBounds - The bounds of the reference component
      position - The position of the tip (BOTTOM_BORDER, etc.)
      useRadialGradient - Whether to use a radial gradient for the background (only for corners)