 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.dialog.goexit;
22 import java.awt.Component;
23 import java.awt.Point;
24 import java.util.Comparator;
25 import javax.swing.DefaultListCellRenderer;
26 import javax.swing.JList;
31 import org.jetbrains.annotations.NotNull;
32 import org.jetbrains.annotations.Nullable;
39 public class MapListCellRenderer extends DefaultListCellRenderer implements Comparator<GameObject<?, ?, ?>> {
63 super.getListCellRendererComponent(
list, value, index, isSelected, cellHasFocus);
68 final StringBuilder sb =
new StringBuilder();
69 sb.append(gameObject.getBestName());
71 if (mapLocation ==
null) {
77 sb.append(mapCoordinate.x);
79 sb.append(mapCoordinate.y);
82 setText(sb.toString());
102 final String name1 = o1.getBestName();
103 final String name2 = o2.getBestName();
104 final int cmp1 = name1.compareToIgnoreCase(name2);
111 if (mapLocation1 ==
null) {
112 if (mapLocation2 !=
null) {
115 }
else if (mapLocation2 ==
null) {
118 final int cmp2 = mapLocation1.
compareTo(mapLocation2);
124 final String faceObjName1 = o1.getFaceObjName();
125 final String faceObjName2 = o2.getFaceObjName();
126 if (faceObjName1 ==
null) {
127 if (faceObjName2 !=
null) {
130 }
else if (faceObjName2 ==
null) {
133 final int cmp3 = faceObjName1.compareTo(faceObjName2);
MapPath getMapPath()
Returns the map path.
int compareTo(@NotNull final MapLocation o)
A net.sf.gridarta.gui.panel.connectionview.CellRenderer for the locked items view.
Base package of all Gridarta classes.
Component getListCellRendererComponent(final JList<?> list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus)
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
Provider for faces of GameObjects and Archetypes.
Reflects a game object (object on a map).
Point getMapCoordinate()
Returns the map coordinate.
static final long serialVersionUID
The serial version UID.
GameObjects are the objects based on Archetypes found on maps.
static MapLocation newAbsoluteMapLocation(@NotNull final GameObject<?, ?, ?> gameObject, final boolean allowRandomMapParameters)
Creates a new instance from a BaseObject instance.
MapListCellRenderer(@NotNull final FaceObjectProviders faceObjectProviders)
Creates a new instance.
static MapLocation getMapLocation(@NotNull final GameObject<?, ?, ?> gameObject)
Returns the MapLocation for a GameObject.
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
Exception thrown if a game object does not specify a valid exit path.
int compare(final GameObject<?, ?, ?> o1, final GameObject<?, ?, ?> o2)
Represents a location on a map consisting of a map path and a map coordinate.
public< G extends GameObject< G, A, R >, A extends MapArchObject< A >, R extends Archetype< G, A, R > > ImageIcon getFace(@NotNull final BaseObject< G, A, R, ?> baseObject)
Returns the face of a BaseObject as an ImageIcon.
The face is the appearance of an object.