Interface BoardViewTooltipProvider

All Known Implementing Classes:
BoardEditorTooltip, SBFBoardViewTooltip, TWBoardViewTooltip

public interface BoardViewTooltipProvider
This interface is implemented by classes that can be added to a BoardView to provide the tooltip contents for the BoardView.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns a String that is displayed as the tooltip for a point according to the mouse event's point in the BoardView's drawing area.
    default String
    getTooltip(MouseEvent event, Coords movementTarget)
    Returns a String that is displayed as the tooltip for a point according to the mouse event's point in the BoardView's drawing area.
    getTooltip(Point point, Coords movementTarget)
    Returns a String that is displayed as the tooltip for the given point in the BoardView's drawing area.
  • Method Details

    • getTooltip

      default String getTooltip(MouseEvent event)
      Returns a String that is displayed as the tooltip for a point according to the mouse event's point in the BoardView's drawing area. The String may be an HTML string. It is passed to Swing's TooltipManager without further modification, i.e. if it is an HTML string all tags must already be present. This method forwards to getTooltip(Point, Coords) and should not be overridden.
      Parameters:
      event - A mouse event associated with a position in the BoardView
      Returns:
      The tooltip to display
    • getTooltip

      default String getTooltip(MouseEvent event, @Nullable Coords movementTarget)
      Returns a String that is displayed as the tooltip for a point according to the mouse event's point in the BoardView's drawing area. The String may be an HTML string. It is passed to Swing's TooltipManager without further modification, i.e. if it is an HTML string all tags must already be present. The String may also be null to show no tooltip at all. The given movementTarget coordinates may be used to display information about another hex or field in that BoardView. This method forwards to getTooltip(Point, Coords) and should not be overridden.
      Parameters:
      event - A mouse event associated with a position in the BoardView
      movementTarget - Another coordinate to display additional information about
      Returns:
      The tooltip to display
    • getTooltip

      String getTooltip(Point point, @Nullable Coords movementTarget)
      Returns a String that is displayed as the tooltip for the given point in the BoardView's drawing area. The String may be an HTML string. It is passed to Swing's TooltipManager without further modification, i.e. if it is an HTML string all tags must already be present. The given movementTarget coordinates may be used to display information about another hex or field in that BoardView.
      Parameters:
      point - The point in the BoardView's drawing area as returned e.g. with a MouseEvent
      movementTarget - Another coordinate to display additional information about
      Returns:
      The tooltip to display