Class MessageBufferUpdater


  • public class MessageBufferUpdater
    extends java.lang.Object
    Adds drawinfo, drawextinfo, and query messages to a Buffer instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int NUM_COLORS
      The number of supported colors.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Releases resources.
      static @NotNull java.lang.String getColorName​(int index)
      Returns the name of a color index.
      void setColor​(int index, @NotNull java.awt.Color color)
      Sets a color mapping.
      void setTypes​(int types)
      Sets the message types to show.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NUM_COLORS

        public static final int NUM_COLORS
        The number of supported colors.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageBufferUpdater

        public MessageBufferUpdater​(@NotNull
                                    @NotNull CrossfireServerConnection crossfireServerConnection,
                                    @NotNull
                                    @NotNull Buffer buffer,
                                    @NotNull
                                    @NotNull java.awt.Color defaultColor)
        Creates a new instance.
        Parameters:
        crossfireServerConnection - the connection instance
        buffer - the buffer to update
        defaultColor - the default color to use for undefined colors indices
    • Method Detail

      • dispose

        public void dispose()
        Releases resources.
      • getColorName

        @NotNull
        public static @NotNull java.lang.String getColorName​(int index)
        Returns the name of a color index.
        Parameters:
        index - the color index
        Returns:
        the color name
      • setColor

        public void setColor​(int index,
                             @NotNull
                             @NotNull java.awt.Color color)
        Sets a color mapping.
        Parameters:
        index - the color index to change
        color - the color to map to
      • setTypes

        public void setTypes​(int types)
        Sets the message types to show.
        Parameters:
        types - the types to show