 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.panel.connectionview;
22 import java.awt.Component;
23 import java.util.Collection;
24 import java.util.TreeSet;
25 import javax.swing.DefaultListCellRenderer;
26 import javax.swing.JList;
28 import org.jetbrains.annotations.NotNull;
36 public abstract class CellRenderer<K>
extends DefaultListCellRenderer {
46 private final StringBuilder
sbForFormat =
new StringBuilder();
51 private final Collection<String>
names =
new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
61 super.getListCellRendererComponent(
list, value, index, isSelected, cellHasFocus);
89 protected abstract String
formatKey(@NotNull K key);
final Collection< String > names
Used for sorting game object names.
final StringBuilder sbForFormat
The StringBuilder used to format entries.
Base package of all Gridarta classes.
This document describes some hints and requirements for general development on the CrossfireEditor If you plan to make changes to the editor code or setup please read the following and keep it in derived from a basic editor application called Gridder by Pasi Ker�nen so please communicate with best through the cf devel mailing list
abstract String formatValue(@NotNull BaseObject<?, ?, ?, ?> gameObject)
Returns a string representation for a value.
Component getListCellRendererComponent(final JList<?> list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus)
K getKey()
Returns the key.
CellRenderer()
Creates a new instance.
Stores GameObjects related to key values.
abstract String formatKey(@NotNull K key)
Returns a string representation for a key.
A DefaultListCellRenderer for rendering Connection objects in a list.
static final long serialVersionUID
Serial Version UID.