 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.map;
35 import java.awt.Color;
36 import java.awt.Dimension;
37 import java.awt.Graphics;
38 import java.awt.event.MouseEvent;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
93 protected void markPlayer(@NotNull
final Graphics g,
final int dx,
final int dy) {
98 super.mouseClicked(e);
104 switch (e.getButton()) {
105 case MouseEvent.BUTTON1:
108 if (dx1 >= 0 && dy1 >= 0) {
119 case MouseEvent.BUTTON2:
120 case MouseEvent.BUTTON3:
137 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
Dimension getPreferredSize()
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.
Utility class for mathematical functions.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
void paintColoredSquare(@NotNull final Graphics g, @NotNull final Color color, final int x, final int y)
Fills a square with one Color.
int mapHeight
The map height in squares.
final GUIElementListener elementListener
The GUIElementListener to notify.
final CrossfireServerConnection crossfireServerConnection
The CrossfireServerConnection to monitor.
int getOffsetY()
Returns the y offset for drawing the square at coordinate 0 of the map.
Utility class for converting darkness values into colors.
int getPreferredMapWidth()
Returns the minimal map width in squares needed to fill the map area.
Manages image information ("faces") needed to display the map view, items, and spell icons.
Abstract base class for GUIElements that display map views.
final DarknessColors darknessColors
The DarknessColors instance for converting darkness values into colors.
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.
final FacesProvider facesProvider
The FacesProvider for looking up faces.
static final long serialVersionUID
The serial version UID.
int getPreferredMapHeight()
Returns the minimal map height in squares needed to fill the map area.
final GuiFactory guiFactory
The global GuiFactory instance.
Information for displaying tooltips.
Factory for creating Gui instances.
void markPlayer(@NotNull final Graphics g, final int dx, final int dy)
Paints the player location.
final String name
The name of this element.
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.
TooltipText getTooltip()
Returns the current tooltip text.
int mapWidth
The map width in squares.
static int divRoundUp(final int numerator, final int denominator)
Returns the quotient of two values, rounded up to the nearest integer.
void mouseClicked(@NotNull final MouseEvent e)
Will be called when the user has clicked (pressed+released) this element.
Represents a square in a CfMap.
final TooltipManager tooltipManager
The TooltipManager to update.
int getMapHeight()
Returns the map height in squares.
final int tileSize
The size of one tile.
Update a CfMap model from protocol commands.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
Interface for face providers.
final MapUpdaterState mapUpdaterState
The MapUpdaterState instance to display.
Maintains smoothing information received from the Crossfire server.
Listener for GUIElement related events.
void sendLookat(final int dx, int dy)
Sends a "lookat" command to the server.
Renderer for painting smoothed faces into map views.
final boolean avoidCopyArea
Whether map scrolling is done by copying pixel areas.
int getOffsetX()
Returns the x offset for drawing the square at coordinate 0 of the map.