 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.list;
36 import java.awt.Color;
37 import java.awt.Dimension;
39 import java.awt.Graphics;
40 import org.jetbrains.annotations.NotNull;
41 import org.jetbrains.annotations.Nullable;
109 index = defaultIndex;
114 throw new UnsupportedOperationException(
"Not supported yet.");
119 super.paintComponent(g);
120 g.setColor(
new Color(0, 0, 0, 0.0f));
121 g.fillRect(0, 0, getWidth(), getHeight());
125 if (character ==
null) {
133 final int y = (getHeight()+
font.getSize())/2;
137 g.drawString(character.
getName(), x, y);
139 g.drawString(character.
getRace(), x, y);
141 g.drawString(character.
getParty(), x, y);
143 g.drawString(character.
getMap(), x, y);
148 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
155 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
172 throw new UnsupportedOperationException(
"Not supported yet.");
177 throw new UnsupportedOperationException(
"Not supported yet.");
182 throw new UnsupportedOperationException(
"Not supported yet.");
198 if (this.index ==
index) {
Maintains a mapping of face numbers to face data.
void activeChanged()
Will be called whenever the active state has changed.
void tooltipChanged()
Must be called whenever the tooltip may have changed.
static final long serialVersionUID
The serial version UID.
ImageIcon getOriginalImageIcon(int faceNum, @Nullable AtomicBoolean returnIsUnknownImage)
Returns the "original" face for a face ID.
final CharacterModel characterModel
Character model to display items from.
void resetScroll()
Resets the scroll index to the default value.
CharacterInformation getEntry(final int index)
Returns a character entry by index.
void setChanged()
Records that the contents have changed and must be repainted.
int getIndex()
Returns the index of this element.
static Dimension getTextDimension(@NotNull final String text, @NotNull final FontMetrics fontMetrics)
Returns the extents of a string when rendered in a given Font on this component.
boolean canScroll(final int distance)
Returns whether scrolling is possible.
TooltipText getTooltip()
Returns the current tooltip text.
Dimension getMinimumSize()
A GUIElement that can be set to active or inactive.
Manages image information ("faces") needed to display the map view, items, and spell icons.
final Font font
The font to use.
void setIndex(final int index)
Sets the index of this element.
void setSelected(final boolean selected)
Sets the selected state.
Maintains the character list for an account.
boolean isActive()
Returns whether a GUI element is active.
boolean selected
If set, paint the element in "selected" state.
GUICharacter(@NotNull final TooltipManager tooltipManager, @NotNull final FacesManager facesManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final int w, final int h, @NotNull final Font font, final int defaultIndex, final CharacterModel characterModel, @NotNull final GuiFactory guiFactory)
Creates a new instance.
Dimension getPreferredSize()
A character displaying GUI element.
Utility class for Gui related functions.
final CharacterInformationListener characterInformationListener
All listeners to the entry itself.
void execute()
Executes the actions associated with this GUI element.
final GuiFactory guiFactory
The global GuiFactory instance.
TooltipText newTooltipText(@Nullable final String tooltipText)
Creates a TooltipText instance relative to this instance.
final GUIElementListener elementListener
The GUIElementListener to notify.
void scroll(final int distance)
Scrolls the element.
Information for displaying tooltips.
void removeCharacterInformationListener(final int index, @NotNull final CharacterInformationListener listener)
Removes a character entry listener for one entry.
Factory for creating Gui instances.
final String name
The name of this element.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
void paintComponent(@NotNull final Graphics g)
final FacesManager facesManager
The FacesManager to use to display faces.
Dimension getMinimumSizeInt()
Returns the minimal size needed to display this component.
final TooltipManager tooltipManager
The TooltipManager to update.
int index
Index of the item to display in characterModel.
void addCharacterInformationListener(final int index, @NotNull final CharacterInformationListener listener)
Adds a character entry listener for one entry.
Listener for GUIElement related events.