java.lang.Object com.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 ItemListener s to be notified about changes. |
private javax.swing.event.EventListenerList |
locationsListeners
The registered LocationsListener s 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
ItemListener
s to be notified about changes.
@NotNull private final javax.swing.event.EventListenerList locationsListeners
LocationsListener
s 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 ItemView
index
- the floor slotlocationListener
- the location listener to addpublic void addLocationsListener(@NotNull LocationsListener locationsListener)
LocationsListener
to be notified when any displayed item
has changed.
addLocationsListener
in interface ItemView
locationsListener
- the locations listener to addprotected void addModified(int index)
index
- the modified slot indexprotected 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 ItemView
index
- the floor slotlocationListener
- the location listener to removepublic void removeLocationsListener(@NotNull LocationsListener locationsListener)
LocationsListener
to be notified when any displayed
item has changed.
removeLocationsListener
in interface ItemView
locationsListener
- the locations listener to remove