Class ItemPainter

java.lang.Object
com.realtime.crossfire.jxclient.gui.item.ItemPainter

public class ItemPainter extends Object
Paints Crossfire item images.
  • Constructor Details

    • ItemPainter

      public ItemPainter(@Nullable @Nullable Image cursedImage, @Nullable @Nullable Image damnedImage, @Nullable @Nullable Image magicImage, @Nullable @Nullable Image blessedImage, @Nullable @Nullable Image appliedImage, @Nullable @Nullable Image unidentifiedImage, @Nullable @Nullable Image selectorImage, @Nullable @Nullable Image lockedImage, @Nullable @Nullable Image unpaidImage, @Nullable @Nullable Image markedImage, @Nullable @Nullable Color cursedColor, @Nullable @Nullable Color damnedColor, @Nullable @Nullable Color magicColor, @Nullable @Nullable Color blessedColor, @Nullable @Nullable Color appliedColor, @Nullable @Nullable Color unidentifiedColor, @Nullable @Nullable Color selectorColor, @Nullable @Nullable Color lockedColor, @Nullable @Nullable Color unpaidColor, @Nullable @Nullable Color markedColor, @NotNull @NotNull Font font, @NotNull @NotNull Color nrofColor)
      Creates a new instance.
      Parameters:
      cursedImage - the overlay image for cursed objects
      damnedImage - the overlay image for damned objects
      magicImage - the overlay image for magical objects
      blessedImage - the overlay image for blessed objects
      appliedImage - the overlay image for applied objects
      unidentifiedImage - the overlay image for unidentified objects
      selectorImage - the overlay image for selected objects
      lockedImage - the overlay image for locked objects
      unpaidImage - the overlay image for unpaid objects
      markedImage - the overlay image for marked objects
      cursedColor - the background color for cursed objects
      damnedColor - the background color for damned objects
      magicColor - the background color for magical objects
      blessedColor - the background color for blessed objects
      appliedColor - the background color for applied objects
      unidentifiedColor - the background color for unidentified objects
      selectorColor - the background color for selected objects
      lockedColor - the background color for locked objects
      unpaidColor - the background color for unpaid objects
      markedColor - the background color for marked objects
      font - the font for nrof information
      nrofColor - the color for nrof information
  • Method Details

    • newItemPainter

      @NotNull public @NotNull ItemPainter newItemPainter()
      Creates a new instance having the same parameters as this instance except for the item's size.
      Returns:
      the new instance
    • getMinimumSize

      @NotNull public @NotNull Dimension getMinimumSize()
      Returns the minimal size needed to display this item.
      Returns:
      the minimal size
    • paint

      public void paint(@NotNull @NotNull Graphics2D g, @NotNull @NotNull CfItem item, boolean selected, @NotNull @NotNull Image face, int w, int h)
      Paints an CfItem.
      Parameters:
      g - the graphics instance to paint into
      item - the item
      selected - whether the item is selected
      face - the item's face
      w - the item's width in pixel
      h - the item's height in pixel