20 package net.sf.gridarta.gui.panel.selectedsquare;
22 import java.awt.Component;
23 import javax.swing.BorderFactory;
24 import javax.swing.DefaultListCellRenderer;
25 import javax.swing.Icon;
26 import javax.swing.JList;
31 import org.jetbrains.annotations.NotNull;
73 public Component
getListCellRendererComponent(
final JList<?> list,
final Object value,
final int index,
final boolean isSelected,
final boolean cellHasFocus) {
74 super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
83 setIcon(faceObjectProviders.getFace(arch));
86 setIcon(unknownSquareIcon);
102 setBorder(BorderFactory.createEmptyBorder(0, indent * INDENT_PIXELS, 0, 0));
T getHead()
Return the head part of a multi-part object.
Component getListCellRendererComponent(final JList<?> list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus)
G getContainerGameObject()
Returns the environment game object if this game object is in the inventory or.
CellRenderer for rendering ArchObjects on a certain map square in a list.
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
Base package of all Gridarta classes.
static final long serialVersionUID
Serial Version UID.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
final Icon unknownSquareIcon
The Icon for unknown squares.
static final int INDENT_PIXELS
The number of pixels to indent inventory items.
String getBestName()
Returns the name which is best appropriate to describe this GameObject.
CellRenderer(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final Icon unknownSquareIcon)
Creates a new instance.
Provider for faces of GameObjects and Archetypes.
The face is the appearance of an object.
Interface for MapArchObjects.