Crossfire JXClient, Trunk
|
Public Member Functions | |
int | getPreferredMapHeight () |
int | getPreferredMapWidth () |
Dimension | getPreferredSize () |
TooltipText | getTooltip () |
GUIMap (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 CrossfireServerConnection crossfireServerConnection, @NotNull final SmoothFaces smoothFaces, @NotNull final DarknessColors darknessColors, @NotNull final GuiFactory guiFactory) | |
void | mouseClicked (@NotNull final MouseEvent e) |
void | notifyOpen () |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap | |
void | dispose () |
Dimension | getMinimumSize () |
int | getOffsetX () |
int | getOffsetY () |
int | getPlayerX () |
int | getPlayerY () |
void | paintComponent (@NotNull final Graphics g) |
void | setBounds (final int x, final int y, final int width, final int height) |
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 | 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 () |
Protected Member Functions | |
void | markPlayer (@NotNull final Graphics g, final int dx, final int dy) |
void | paintSquareBackground (@NotNull final Graphics g, final int px, final int py, final boolean hasImage, @NotNull final CfMapSquare mapSquare) |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap | |
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) | |
int | getMapHeight () |
int | getMapWidth () |
void | paintColoredSquare (@NotNull final Graphics g, @NotNull final Color color, final int x, final int y) |
void | redrawSquare (@NotNull final Graphics g, @NotNull final CfMapSquare mapSquare, @NotNull final CfMap map, final int x, final int y) |
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 Attributes | |
final CrossfireServerConnection | crossfireServerConnection |
final int | tileSize |
Static Private Attributes | |
static final long | serialVersionUID = 1 |
Display the map view. It supports both normal-sized (32x32 pixel) and double sized (64x64 pixel) sized tiles.
Definition at line 48 of file GUIMap.java.
com.realtime.crossfire.jxclient.gui.map.GUIMap.GUIMap | ( | 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 CrossfireServerConnection | crossfireServerConnection, | ||
@NotNull final SmoothFaces | smoothFaces, | ||
@NotNull final DarknessColors | darknessColors, | ||
@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 |
crossfireServerConnection | the server connection to monitor |
smoothFaces | the smooth faces to use |
darknessColors | the darkness colors instance for converting darkness values into colors |
guiFactory | the global GUI factory instance |
Definition at line 81 of file GUIMap.java.
References com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.avoidCopyArea, com.realtime.crossfire.jxclient.gui.map.GUIMap.crossfireServerConnection, 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.AbstractGUIMap.mapUpdaterState, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.map.GUIMap.tileSize, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.
int com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredMapHeight | ( | ) |
Returns the minimal map height in squares needed to fill the map area.
Definition at line 154 of file GUIMap.java.
References com.realtime.crossfire.jxclient.util.MathUtils.divRoundUp(), and com.realtime.crossfire.jxclient.gui.map.GUIMap.tileSize.
int com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredMapWidth | ( | ) |
Returns the minimal map width in squares needed to fill the map area.
Definition at line 146 of file GUIMap.java.
References com.realtime.crossfire.jxclient.util.MathUtils.divRoundUp(), and com.realtime.crossfire.jxclient.gui.map.GUIMap.tileSize.
Dimension com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredSize | ( | ) |
Definition at line 138 of file GUIMap.java.
References com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getMapHeight(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getMapWidth(), and com.realtime.crossfire.jxclient.gui.map.GUIMap.tileSize.
TooltipText com.realtime.crossfire.jxclient.gui.map.GUIMap.getTooltip | ( | ) |
Returns the current tooltip text.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 127 of file GUIMap.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 93 of file GUIMap.java.
void com.realtime.crossfire.jxclient.gui.map.GUIMap.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).
e | the mouse event relative to this element |
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 97 of file GUIMap.java.
References com.realtime.crossfire.jxclient.gui.map.GUIMap.crossfireServerConnection, com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getMapHeight(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getMapWidth(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getOffsetX(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.getOffsetY(), com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.mapHeight, com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.mapWidth, com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.sendLookat(), and com.realtime.crossfire.jxclient.gui.map.GUIMap.tileSize.
void com.realtime.crossfire.jxclient.gui.map.GUIMap.notifyOpen | ( | ) |
Called each time the enclosing dialog is opened (or raised).
Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.
Definition at line 132 of file GUIMap.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 88 of file GUIMap.java.
References com.realtime.crossfire.jxclient.gui.map.AbstractGUIMap.paintColoredSquare().
|
private |
The CrossfireServerConnection to monitor.
Definition at line 59 of file GUIMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMap.GUIMap(), and com.realtime.crossfire.jxclient.gui.map.GUIMap.mouseClicked().
|
staticprivate |
The serial version UID.
Definition at line 53 of file GUIMap.java.
|
private |
The size of one tile.
Definition at line 64 of file GUIMap.java.
Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredMapHeight(), com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredMapWidth(), com.realtime.crossfire.jxclient.gui.map.GUIMap.getPreferredSize(), com.realtime.crossfire.jxclient.gui.map.GUIMap.GUIMap(), and com.realtime.crossfire.jxclient.gui.map.GUIMap.mouseClicked().