Crossfire JXClient, Trunk
|
Classes | |
class | Rec |
Public Member Functions | |
boolean | canMoveSelection (final int diffLines, final int diffElements) |
boolean | canScroll (final int distance) |
void | dispose () |
void | execute () |
T | getElement (final int index) |
Dimension | getMaximumSize () |
Dimension | getMinimumSize () |
Dimension | getPreferredSize () |
TooltipText | getTooltip () |
void | mouseClicked (@NotNull final MouseEvent e) |
void | mouseDragged (@NotNull final MouseEvent e) |
void | mouseEntered (@NotNull final MouseEvent e) |
void | mouseExited (@NotNull final MouseEvent e) |
void | mouseMoved (@NotNull final MouseEvent e) |
void | mousePressed (@NotNull final MouseEvent e) |
void | mouseWheelMoved (final int wheelRotation) |
void | moveSelection (final int diffLines, final int diffElements) |
void | resetScroll () |
void | scroll (final int distance) |
void | setBounds (final int x, final int y, final int width, final int height) |
void | setChanged () |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement | |
void | activateNextElement () |
void | activatePrevElement () |
boolean | isActive () |
void | setActive (final boolean active) |
void | setNextActive (@NotNull final ActivatableGUIElement next) |
void | setPrevActive (@NotNull final ActivatableGUIElement prev) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement | |
int | getDialogBorderBottom () |
int | getDialogBorderLeft () |
int | getDialogBorderRight () |
int | getDialogBorderTop () |
String | getName () |
void | inhibitListeners () |
boolean | isDefault () |
boolean | isIgnore () |
void | mouseReleased (@NotNull final MouseEvent e) |
void | setChangedListener (@Nullable final GUIElementChangedListener changedListener) |
void | setDefault (final boolean isDefault) |
void | setIgnore () |
String | toString () |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.GUIElement | |
void | notifyOpen () |
Protected Member Functions | |
void | addElement (@NotNull final T element) |
Object | getSelectedObject () |
abstract String | getTooltip (final int index) |
GUIList (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final int cellWidth, final int cellHeight, @NotNull final GUIListCellRenderer< T > listCellRenderer, @Nullable final CommandList doubleClickCommandList, @NotNull final GuiFactory guiFactory) | |
int | resizeElements (final int newSize) |
void | selectionChanged () |
abstract void | selectionChanged (final int selectedIndex) |
void | setLayoutOrientation (final int layoutOrientation, final int visibleRowCount) |
void | setSelectedIndex (final int newIndex) |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement | |
ActivatableGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory) | |
abstract void | activeChanged () |
void | markInactivePending () |
void | setInactiveIfPending () |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement | |
AbstractGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory) | |
TooltipText | newTooltipText (@Nullable final String tooltipText) |
void | tooltipChanged () |
Private Member Functions | |
void | doSelect (@NotNull final MouseEvent e) |
void | doTooltip (@NotNull final MouseEvent e) |
Rec | getIndex (@NotNull final MouseEvent e) |
Private Attributes | |
final int | cellHeight |
final CommandList | doubleClickCommandList |
final GuiFactory | guiFactory |
final JList< T > | list = new JList<>(model) |
final GUIListCellRenderer<? extends T > | listCellRenderer |
final ListSelectionListener | listSelectionListener = e -> selectionChanged() |
final DefaultListModel< T > | model = new DefaultListModel<>() |
final JScrollPane | scrollPane |
int | tooltipIndex = -1 |
Rectangle | tooltipRectangle |
final GUIListViewport | viewport = new GUIListViewport() |
Static Private Attributes | |
static final long | serialVersionUID = 1 |
A GUIElement that displays a list of entries.
<T> | the type of the list elements |
Definition at line 56 of file GUIList.java.
|
protected |
Creates a new instance.
tooltipManager | the tooltip manager to update |
elementListener | the element listener to notify |
name | the name of this element |
cellWidth | the width of each cell |
cellHeight | the height of each cell |
listCellRenderer | the renderer for the list |
doubleClickCommandList | the command list to execute on double-click or null
|
guiFactory | the global GUI factory instance |
Definition at line 141 of file GUIList.java.
|
protected |
Adds an GUIElement to the list.
element | the element to add |
Definition at line 195 of file GUIList.java.
boolean com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.canMoveSelection | ( | final int | diffLines, |
final int | diffElements | ||
) |
Returns whether the selection can be moved.
diffLines | the distance in lines to move |
diffElements | the distance in elements to move |
Definition at line 239 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.commands.MoveSelectionCommand.canExecute(), and com.realtime.crossfire.jxclient.gui.commands.MoveSelectionCommand.execute().
boolean com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.canScroll | ( | final int | distance | ) |
Returns whether the list can be scrolled.
distance | the distance to scroll |
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 306 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.commands.MoveSelectionCommand.canExecute().
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.dispose | ( | ) |
Releases all allocated resources.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 173 of file GUIList.java.
|
private |
Selects the list entry corresponding to a MouseEvent instance.
e | the mouse event instance |
Definition at line 439 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseClicked(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseDragged(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mousePressed().
|
private |
Updates the tooltip text corresponding to a MouseEvent instance.
e | the mouse event instance |
Definition at line 452 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseEntered(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseExited(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseMoved().
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.execute | ( | ) |
Executes the actions associated with this GUI element. Does nothing if this element has no associated actions.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.
Definition at line 558 of file GUIList.java.
T com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.getElement | ( | final int | index | ) |
Returns the GUIElement for a given index.
index | the index |
Definition at line 187 of file GUIList.java.
|
private |
Returns the list item from a mouse event.
e | the mouse event |
Definition at line 474 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.doSelect(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.doTooltip().
Dimension com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.getMaximumSize | ( | ) |
Definition at line 608 of file GUIList.java.
Dimension com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.getMinimumSize | ( | ) |
Definition at line 602 of file GUIList.java.
Dimension com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.getPreferredSize | ( | ) |
Definition at line 596 of file GUIList.java.
|
protected |
Returns the selected list object.
Definition at line 588 of file GUIList.java.
TooltipText com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.getTooltip | ( | ) |
Returns the current tooltip text.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 536 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getTooltip().
|
abstractprotected |
Returns the tooltip text.
index | the index to use |
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mouseClicked | ( | @NotNull final MouseEvent | e | ) |
Will be called when the user has clicked (pressed+released) this element. This event will be delivered after mouseReleased(MouseEvent).
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 379 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mouseDragged | ( | @NotNull final MouseEvent | e | ) |
Will be called when the mouse moves within this component while the button is pressed. This event will be delivered after mouseMoved(MouseEvent).
Note: if the mouse leaves this element's bounding box while the mouse button is still pressed, further
(but no
) events will be generated.
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 422 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mouseEntered | ( | @NotNull final MouseEvent | e | ) |
Will be called when the mouse has entered the bounding box of this element.
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 390 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mouseExited | ( | @NotNull final MouseEvent | e | ) |
Will be called when the mouse has left the bounding box of this element. This function will not be called unless mouseEntered(MouseEvent) has been called before.
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 398 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mouseMoved | ( | @NotNull final MouseEvent | e | ) |
Will be called when the mouse moves within this component. before.
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 414 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mousePressed | ( | @NotNull final MouseEvent | e | ) |
Will be called when the user has pressed the mouse inside this element.
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.
Definition at line 406 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.mouseWheelMoved | ( | final int | wheelRotation | ) |
Will be called when the mouse wheel has been moved.
wheelRotation | the movement amount; negative=away from the user, positive=towards the user |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 430 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.moveSelection | ( | final int | diffLines, |
final int | diffElements | ||
) |
Moves the selection.
diffLines | the distance in lines to move |
diffElements | the distance in elements to move |
Definition at line 269 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.commands.MoveSelectionCommand.execute().
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.resetScroll | ( | ) |
Resets the scroll index to the default value.
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 374 of file GUIList.java.
|
protected |
Changes the number of list elements. If the new element count is less than the current count, excess elements are cut off. Otherwise, the caller has to add elements with addElement(GUIElement).
newSize | the new element count |
Definition at line 212 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.dispose().
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.scroll | ( | final int | distance | ) |
Moves the list.
distance | the distance to scroll |
Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.
Definition at line 325 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.commands.MoveSelectionCommand.execute(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseWheelMoved().
|
protected |
Called whenever the selected list entry has changed.
Definition at line 516 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.selectionChanged().
|
abstractprotected |
Called whenever the selected list entry has changed.
selectedIndex | the selected list entry |
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.setBounds | ( | final int | x, |
final int | y, | ||
final int | width, | ||
final int | height | ||
) |
Definition at line 613 of file GUIList.java.
void com.realtime.crossfire.jxclient.gui.list.GUIList< T extends GUIElement >.setChanged | ( | ) |
Records that the contents have changed and must be repainted.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 529 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.resizeElements(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.scroll(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.setSelectedIndex().
|
protected |
Sets the layout orientation. See JList#setLayoutOrientation(int) and JList#setVisibleRowCount(int).
layoutOrientation | the layout orientation |
visibleRowCount | the number of visible rows |
Definition at line 576 of file GUIList.java.
|
protected |
Update the selected list entry.
newIndex | the new selected list entry |
Definition at line 497 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.addElement(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.doSelect(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.moveSelection(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.resetScroll(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.resizeElements(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.scroll().
|
private |
The height of a list cell in pixels.
Definition at line 66 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.canMoveSelection(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.moveSelection(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.scroll(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.setBounds().
|
private |
The CommandList to execute on double-clicks or
to ignore double-clicks.
Definition at line 79 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.mouseClicked().
|
private |
The global GuiFactory instance.
Definition at line 85 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getTooltip(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList().
|
private |
The list used to display the cells.
Definition at line 97 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.addElement(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.canMoveSelection(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.dispose(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getIndex(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getMinimumSize(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getSelectedObject(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.moveSelection(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.resizeElements(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.scroll(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.selectionChanged(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.setLayoutOrientation(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.setSelectedIndex().
|
private |
The GUIListCellRenderer for the list.
Definition at line 72 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.setBounds().
|
private |
The ListSelectionListener attached to list.
Definition at line 127 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.dispose(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList().
|
private |
The list model of list.
Definition at line 91 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.addElement(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getElement(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.resizeElements().
|
private |
The scroll pane instance used to display the list.
Definition at line 109 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.canScroll(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList(), com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.scroll(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.setBounds().
|
staticprivate |
The serial version UID.
Definition at line 61 of file GUIList.java.
|
private |
The index of the currently shown tooltip. Set to
if no tooltip is shown.
Definition at line 115 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.doTooltip(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getTooltip().
|
private |
The location of the tooltip. Set to
if no tooltip is shown.
Definition at line 121 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.doTooltip(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.getTooltip().
|
private |
The viewport used by scrollPane.
Definition at line 103 of file GUIList.java.
Referenced by com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.addElement(), and com.realtime.crossfire.jxclient.gui.list.GUIList< GUICharacter >.GUIList().