Crossfire JXClient, Trunk
com.realtime.crossfire.jxclient.gui.list.GUIMetaElement Class Reference

Display a Crossfire server entry. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.gui.list.GUIMetaElement:
+ Collaboration diagram for com.realtime.crossfire.jxclient.gui.list.GUIMetaElement:

Public Member Functions

boolean canScroll (final int distance)
 Returns whether scrolling is possible. More...
 
void dispose ()
 Releases all allocated resources. More...
 
void execute ()
 Executes the actions associated with this GUI element. More...
 
int getIndex ()
 Returns the index of this element. More...
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
TooltipText getTooltip ()
 Returns the current tooltip text. More...
 
 GUIMetaElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final MetaserverModel metaserverModel, @NotNull final String name, @Nullable final Image image, @NotNull final Font font, final int defaultIndex, @NotNull final String format, @NotNull final String tooltip, @NotNull final GuiFactory guiFactory)
 Creates a new instance. More...
 
void mouseClicked (@NotNull final MouseEvent e)
 Will be called when the user has clicked (pressed+released) this element. More...
 
void notifyOpen ()
 Called each time the enclosing dialog is opened (or raised). More...
 
void paintComponent (@NotNull final Graphics g)
 
void resetScroll ()
 Resets the scroll index to the default value. More...
 
void scroll (final int distance)
 Scrolls the element. More...
 
void setIndex (final int index)
 Sets the index of this element. More...
 
void setSelected (final boolean selected)
 Sets the selected state. More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
void activateNextElement ()
 Activates the following element. More...
 
void activatePrevElement ()
 Activates the previous element. More...
 
boolean isActive ()
 Returns whether a GUI element is active. More...
 
void mousePressed (@NotNull final MouseEvent e)
 Will be called when the user has pressed the mouse inside this element. More...
 
void setActive (final boolean active)
 Sets the active state of a GUI element. More...
 
void setNextActive (@NotNull final ActivatableGUIElement next)
 Sets the next activatable GUI element in the same dialog. More...
 
void setPrevActive (@NotNull final ActivatableGUIElement prev)
 Sets the previous activatable GUI element in the same dialog. More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
int getDialogBorderBottom ()
 Returns the size of the dialog's bottom border. More...
 
int getDialogBorderLeft ()
 Returns the size of the dialog's left border. More...
 
int getDialogBorderRight ()
 Returns the size of the dialog's right border. More...
 
int getDialogBorderTop ()
 Returns the size of the dialog's top border. More...
 
String getName ()
 Returns the internal name of this gui element. More...
 
void inhibitListeners ()
 Prevents change listeners to be notified. More...
 
boolean isDefault ()
 Returns whether this element is the default element. More...
 
boolean isIgnore ()
 Returns whether this gui element is to be ignored for user interaction. More...
 
void mouseDragged (@NotNull final MouseEvent e)
 Will be called when the mouse moves within this component while the button is pressed. More...
 
void mouseEntered (@NotNull final MouseEvent e)
 Will be called when the mouse has entered the bounding box of this element. More...
 
void mouseExited (@NotNull final MouseEvent e)
 Will be called when the mouse has left the bounding box of this element. More...
 
void mouseMoved (@NotNull final MouseEvent e)
 Will be called when the mouse moves within this component. More...
 
void mouseReleased (@NotNull final MouseEvent e)
 Will be called when the user has released the mouse. More...
 
void mouseWheelMoved (final int wheelRotation)
 Will be called when the mouse wheel has been moved. More...
 
void setChanged ()
 Records that the contents have changed and must be repainted. More...
 
void setChangedListener (@Nullable final GUIElementChangedListener changedListener)
 Sets the GUIElementChangedListener to be notified. More...
 
void setDefault (final boolean isDefault)
 Sets whether this element is the default element. More...
 
void setIgnore ()
 Marks this gui element to be ignored for user interaction. More...
 
String toString ()
 

Protected Member Functions

void activeChanged ()
 Will be called whenever the active state has changed. More...
 
- 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)
 Creates a new instance. More...
 
void markInactivePending ()
 Marks this GUI element as pending inactive. More...
 
void setInactiveIfPending ()
 Unsets the active state of this GUI element if it is pending. More...
 
- 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)
 Creates a new instance. More...
 
TooltipText newTooltipText (@Nullable final String tooltipText)
 Creates a TooltipText instance relative to this instance. More...
 
void tooltipChanged ()
 Must be called whenever the tooltip may have changed. More...
 

Private Member Functions

Dimension getMinimumSizeInt ()
 Returns the minimal size needed to display this component. More...
 

Private Attributes

final int defaultIndex
 The default scroll index. More...
 
final Font font
 The font to use. More...
 
final String format
 The format used for displaying Metaserver instances. More...
 
final Image image
 An image to draw before the server description. More...
 
int index
 The metaserver index. More...
 
final MetaserverEntryListener metaserverEntryListener
 The metaserver entry listener attached for the current index. More...
 
final MetaserverModel metaserverModel
 The metaserver model to monitor. More...
 
boolean selected
 If set, paint the element in "selected" state. More...
 
final String tooltip
 The format used for displaying tooltips. More...
 

Static Private Attributes

static final long serialVersionUID = 1
 The serial version UID. More...
 

Detailed Description

Display a Crossfire server entry.

Author
Lauwenmark
Andreas Kirschbaum

Definition at line 50 of file GUIMetaElement.java.

Constructor & Destructor Documentation

◆ GUIMetaElement()

com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.GUIMetaElement ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final MetaserverModel  metaserverModel,
@NotNull final String  name,
@Nullable final Image  image,
@NotNull final Font  font,
final int  defaultIndex,
@NotNull final String  format,
@NotNull final String  tooltip,
@NotNull final GuiFactory  guiFactory 
)

Creates a new instance.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
metaserverModelthe metaserver model to monitor
namethe name of this element
imagean image to draw before the server description; may be
null
to draw no image
fontthe font to use
defaultIndexthe initial metaserver index
formatthe format used to display metaserver instances
tooltipthe format used for displaying tooltips
guiFactorythe global GUI factory instance

Definition at line 126 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.defaultIndex, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.font, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.format, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.image, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.index, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.metaserverEntryListener, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.metaserverModel, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged(), com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.tooltip, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.

+ Here is the call graph for this function:

Member Function Documentation

◆ activeChanged()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.activeChanged ( )
protected

Will be called whenever the active state has changed.

Reimplemented from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.

Definition at line 251 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged().

+ Here is the call graph for this function:

◆ canScroll()

boolean com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.canScroll ( final int  distance)

Returns whether scrolling is possible.

Parameters
distancethe distance to scroll
Returns
whether scrolling is possible

Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.

Definition at line 227 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.index, com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.metaserverModel, and com.realtime.crossfire.jxclient.metaserver.MetaserverModel.size().

+ Here is the call graph for this function:

◆ dispose()

◆ execute()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.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 222 of file GUIMetaElement.java.

◆ getIndex()

int com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.getIndex ( )

Returns the index of this element.

Returns
the index

Definition at line 259 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.index.

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.getMinimumSize ( )

Definition at line 169 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.getMinimumSizeInt().

+ Here is the call graph for this function:

◆ getMinimumSizeInt()

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.getPreferredSize ( )

Definition at line 162 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.getMinimumSizeInt().

+ Here is the call graph for this function:

◆ getTooltip()

◆ mouseClicked()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.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).

Parameters
ethe mouse event relative to this element

Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.

Definition at line 188 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive(), and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged().

+ Here is the call graph for this function:

◆ notifyOpen()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.notifyOpen ( )

Called each time the enclosing dialog is opened (or raised).

Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.

Definition at line 218 of file GUIMetaElement.java.

◆ paintComponent()

◆ resetScroll()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.resetScroll ( )

◆ scroll()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.scroll ( final int  distance)

Scrolls the element.

Parameters
distancethe distance to scroll

Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.

Definition at line 239 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.index, and com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.setIndex().

Referenced by com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.resetScroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIndex()

◆ setSelected()

void com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.setSelected ( final boolean  selected)

Sets the selected state.

Parameters
selectedwhether this element should be drawn as "selected"

Definition at line 283 of file GUIMetaElement.java.

References com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.selected, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged().

+ Here is the call graph for this function:

Member Data Documentation

◆ defaultIndex

final int com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.defaultIndex
private

◆ font

◆ format

final String com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.format
private

◆ image

final Image com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.image
private

◆ index

◆ metaserverEntryListener

final MetaserverEntryListener com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.metaserverEntryListener
private

◆ metaserverModel

◆ selected

boolean com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.selected
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 55 of file GUIMetaElement.java.

◆ tooltip

final String com.realtime.crossfire.jxclient.gui.list.GUIMetaElement.tooltip
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipChanged
void tooltipChanged()
Must be called whenever the tooltip may have changed.
Definition: AbstractGUIElement.java:264
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged
void setChanged()
Records that the contents have changed and must be repainted.
Definition: AbstractGUIElement.java:223