java.lang.Objectcom.realtime.crossfire.jxclient.items.AbstractItemView
public abstract class AbstractItemView
Abstract base class for ItemView implementing classes.
| Field Summary | |
|---|---|
private java.lang.Runnable |
fireEventCallback
The event scheduler callback for delaying event generation. |
private EventScheduler |
fireEventScheduler
The EventScheduler for delaying event generation. |
private IndexedEventListenerList |
locationListeners
The registered ItemListeners to be notified about changes. |
private javax.swing.event.EventListenerList |
locationsListeners
The registered LocationsListeners to be notified about changes. |
private java.util.Collection<java.lang.Integer> |
modifiedSlots
The pending modified floor slots to be reported to listeners. |
private java.lang.Object |
sync
The synchronization object for accesses to modifiedSlots. |
| Constructor Summary | |
|---|---|
protected |
AbstractItemView()
Creates a new instance. |
| Method Summary | |
|---|---|
void |
addLocationListener(int index,
LocationListener locationListener)
Adds a LocationListener to be notified when the item displayed in
a floor slot has changed. |
void |
addLocationsListener(LocationsListener locationsListener)
Adds a LocationsListener to be notified when any displayed item
has changed. |
protected void |
addModified(int index)
Marks a slot as modified. |
protected void |
addModifiedRange(int firstIndex,
int lastIndex)
Marks a range of slots as modified. |
private void |
deliverEvents()
Delivers all pending events. |
private void |
fireEvents()
Delivers outstanding change events. |
void |
removeLocationListener(int index,
LocationListener locationListener)
Removes a LocationListener to be notified when the item displayed
in a floor slot has changed. |
void |
removeLocationsListener(LocationsListener locationsListener)
Removes a LocationsListener to be notified when any displayed
item has changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.realtime.crossfire.jxclient.items.ItemView |
|---|
getItem, getSize |
| Field Detail |
|---|
@NotNull private final java.lang.Runnable fireEventCallback
@NotNull private final EventScheduler fireEventScheduler
EventScheduler for delaying event generation.
@NotNull private final IndexedEventListenerList locationListeners
ItemListeners to be notified about changes.
@NotNull private final javax.swing.event.EventListenerList locationsListeners
LocationsListeners to be notified about changes.
@NotNull private final java.util.Collection<java.lang.Integer> modifiedSlots
@NotNull private final java.lang.Object sync
modifiedSlots.
| Constructor Detail |
|---|
protected AbstractItemView()
| Method Detail |
|---|
public void addLocationListener(int index,
@NotNull
LocationListener locationListener)
LocationListener to be notified when the item displayed in
a floor slot has changed.
addLocationListener in interface ItemViewindex - the floor slotlocationListener - the location listener to add
public void addLocationsListener(@NotNull
LocationsListener locationsListener)
LocationsListener to be notified when any displayed item
has changed.
addLocationsListener in interface ItemViewlocationsListener - the locations listener to addprotected void addModified(int index)
index - the modified slot index
protected void addModifiedRange(int firstIndex,
int lastIndex)
firstIndex - the first modified slot indexlastIndex - the last modified slot indexprivate void deliverEvents()
private void fireEvents()
public void removeLocationListener(int index,
@NotNull
LocationListener locationListener)
LocationListener to be notified when the item displayed
in a floor slot has changed.
removeLocationListener in interface ItemViewindex - the floor slotlocationListener - the location listener to remove
public void removeLocationsListener(@NotNull
LocationsListener locationsListener)
LocationsListener to be notified when any displayed
item has changed.
removeLocationsListener in interface ItemViewlocationsListener - the locations listener to remove