Crossfire JXClient, Trunk
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.gauge.GUIGauge Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.gui.gauge.GUIGauge:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.gauge.GUIGauge:
Collaboration graph

Public Member Functions

Dimension getMaximumSize ()
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
TooltipText getTooltip ()
 
 GUIGauge (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @Nullable final Image fullImage, @Nullable final Image lowImage, @Nullable final Image negativeImage, @Nullable final Image emptyImage, @NotNull final Orientation orientation, @Nullable final String tooltipFormat, final float alpha, @Nullable final CommandList commandList, @NotNull final GuiFactory guiFactory, @NotNull final Stats stats)
 
void mouseClicked (@NotNull final MouseEvent e)
 
void notifyOpen ()
 
void paintComponent (@NotNull final Graphics g)
 
void setBounds (final int x, final int y, final int width, final int height)
 
void setHidden (final boolean hidden)
 
void setValues (final int curValue, final int minValue, final int maxValue, @NotNull final String labelText, @NotNull final String tooltipText)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
void dispose ()
 
int getDialogBorderBottom ()
 
int getDialogBorderLeft ()
 
int getDialogBorderRight ()
 
int getDialogBorderTop ()
 
String getName ()
 
void inhibitListeners ()
 
boolean isDefault ()
 
boolean isIgnore ()
 
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 mouseReleased (@NotNull final MouseEvent e)
 
void mouseWheelMoved (final int wheelRotation)
 
void setChanged ()
 
void setChangedListener (@Nullable final GUIElementChangedListener changedListener)
 
void setDefault (final boolean isDefault)
 
void setIgnore ()
 
String toString ()
 

Private Member Functions

String formatTooltip ()
 

Private Attributes

final float alpha
 
final CommandList commandList
 
final Image emptyImage
 
final GaugeState gaugeState
 
boolean hidden
 
final Orientation orientation
 
final Stats stats
 
final String tooltipFormat
 
String tooltipText = "-"
 

Static Private Attributes

static final long serialVersionUID = 1
 

Additional Inherited Members

- 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 ()
 

Detailed Description

Displays a value as a graphical gauge that's filling state depends on the value.

Author
Lauwenmark
Andreas Kirschbaum

Definition at line 47 of file GUIGauge.java.

Constructor & Destructor Documentation

◆ GUIGauge()

com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.GUIGauge ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
@Nullable final Image  fullImage,
@Nullable final Image  lowImage,
@Nullable final Image  negativeImage,
@Nullable final Image  emptyImage,
@NotNull final Orientation  orientation,
@Nullable final String  tooltipFormat,
final float  alpha,
@Nullable final CommandList  commandList,
@NotNull final GuiFactory  guiFactory,
@NotNull final Stats  stats 
)

Creates a new instance.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
fullImagethe image representing a full gauge
lowImagethe image representing a low gauge (<30%)
negativeImagethe image representing a more-than-empty gauge; if set to
null
the gauge remains in empty state
emptyImagethe image representing an empty gauge; if set to
null
an empty background is used instead
orientationthe gauge's orientation
tooltipFormatthe format for displaying tooltips; if set to
null
no tooltips are shown
alphaalpha value of the gauge to use
commandListthe command list that is executed on button 2
guiFactorythe global GUI factory instance
statsthe stats instance to use

Definition at line 126 of file GUIGauge.java.

References com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.alpha, com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.commandList, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.emptyImage, com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.gaugeState, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.orientation, com.realtime.crossfire.jxclient.gui.gauge.Orientation.setExtends(), com.realtime.crossfire.jxclient.gui.gauge.Orientation.setHasNegativeImage(), com.realtime.crossfire.jxclient.gui.gauge.Orientation.setValues(), com.realtime.crossfire.jxclient.gui.gauge.GaugeState.setValues(), com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.stats, com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.tooltipFormat, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.

Here is the call graph for this function:

Member Function Documentation

◆ formatTooltip()

String com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.formatTooltip ( )
private

Returns a formatted string using the given format.

Supported format strings:

  • %% - a literal % character
  • T - the default tooltip text
Returns
the formatted string or
null
to not show a tooltip

Definition at line 261 of file GUIGauge.java.

References com.realtime.crossfire.jxclient.stats.Stats.getActiveSkill(), com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.stats, com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.tooltipFormat, and com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.tooltipText.

Referenced by com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.getTooltip().

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

◆ getMaximumSize()

Dimension com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.getMaximumSize ( )

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.getMinimumSize ( )

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.getPreferredSize ( )

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.getTooltip ( )

Returns the current tooltip text.

Returns
the tooltip text or
null
to not show a tooltip

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

Definition at line 242 of file GUIGauge.java.

References com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.formatTooltip(), and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.newTooltipText().

Here is the call graph for this function:

◆ mouseClicked()

void com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.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 218 of file GUIGauge.java.

References com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.commandList, and com.realtime.crossfire.jxclient.gui.commandlist.CommandList.execute().

Here is the call graph for this function:

◆ notifyOpen()

void com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.notifyOpen ( )

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

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

Definition at line 247 of file GUIGauge.java.

◆ paintComponent()

void com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.paintComponent ( @NotNull final Graphics  g)

◆ setBounds()

void com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.setBounds ( final int  x,
final int  y,
final int  width,
final int  height 
)

◆ setHidden()

void com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.setHidden ( final boolean  hidden)

Specify whether this item should hide itself, independent of the "visibility" state.

Parameters
hiddenwhether the gauge is hidden

Implements com.realtime.crossfire.jxclient.gui.gauge.GUIGaugeListener.

Definition at line 213 of file GUIGauge.java.

References com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.hidden.

◆ setValues()

void com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.setValues ( final int  curValue,
final int  minValue,
final int  maxValue,
@NotNull final String  labelText,
@NotNull final String  tooltipText 
)

Member Data Documentation

◆ alpha

final float com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.alpha
private

◆ commandList

final CommandList com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.commandList
private

◆ emptyImage

final Image com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.emptyImage
private

◆ gaugeState

final GaugeState com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.gaugeState
private

◆ hidden

boolean com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.hidden
private

If true, the gauge will not paint itself, whatever its visibility.

Definition at line 105 of file GUIGauge.java.

Referenced by com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.paintComponent(), and com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.setHidden().

◆ orientation

final Orientation com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.orientation
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 52 of file GUIGauge.java.

◆ stats

final Stats com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.stats
private

◆ tooltipFormat

final String com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.tooltipFormat
private

◆ tooltipText

String com.realtime.crossfire.jxclient.gui.gauge.GUIGauge.tooltipText = "-"
private

The documentation for this class was generated from the following file: