public abstract class AbstractItemView extends java.lang.Object implements ItemView
ItemView
implementing classes.Modifier and Type | Field and Description |
---|---|
private java.lang.Runnable |
fireEventCallback
The event scheduler callback for delaying event generation.
|
private EventScheduler |
fireEventScheduler
The
EventScheduler for delaying event generation. |
private IndexedEventListenerList<LocationListener> |
locationListeners
The registered
ItemListeners to be notified about
changes. |
private EventListenerList2<LocationsListener> |
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 . |
Modifier | Constructor and Description |
---|---|
protected |
AbstractItemView()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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. |
@NotNull private final java.lang.Runnable fireEventCallback
@NotNull private final EventScheduler fireEventScheduler
EventScheduler
for delaying event generation.@NotNull private final IndexedEventListenerList<LocationListener> locationListeners
ItemListeners
to be notified about
changes.@NotNull private final EventListenerList2<LocationsListener> 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
.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