![]() |
Crossfire JXClient, Trunk
|
Displays a small map view. More...
Public Member Functions | |
Dimension | getPreferredSize () |
TooltipText | getTooltip () |
Returns the current tooltip text. More... | |
GUIMiniMap (final boolean avoidCopyArea, @NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final FacesProvider facesProvider, @NotNull final DarknessColors darknessColors, final int width, final int height, @NotNull final GuiFactory guiFactory) | |
Creates a new instance. More... | |
void | notifyOpen () |
Called each time the enclosing dialog is opened (or raised). More... | |
![]() | |
void | dispose () |
Releases all allocated resources. More... | |
Dimension | getMinimumSize () |
int | getOffsetX () |
Returns the x offset for drawing the square at coordinate 0 of the map. More... | |
int | getOffsetY () |
Returns the y offset for drawing the square at coordinate 0 of the map. More... | |
int | getPlayerX () |
Returns the x offset of the tile representing the player. More... | |
int | getPlayerY () |
Returns the y offset of the tile representing the player. More... | |
void | paintComponent (@NotNull final Graphics g) |
void | setBounds (final int x, final int y, final int width, final int height) |
![]() | |
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 | mouseClicked (@NotNull final MouseEvent e) |
Will be called when the user has clicked (pressed+released) this element. 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 | mousePressed (@NotNull final MouseEvent e) |
Will be called when the user has pressed the mouse inside this element. 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 | markPlayer (@NotNull final Graphics g, final int dx, final int dy) |
Paints the player location. More... | |
void | paintSquareBackground (@NotNull final Graphics g, final int px, final int py, final boolean hasImage, @NotNull final CfMapSquare mapSquare) |
Paints the background of a map square. More... | |
![]() | |
AbstractGUIMap (final boolean avoidCopyArea, @NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final MapUpdaterState mapUpdaterState, @NotNull final FacesProvider facesProvider, @Nullable final SmoothingRenderer smoothingRenderer, @NotNull final DarknessColors darknessColors, @NotNull final GuiFactory guiFactory) | |
Creates a new instance. More... | |
int | getMapHeight () |
Returns the map height in squares. More... | |
int | getMapWidth () |
Returns the map width in squares. More... | |
void | paintColoredSquare (@NotNull final Graphics g, @NotNull final Color color, final int x, final int y) |
Fills a square with one Color. More... | |
void | redrawSquare (@NotNull final Graphics g, @NotNull final CfMapSquare mapSquare, @NotNull final CfMap map, final int x, final int y) |
Redraws one square. More... | |
![]() | |
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 Attributes | |
final int | height |
The map height in squares. More... | |
final MapUpdaterState | mapUpdaterState |
The MapUpdaterState instance to use. More... | |
final int | tileSize |
The size of one tile. More... | |
final int | width |
The map width in squares. More... | |
Static Private Attributes | |
static final long | serialVersionUID = 1 |
The serial version UID. More... | |
static final Color[] | TILE_COLORS |
The colors for displaying magic map data. More... | |
Displays a small map view.
Definition at line 44 of file GUIMiniMap.java.
com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.GUIMiniMap | ( | final boolean | avoidCopyArea, |
@NotNull final TooltipManager | tooltipManager, | ||
@NotNull final GUIElementListener | elementListener, | ||
@NotNull final String | name, | ||
@NotNull final MapUpdaterState | mapUpdaterState, | ||
@NotNull final FacesProvider | facesProvider, | ||
@NotNull final DarknessColors | darknessColors, | ||
final int | width, | ||
final int | height, | ||
@NotNull final GuiFactory | guiFactory | ||
) |
Creates a new instance.
avoidCopyArea | whether map scrolling is done by copying pixel areas; if unset, always repaint all map squares |
tooltipManager | the tooltip manager to update |
elementListener | the element listener to notify |
name | the name of this element |
mapUpdaterState | the map updater state instance to use |
facesProvider | the faces provider for looking up faces |
darknessColors | the darkness colors instance for converting darkness values into colors |
width | the map width in squares |
height | the map height in squares |
guiFactory | the global GUI factory instance |
Definition at line 110 of file GUIMiniMap.java.
References com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.avoidCopyArea, com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.darknessColors, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.facesProvider, com.realtime.crossfire.jxclient.faces.FacesProvider.getSize(), com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.height, com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.mapUpdaterState, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.tileSize, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager, and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.width.
Dimension com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.getPreferredSize | ( | ) |
Definition at line 148 of file GUIMiniMap.java.
References com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.height, com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.tileSize, and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.width.
TooltipText com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.getTooltip | ( | ) |
Returns the current tooltip text.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 158 of file GUIMiniMap.java.
|
protected |
Paints the player location.
g | the graphics to paint to |
dx | the x distance to map has just scrolled |
dy | the y distance to map has just scrolled |
Reimplemented from com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.
Definition at line 131 of file GUIMiniMap.java.
References com.realtime.crossfire.jxclient.map.MapUpdaterState.getMap(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getMapHeight(), com.realtime.crossfire.jxclient.map.CfMap.getMapSquare(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getMapWidth(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getPlayerX(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getPlayerY(), com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.mapUpdaterState, com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.redrawSquare(), and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.tileSize.
void com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.notifyOpen | ( | ) |
Called each time the enclosing dialog is opened (or raised).
Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.
Definition at line 153 of file GUIMiniMap.java.
|
protected |
Paints the background of a map square.
g | the graphics to paint into |
px | the x-offset for painting |
py | the y-offset for painting |
hasImage | whether the square contains at least one image |
mapSquare | the map square |
Reimplemented from com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.
Definition at line 119 of file GUIMiniMap.java.
References com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.paintColoredSquare(), and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.TILE_COLORS.
|
private |
The map height in squares.
Definition at line 65 of file GUIMiniMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.getPreferredSize(), and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.GUIMiniMap().
|
private |
The MapUpdaterState instance to use.
Definition at line 55 of file GUIMiniMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.GUIMiniMap(), and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.markPlayer().
|
staticprivate |
The serial version UID.
Definition at line 49 of file GUIMiniMap.java.
|
staticprivate |
The colors for displaying magic map data.
Definition at line 76 of file GUIMiniMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.paintSquareBackground().
|
private |
The size of one tile.
Definition at line 70 of file GUIMiniMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.getPreferredSize(), com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.GUIMiniMap(), and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.markPlayer().
|
private |
The map width in squares.
Definition at line 60 of file GUIMiniMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.getPreferredSize(), and com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.GUIMiniMap().