Crossfire JXClient, Trunk
|
Public Member Functions | |
void | addLocationListener (final int index, @NotNull final LocationListener locationListener) |
void | addLocationsListener (@NotNull final LocationsListener locationsListener) |
void | removeLocationListener (final int index, @NotNull final LocationListener locationListener) |
void | removeLocationsListener (@NotNull final LocationsListener locationsListener) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.items.ItemView | |
CfItem | getItem (int index) |
int | getSize () |
Protected Member Functions | |
AbstractItemView () | |
void | addModified (final int index) |
void | addModifiedRange (final int firstIndex, final int lastIndex) |
Private Member Functions | |
void | deliverEvents () |
void | fireEvents () |
Private Attributes | |
final EventScheduler | fireEventScheduler = new EventScheduler(100, 1, this::deliverEvents) |
final IndexedEventListenerList< LocationListener > | locationListeners = new IndexedEventListenerList<>() |
final EventListenerList2< LocationsListener > | locationsListeners = new EventListenerList2<>() |
final Collection< Integer > | modifiedSlots = new HashSet<>() |
final Object | sync = new Object() |
Abstract base class for ItemView implementing classes.
Definition at line 35 of file AbstractItemView.java.
|
protected |
Creates a new instance.
Definition at line 74 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.fireEventScheduler, and com.realtime.crossfire.jxclient.items.EventScheduler.start().
void com.realtime.crossfire.jxclient.items.AbstractItemView.addLocationListener | ( | final int | index, |
@NotNull final LocationListener | locationListener | ||
) |
Adds a LocationListener to be notified when the item displayed in a floor slot has changed.
index | the floor slot |
locationListener | the location listener to add |
Implements com.realtime.crossfire.jxclient.items.ItemView.
Definition at line 89 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.locationListeners.
void com.realtime.crossfire.jxclient.items.AbstractItemView.addLocationsListener | ( | @NotNull final LocationsListener | locationsListener | ) |
Adds a LocationsListener to be notified when any displayed item has changed.
locationsListener | the locations listener to add |
Implements com.realtime.crossfire.jxclient.items.ItemView.
Definition at line 79 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.locationsListeners.
|
protected |
Marks a slot as modified.
index | the modified slot index |
Definition at line 116 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.fireEvents(), com.realtime.crossfire.jxclient.items.AbstractItemView.modifiedSlots, and com.realtime.crossfire.jxclient.items.AbstractItemView.sync.
|
protected |
Marks a range of slots as modified.
firstIndex | the first modified slot index |
lastIndex | the last modified slot index |
Definition at line 103 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.fireEvents(), com.realtime.crossfire.jxclient.items.AbstractItemView.modifiedSlots, and com.realtime.crossfire.jxclient.items.AbstractItemView.sync.
Referenced by com.realtime.crossfire.jxclient.items.InventoryView.doRebuildInventory(), com.realtime.crossfire.jxclient.items.KnowledgeTypeView.KnowledgeTypeView(), com.realtime.crossfire.jxclient.items.KnowledgeView.KnowledgeView(), com.realtime.crossfire.jxclient.items.QuestsView.rebuildList(), com.realtime.crossfire.jxclient.items.FloorView.setCurrentFloorTag(), com.realtime.crossfire.jxclient.items.SpellSkillView.SpellSkillView(), and com.realtime.crossfire.jxclient.items.SpellsView.SpellsView().
|
private |
Delivers all pending events.
Definition at line 126 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.locationListeners, com.realtime.crossfire.jxclient.items.AbstractItemView.locationsListeners, com.realtime.crossfire.jxclient.items.AbstractItemView.modifiedSlots, and com.realtime.crossfire.jxclient.items.AbstractItemView.sync.
|
private |
Delivers outstanding change events.
Definition at line 147 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.fireEventScheduler, and com.realtime.crossfire.jxclient.items.EventScheduler.trigger().
Referenced by com.realtime.crossfire.jxclient.items.AbstractItemView.addModified(), and com.realtime.crossfire.jxclient.items.AbstractItemView.addModifiedRange().
void com.realtime.crossfire.jxclient.items.AbstractItemView.removeLocationListener | ( | final int | index, |
@NotNull final LocationListener | locationListener | ||
) |
Removes a LocationListener to be notified when the item displayed in a floor slot has changed.
index | the floor slot |
locationListener | the location listener to remove |
Implements com.realtime.crossfire.jxclient.items.ItemView.
Definition at line 94 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.locationListeners.
void com.realtime.crossfire.jxclient.items.AbstractItemView.removeLocationsListener | ( | @NotNull final LocationsListener | locationsListener | ) |
Removes a LocationsListener to be notified when any displayed item has changed.
locationsListener | the locations listener to remove |
Implements com.realtime.crossfire.jxclient.items.ItemView.
Definition at line 84 of file AbstractItemView.java.
References com.realtime.crossfire.jxclient.items.AbstractItemView.locationsListeners.
|
private |
The event scheduler for delaying event generation. This is needed because the Crossfire server sends multiple item2 commands for one "get all" command.
Definition at line 69 of file AbstractItemView.java.
Referenced by com.realtime.crossfire.jxclient.items.AbstractItemView.AbstractItemView(), and com.realtime.crossfire.jxclient.items.AbstractItemView.fireEvents().
|
private |
The registered ItemListeners to be notified about changes.
Definition at line 49 of file AbstractItemView.java.
Referenced by com.realtime.crossfire.jxclient.items.AbstractItemView.addLocationListener(), com.realtime.crossfire.jxclient.items.AbstractItemView.deliverEvents(), and com.realtime.crossfire.jxclient.items.AbstractItemView.removeLocationListener().
|
private |
The registered LocationsListeners to be notified about changes.
Definition at line 42 of file AbstractItemView.java.
Referenced by com.realtime.crossfire.jxclient.items.AbstractItemView.addLocationsListener(), com.realtime.crossfire.jxclient.items.AbstractItemView.deliverEvents(), and com.realtime.crossfire.jxclient.items.AbstractItemView.removeLocationsListener().
|
private |
The pending modified floor slots to be reported to listeners.
Definition at line 55 of file AbstractItemView.java.
Referenced by com.realtime.crossfire.jxclient.items.AbstractItemView.addModified(), com.realtime.crossfire.jxclient.items.AbstractItemView.addModifiedRange(), and com.realtime.crossfire.jxclient.items.AbstractItemView.deliverEvents().
|
private |
The synchronization object for accesses to modifiedSlots.
Definition at line 61 of file AbstractItemView.java.
Referenced by com.realtime.crossfire.jxclient.items.AbstractItemView.addModified(), com.realtime.crossfire.jxclient.items.AbstractItemView.addModifiedRange(), and com.realtime.crossfire.jxclient.items.AbstractItemView.deliverEvents().