use of main.swing.generic.components.editors.lists.GenericListChooser.LC_MODS in project Eidolons by IDemiurge.
the class ListObjRenderer method getListCellRendererComponent.
@Override
public Component getListCellRendererComponent(JList<? extends String> list, String value, int index, boolean isSelected, boolean cellHasFocus) {
if (TYPE == null) {
return getLabel(value, isSelected);
}
Entity type = null;
if (value != null) {
type = DataManager.getType(value.toString(), TYPE);
}
if (type == null) {
return new JLabel(value.toString());
}
ListItem<Entity> item = new ListItem<>(type, isSelected, cellHasFocus, 0);
// item.setIcon(ListRenderer.getCompIcon(type, isSelected));
if (mods != null) {
Component component = item;
for (LC_MODS sub : mods) {
switch(sub) {
case TEXT_DISPLAYED:
component = SwingMaster.decorateWithText(type.getName(), Color.black, component, "pos 0 20");
break;
default:
break;
}
}
return component;
}
return item;
}