 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.map;
33 import java.awt.Color;
34 import java.awt.Dimension;
35 import java.awt.Graphics;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
124 final int colorIndex = mapSquare.getColor();
131 protected void markPlayer(@NotNull
final Graphics g,
final int dx,
final int dy) {
132 if (dx != 0 || dy != 0) {
141 g.setColor(Color.RED);
147 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
int getPlayerX()
Returns the x offset of the tile representing the player.
static final Color[] TILE_COLORS
The colors for displaying magic map data.
final int tileSize
The size of one tile.
int getSize()
Returns the size of faces in pixels.
Implements the map model which is shown in the map and magic map views.
int getMapWidth()
Returns the map width in squares.
void markPlayer(@NotNull final Graphics g, final int dx, final int dy)
Paints the player location.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
static final long serialVersionUID
The serial version UID.
int getPlayerY()
Returns the y offset of the tile representing the player.
void paintColoredSquare(@NotNull final Graphics g, @NotNull final Color color, final int x, final int y)
Fills a square with one Color.
Represents a map (as seen by the client).
final GUIElementListener elementListener
The GUIElementListener to notify.
Utility class for converting darkness values into colors.
final MapUpdaterState mapUpdaterState
The MapUpdaterState instance to use.
Manages image information ("faces") needed to display the map view, items, and spell icons.
CfMapSquare getMapSquare(final int x, final int y)
Returns a map square.
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.
Abstract base class for GUIElements that display map views.
final DarknessColors darknessColors
The DarknessColors instance for converting darkness values into colors.
final FacesProvider facesProvider
The FacesProvider for looking up faces.
CfMap getMap()
Returns the current map instance.
final int width
The map width in squares.
final GuiFactory guiFactory
The global GuiFactory instance.
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.
void redrawSquare(@NotNull final Graphics g, @NotNull final CfMapSquare mapSquare, @NotNull final CfMap map, final int x, final int y)
Redraws one square.
Information for displaying tooltips.
Dimension getPreferredSize()
Factory for creating Gui instances.
final String name
The name of this element.
final int height
The map height in squares.
Represents a square in a CfMap.
final TooltipManager tooltipManager
The TooltipManager to update.
int getMapHeight()
Returns the map height in squares.
Update a CfMap model from protocol commands.
Interface for face providers.
TooltipText getTooltip()
Returns the current tooltip text.
Displays a small map view.
Listener for GUIElement related events.
final boolean avoidCopyArea
Whether map scrolling is done by copying pixel areas.