Class DefaultBuffer

java.lang.Object
com.realtime.crossfire.jxclient.gui.log.Buffer
com.realtime.crossfire.jxclient.gui.log.DefaultBuffer

public class DefaultBuffer extends Buffer
Default Buffer implementation.
  • Constructor Details

    • DefaultBuffer

      protected DefaultBuffer(@NotNull @NotNull Fonts fonts, @NotNull @NotNull FontRenderContext context, int renderWidth)
      Creates a new instance.
      Parameters:
      fonts - the Fonts instance for looking up fonts
      context - the FontRenderContext to use
      renderWidth - the width to render
  • Method Details

    • newTextSegment

      @NotNull protected @NotNull TextSegment newTextSegment(@NotNull @NotNull String text, boolean bold, boolean italic, boolean underline, @NotNull @NotNull FontID fontID, @NotNull @NotNull Color color, @NotNull @NotNull Color selectionColor)
      Description copied from class: Buffer
      Creates a new segment.
      Specified by:
      newTextSegment in class Buffer
      Parameters:
      text - the text to display
      bold - whether bold face is enabled
      italic - whether italic face is enabled
      underline - whether underlining is enabled
      fontID - the font to use
      color - the color to use
      selectionColor - the selection color to use
      Returns:
      the new segment
    • getSegmentWidth

      protected int getSegmentWidth(@NotNull @NotNull TextSegment segment, int characters)
      Description copied from class: Buffer
      Returns the width of a prefix of a TextSegment.
      Specified by:
      getSegmentWidth in class Buffer
      Parameters:
      segment - the text segment
      characters - the number of characters in the prefix
      Returns:
      the width in pixels