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

Public Member Functions

void dispose ()
 
void execute ()
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
TooltipText getTooltip ()
 
 GUIScrollBar (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean proportionalSlider, @NotNull final GUIScrollable2 scrollable, @NotNull final Color colorBackground, @NotNull final Color colorForeground, @NotNull final GuiFactory guiFactory)
 
void mouseDragged (@NotNull final MouseEvent e)
 
void mousePressed (@NotNull final MouseEvent e)
 
void mouseReleased (@NotNull final MouseEvent e)
 
void mouseWheelMoved (final int wheelRotation)
 
void notifyOpen ()
 
void paintComponent (@NotNull final Graphics g)
 
void setRange (final int valueMin, final int valueMax, final int sliderPos, final int sliderSize)
 
- 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 mouseClicked (@NotNull final MouseEvent e)
 
void mouseEntered (@NotNull final MouseEvent e)
 
void mouseExited (@NotNull final MouseEvent e)
 
void mouseMoved (@NotNull final MouseEvent e)
 
void setChanged ()
 
void setChangedListener (@Nullable final GUIElementChangedListener changedListener)
 
void setDefault (final boolean isDefault)
 
void setIgnore ()
 
String toString ()
 

Protected Member Functions

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

int getSliderHeightPixels ()
 
int getSliderPos (final int yPixels)
 
int getSliderPosPixels (final int sh)
 
void setPosition (final int pos)
 

Private Attributes

final Color colorBackground
 
final Color colorForeground
 
int offset
 
final boolean proportionalSlider
 
final GUIScrollable2 scrollable
 
boolean scrolling
 
int sliderPos
 
int sliderSize = 1
 
int valueMin
 
int valueSize = 1
 

Static Private Attributes

static final long serialVersionUID = 1
 

Detailed Description

A scroll bar gui element.

Author
Andreas Kirschbaum

Definition at line 43 of file GUIScrollBar.java.

Constructor & Destructor Documentation

◆ GUIScrollBar()

com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.GUIScrollBar ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
final boolean  proportionalSlider,
@NotNull final GUIScrollable2  scrollable,
@NotNull final Color  colorBackground,
@NotNull final Color  colorForeground,
@NotNull final GuiFactory  guiFactory 
)

Creates a new instance.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
proportionalSliderif set, make the slider size reflect the visible area; if unset, display the slider as a square
scrollablethe target element to scroll
colorBackgroundthe background color of the slider
colorForegroundthe foreground color of the slider
guiFactorythe global GUI factory instance

Definition at line 117 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.colorBackground, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.colorForeground, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.proportionalSlider, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrollable, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.

Member Function Documentation

◆ activeChanged()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.activeChanged ( )
protected

Will be called whenever the active state has changed.

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

Definition at line 148 of file GUIScrollBar.java.

◆ dispose()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.dispose ( )

◆ execute()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.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 226 of file GUIScrollBar.java.

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getMinimumSize ( )

Definition at line 294 of file GUIScrollBar.java.

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getPreferredSize ( )

Definition at line 287 of file GUIScrollBar.java.

◆ getSliderHeightPixels()

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getSliderHeightPixels ( )
private

◆ getSliderPos()

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getSliderPos ( final int  yPixels)
private

Returns the current slider position in slider-coordinates.

Parameters
yPixelsthe y-coordinate within the gui element
Returns
the position in slider-coordinates

Definition at line 235 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getSliderHeightPixels(), com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderSize, and com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueSize.

Referenced by com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mouseDragged().

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

◆ getSliderPosPixels()

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getSliderPosPixels ( final int  sh)
private

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.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 217 of file GUIScrollBar.java.

◆ mouseDragged()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.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.

Parameters
ethe mouse event relative to this element

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

Definition at line 202 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getSliderPos(), com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.offset, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrollable, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrolling, and com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable2.scrollTo().

Here is the call graph for this function:

◆ mousePressed()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mousePressed ( @NotNull final MouseEvent  e)

◆ mouseReleased()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mouseReleased ( @NotNull final MouseEvent  e)

Will be called when the user has released the mouse. This event may be delivered even if no previous mousePressed(MouseEvent) has been delivered before.

Parameters
ethe mouse event relative to this element

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

Definition at line 181 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrolling.

◆ mouseWheelMoved()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mouseWheelMoved ( final int  wheelRotation)

Will be called when the mouse wheel has been moved.

Parameters
wheelRotationthe movement amount; negative=away from the user, positive=towards the user

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

Definition at line 210 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.scroll(), and com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrollable.

Here is the call graph for this function:

◆ notifyOpen()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.notifyOpen ( )

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

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

Definition at line 222 of file GUIScrollBar.java.

◆ paintComponent()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.paintComponent ( @NotNull final Graphics  g)

◆ setPosition()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.setPosition ( final int  pos)
private

Sets the position of the slider. Invalid values are set to the nearest valid value.

Parameters
posthe slider position

Definition at line 244 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged(), com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderPos, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderSize, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueMin, and com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueSize.

Referenced by com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.setRange().

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

◆ setRange()

void com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.setRange ( final int  valueMin,
final int  valueMax,
final int  sliderPos,
final int  sliderSize 
)

Sets the scroll range.

Parameters
valueMinthe minimum scroll value
valueMaxthe maximum scroll value
sliderPosthe scroll location; it need not within the scroll range
sliderSizethe size of the slider itself

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

Definition at line 133 of file GUIScrollBar.java.

References com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.setPosition(), com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderPos, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderSize, com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueMin, and com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueSize.

Here is the call graph for this function:

Member Data Documentation

◆ colorBackground

final Color com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.colorBackground
private

◆ colorForeground

final Color com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.colorForeground
private

◆ offset

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.offset
private

The offset between the mouse and the top border of the slider while dragging.

Definition at line 98 of file GUIScrollBar.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mouseDragged(), and com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mousePressed().

◆ proportionalSlider

final boolean com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.proportionalSlider
private

If set, make the slider size reflect the visible area; if unset, display the slider as a square.

Definition at line 54 of file GUIScrollBar.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.getSliderHeightPixels(), and com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.GUIScrollBar().

◆ scrollable

final GUIScrollable2 com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrollable
private

◆ scrolling

boolean com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.scrolling
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 48 of file GUIScrollBar.java.

◆ sliderPos

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderPos
private

◆ sliderSize

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.sliderSize = 1
private

◆ valueMin

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueMin
private

◆ valueSize

int com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.valueSize = 1
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.misc.GUIScrollBar.mouseDragged
void mouseDragged(@NotNull final MouseEvent e)
Definition: GUIScrollBar.java:202
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.mouseMoved
void mouseMoved(@NotNull final MouseEvent e)
Definition: AbstractGUIElement.java:211