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

Classes

class  OpenDialogsIterator
 

Public Member Functions

GUIText activateCommandInput ()
 
void addGuiStateListener (@NotNull final RendererGuiStateListener listener)
 
void clearGUI (@NotNull final Gui gui)
 
boolean closeDialog (@NotNull final Gui dialog)
 
boolean deactivateCommandInput ()
 
void endRendering ()
 
Buffer getActiveMessageBuffer ()
 
RendererGuiState getGuiState ()
 
Iterable< GuigetOpenDialogs ()
 
int getWindowHeight ()
 
int getWindowWidth ()
 
boolean handleKeyPress (@NotNull final KeyEvent2 e)
 
boolean isDialogOpen (@NotNull final Gui dialog)
 
 JXCWindowRenderer (@NotNull final MouseTracker mouseTracker, @NotNull final CrossfireServerConnection crossfireServerConnection, @Nullable final Writer debugScreen)
 
boolean openDialog (@NotNull final Gui dialog, final boolean autoCloseOnDeactivate)
 
void raiseDialog (@NotNull final Gui dialog)
 
void redraw (@NotNull final Graphics g)
 
void setCurrentGui (@NotNull final Gui gui)
 
boolean setFullScreenMode (@NotNull final JFrame frame, @Nullable final Resolution resolution)
 
void setGuiState (@NotNull final RendererGuiState rendererGuiState)
 
void setSelectedHostname (@NotNull final String serverName)
 
void setTooltip (@Nullable final Component tooltip)
 
void setWindowMode (@NotNull final JFrame frame, @Nullable final Resolution resolution, @NotNull final Resolution minResolution, final boolean fixedSize)
 
boolean toggleDialog (@NotNull final Gui dialog)
 
void updateServerSettings ()
 

Static Public Member Functions

static GUIText activateCommandInput (@NotNull final Gui gui)
 

Private Member Functions

void addComponent (@NotNull final Component component)
 
void addMouseTracker (@NotNull final Component component)
 
void addMouseTrackerRecursively (@NotNull final Component component)
 
void addToLayeredPane (@NotNull final Component component, final int layer, final int index)
 
void debugScreenWrite (@NotNull final CharSequence message)
 
AbstractGUIElement findElement (@NotNull final MouseEvent e)
 
Point getCenterPoint ()
 
DisplayMode getDisplayMode ()
 
AbstractGUIElement getElementFromPoint (@NotNull final Gui gui, final int eX, final int eY)
 
Dimension getMapSize ()
 
Dimension getMaxWindowDimension (@NotNull final Insets frameInsets)
 
int getNumLookObjects ()
 
boolean isDisplayChangeSupported ()
 
boolean isFullScreenSupported ()
 
void openDialogInt (@NotNull final Gui dialog)
 
void openDialogsAdd (@NotNull final Gui dialog)
 
boolean openDialogsRemove (@NotNull final Gui dialog)
 
void redrawBlack (@NotNull final Graphics g)
 
void removeComponent (@NotNull final Component component)
 
void removeFromLayeredPane (@NotNull final Component component)
 
void removeMouseTracker (@NotNull final Component component)
 
void removeMouseTrackerRecursively (@NotNull final Component component)
 
void setDisplayMode (@NotNull final DisplayMode displayMode)
 
void setFullScreenWindow (@Nullable final Window window)
 
void setResolutionPost (@NotNull final Window frame, @NotNull final Dimension dimension)
 
void setResolutionPre (@NotNull final Window frame)
 
void updateWindowSize (final int windowWidth, final int windowHeight)
 

Static Private Member Functions

static AbstractGUIElement findElement (@NotNull final Component component, @NotNull final MouseEvent mouseEvent)
 
static Buffer getActiveMessageBuffer (@NotNull final Gui gui)
 

Private Attributes

BufferStrategy bufferStrategy
 
final ComponentListener componentListener
 
final CrossfireServerConnection crossfireServerConnection
 
Gui currentGui
 
final Writer debugScreen
 
final DisplayMode defaultDisplayMode
 
final Collection< GUIFloorListfloorLists = new CopyOnWriteArrayList<>()
 
JFrame frame
 
final GraphicsDevice graphicsDevice
 
final GraphicsEnvironment graphicsEnvironment
 
boolean isFullScreen
 
final Container layeredPane
 
final Collection< GUIMapmaps = new CopyOnWriteArrayList<>()
 
final Rectangle maximumWindowBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()
 
final MouseInputListener mouseInputListener
 
final MouseTracker mouseTracker
 
final MouseWheelListener mouseWheelListener
 
int offsetX
 
int offsetY
 
final List< GuiopenDialogs = new CopyOnWriteArrayList<>()
 
RendererGuiState rendererGuiState = RendererGuiState.START
 
final EventListenerList2< RendererGuiStateListenerrendererGuiStateListeners = new EventListenerList2<>()
 
Component tooltip
 
boolean wasDisplayed
 
int windowHeight
 
int windowWidth
 

Static Private Attributes

static final int DEFAULT_MAP_HEIGHT = 9
 
static final int DEFAULT_MAP_WIDTH = 9
 
static final int DEFAULT_NUM_LOOK_OBJECTS = 50
 
static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS ", Locale.ENGLISH)
 

Detailed Description

Renders a Gui instance into a Frame.

Author
Andreas Kirschbaum

Definition at line 87 of file JXCWindowRenderer.java.

Constructor & Destructor Documentation

◆ JXCWindowRenderer()

com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.JXCWindowRenderer ( @NotNull final MouseTracker  mouseTracker,
@NotNull final CrossfireServerConnection  crossfireServerConnection,
@Nullable final Writer  debugScreen 
)

Member Function Documentation

◆ activateCommandInput() [1/2]

GUIText com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.activateCommandInput ( )

Activates the command input text field. If more than one input field exists, the first matching one is selected.

Returns
the command input text field or
null
if no command input text field exists

Definition at line 1039 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialog(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogs, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiState.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.activateCommandInput().

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

◆ activateCommandInput() [2/2]

static GUIText com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.activateCommandInput ( @NotNull final Gui  gui)
static

Returns the first command text field of a gui and make it active.

Parameters
guithe gui to check
Returns
the comment text field, or
null
if this gui does not contain any command text fields

Definition at line 1389 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.getName(), and com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive().

Here is the call graph for this function:

◆ addComponent()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addComponent ( @NotNull final Component  component)
private

◆ addGuiStateListener()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addGuiStateListener ( @NotNull final RendererGuiStateListener  listener)

Adds a gui state listener to be notified about rendererGuiState changes.

Parameters
listenerthe listener to add

Definition at line 866 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiStateListeners.

◆ addMouseTracker()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTracker ( @NotNull final Component  component)
private

◆ addMouseTrackerRecursively()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTrackerRecursively ( @NotNull final Component  component)
private

Adds mouseTracker recursively to all children of a Component.

Parameters
componentthe component to add to

Definition at line 1268 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTracker().

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addToLayeredPane(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode().

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

◆ addToLayeredPane()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addToLayeredPane ( @NotNull final Component  component,
final int  layer,
final int  index 
)
private

◆ clearGUI()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.clearGUI ( @NotNull final Gui  gui)

◆ closeDialog()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.closeDialog ( @NotNull final Gui  dialog)

Closes a dialog. Does nothing if the given dialog is not open.

Parameters
dialogthe dialog to close
Returns
whether the dialog has been closed;
false
if the dialog was not open

Definition at line 774 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsRemove(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateServerSettings().

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.closeDialog(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialog().

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

◆ deactivateCommandInput()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.deactivateCommandInput ( )

Deactivates the command input text field. Does nothing if the command input text field is not active.

Returns
whether the command input text field has been deactivated

Definition at line 971 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, com.realtime.crossfire.jxclient.gui.gui.Gui.deactivateCommandInput(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogs, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiState.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.escPressed().

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

◆ debugScreenWrite()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite ( @NotNull final CharSequence  message)
private

◆ endRendering()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.endRendering ( )

◆ findElement() [1/2]

static AbstractGUIElement com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.findElement ( @NotNull final Component  component,
@NotNull final MouseEvent  mouseEvent 
)
staticprivate

Finds the gui element a given Component is part of.

Parameters
componentthe component to search
mouseEventthe mouse event to update
Returns
the gui element found or
null
if none was found

Definition at line 1127 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsAdd(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsRemove().

Here is the caller graph for this function:

◆ findElement() [2/2]

AbstractGUIElement com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.findElement ( @NotNull final MouseEvent  e)
private

Finds the gui element for a given MouseEvent. If a gui element was found, update the event mouse coordinates to be relative to the gui element.

Parameters
ethe mouse event to process
Returns
the gui element found, or
null
if none was found

Definition at line 1149 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getElementFromPoint(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogs, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiState.

Here is the call graph for this function:

◆ getActiveMessageBuffer() [1/2]

Buffer com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getActiveMessageBuffer ( )

Returns the active message buffer.

Returns
the active message buffer or
null
if none is active

Definition at line 992 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogs, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiState.

Referenced by com.realtime.crossfire.jxclient.commands.ClearCommand.execute().

Here is the caller graph for this function:

◆ getActiveMessageBuffer() [2/2]

static Buffer com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getActiveMessageBuffer ( @NotNull final Gui  gui)
staticprivate

Returns the active message buffer for a Gui instance.

Parameters
guithe gui instance
Returns
the active message buffer or
null

Definition at line 1015 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.log.GUILog.getBuffer().

Here is the call graph for this function:

◆ getCenterPoint()

Point com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getCenterPoint ( )
private

Returns the Point where windows should be centered.

Returns
the center point

Definition at line 1460 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsEnvironment.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode().

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

◆ getDisplayMode()

DisplayMode com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getDisplayMode ( )
private

◆ getElementFromPoint()

AbstractGUIElement com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getElementFromPoint ( @NotNull final Gui  gui,
final int  eX,
final int  eY 
)
private

Determines the GUIElement for a given coordinate with a given Gui instance.

Parameters
guithe gui to search
eXthe x-coordinate to check
eYthe y-coordinate to check
Returns
the
GUIElement
at the given coordinate or
null
if none was found

Definition at line 1186 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.offsetX, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.offsetY.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.findElement().

Here is the caller graph for this function:

◆ getGuiState()

RendererGuiState com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getGuiState ( )

◆ getMapSize()

Dimension com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getMapSize ( )
private

◆ getMaxWindowDimension()

Dimension com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getMaxWindowDimension ( @NotNull final Insets  frameInsets)
private

Returns the maximum dimension of a frame to fit on the screen.

Parameters
frameInsetsthe frame's insets
Returns
the maximum dimension

Definition at line 598 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsDevice, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.maximumWindowBounds.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode().

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

◆ getNumLookObjects()

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getNumLookObjects ( )
private

Returns the number of ground view objects to request from the server.

Returns
the number of ground view objects

Definition at line 1370 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.DEFAULT_NUM_LOOK_OBJECTS, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.floorLists.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateServerSettings().

Here is the caller graph for this function:

◆ getOpenDialogs()

Iterable<Gui> com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getOpenDialogs ( )

Returns all open dialogs in reverse painting order; the first element is the top-most dialog.

Returns
the open dialogs; client code must not modify this list

Definition at line 738 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress().

Here is the caller graph for this function:

◆ getWindowHeight()

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getWindowHeight ( )

◆ getWindowWidth()

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getWindowWidth ( )

◆ handleKeyPress()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.handleKeyPress ( @NotNull final KeyEvent2  e)

Dispatches a key press KeyEvent.

Parameters
ethe event to dispatch
Returns
whether a gui element did handle the event

Definition at line 1069 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, and com.realtime.crossfire.jxclient.gui.gui.Gui.handleKeyPress().

Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress().

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

◆ isDialogOpen()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isDialogOpen ( @NotNull final Gui  dialog)

Returns whether a given dialog is currently visible.

Parameters
dialogthe dialog to check
Returns
whether the dialog is visible

Definition at line 728 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogs.

◆ isDisplayChangeSupported()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isDisplayChangeSupported ( )
private

Returns the graphicsDevice supports low-level display changes.

Returns
whether low-level display changes are supported

Definition at line 1407 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsDevice.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode().

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

◆ isFullScreenSupported()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isFullScreenSupported ( )
private

Returns whether the graphicsDevice supports full-screen exclusive mode.

Returns
whether full-screen exclusive mode is supported

Definition at line 1438 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsDevice.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode().

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

◆ openDialog()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialog ( @NotNull final Gui  dialog,
final boolean  autoCloseOnDeactivate 
)

◆ openDialogInt()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogInt ( @NotNull final Gui  dialog)
private

Opens a dialog.

Parameters
dialogthe dialog to open

Definition at line 910 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addToLayeredPane(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.frame.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsAdd().

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

◆ openDialogsAdd()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsAdd ( @NotNull final Gui  dialog)
private

◆ openDialogsRemove()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsRemove ( @NotNull final Gui  dialog)
private

◆ raiseDialog()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.raiseDialog ( @NotNull final Gui  dialog)

◆ redraw()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.redraw ( @NotNull final Graphics  g)

Paints the view into the given graphics instance.

Parameters
gthe graphics instance to paint to

Definition at line 634 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.layeredPane.

Referenced by com.realtime.crossfire.jxclient.commands.ScreenshotCommand.execute().

Here is the caller graph for this function:

◆ redrawBlack()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.redrawBlack ( @NotNull final Graphics  g)
private

Repaints all to black.

Parameters
gthe graphics to paint into

Definition at line 658 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.frame.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.clearGUI().

Here is the caller graph for this function:

◆ removeComponent()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeComponent ( @NotNull final Component  component)
private

Removes a Component.

Parameters
componentthe component to remove

Definition at line 1319 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.floorLists, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.maps.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeFromLayeredPane().

Here is the caller graph for this function:

◆ removeFromLayeredPane()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeFromLayeredPane ( @NotNull final Component  component)
private

◆ removeMouseTracker()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeMouseTracker ( @NotNull final Component  component)
private

◆ removeMouseTrackerRecursively()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeMouseTrackerRecursively ( @NotNull final Component  component)
private

Removes mouseTracker recursively from all children of a Component.

Parameters
componentthe component to add to

Definition at line 1283 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeMouseTracker().

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.endRendering(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeFromLayeredPane().

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

◆ setCurrentGui()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setCurrentGui ( @NotNull final Gui  gui)

◆ setDisplayMode()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setDisplayMode ( @NotNull final DisplayMode  displayMode)
private

Sets the display mode of the graphicsDevice.

Parameters
displayModethe new display mode

Definition at line 1417 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsDevice.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPre().

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

◆ setFullScreenMode()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode ( @NotNull final JFrame  frame,
@Nullable final Resolution  resolution 
)

Tries to switch to the given resolution. If resolution switching fails, the window might be invisible.

Parameters
framethe associated frame
resolutionthe resolution to switch to;
null
to keep current resolution
Returns
whether the resolution has been changed

Definition at line 375 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTracker(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTrackerRecursively(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.bufferStrategy, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.componentListener, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.defaultDisplayMode, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.frame, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getDisplayMode(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isDisplayChangeSupported(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isFullScreen, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isFullScreenSupported(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setDisplayMode(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenWindow(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPost(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPre(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.windowHeight, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.windowWidth.

Here is the call graph for this function:

◆ setFullScreenWindow()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenWindow ( @Nullable final Window  window)
private

Enter full-screen mode, or return to windowed mode.

Parameters
windowthe window to enter full-screen mode or
null
to leave full-screen mode

Definition at line 1449 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsDevice, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isFullScreen.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPre().

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

◆ setGuiState()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setGuiState ( @NotNull final RendererGuiState  rendererGuiState)

◆ setResolutionPost()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPost ( @NotNull final Window  frame,
@NotNull final Dimension  dimension 
)
private

◆ setResolutionPre()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPre ( @NotNull final Window  frame)
private

◆ setSelectedHostname()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setSelectedHostname ( @NotNull final String  serverName)

Selects a server entry.

Parameters
serverNamethe server name to select

Definition at line 1024 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElement(), and com.realtime.crossfire.jxclient.gui.list.GUIMetaElementList.setSelectedHostname().

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.activateMetaserverGui().

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

◆ setTooltip()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setTooltip ( @Nullable final Component  tooltip)

Sets the tooltip to use, or

null

if no tooltips should be shown.

Parameters
tooltipthe tooltip to use, or
null

Definition at line 811 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.layeredPane, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.tooltip.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.setSkin(), and com.realtime.crossfire.jxclient.window.GuiManager.unsetSkin().

Here is the caller graph for this function:

◆ setWindowMode()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode ( @NotNull final JFrame  frame,
@Nullable final Resolution  resolution,
@NotNull final Resolution  minResolution,
final boolean  fixedSize 
)

Tries to switch to the given resolution. If resolution switching fails, the window might be invisible.

Parameters
framethe associated frame
resolutionthe resolution to switch to,
null
for default
minResolutionthe minimal supported resolution
fixedSizewhether the window should have fixed size

Definition at line 448 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTracker(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTrackerRecursively(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.bufferStrategy, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.componentListener, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.frame, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getCenterPoint(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getDisplayMode(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getMaxWindowDimension(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isFullScreen, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPost(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setResolutionPre(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.wasDisplayed, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.windowHeight, and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.windowWidth.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.endRendering().

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

◆ toggleDialog()

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.toggleDialog ( @NotNull final Gui  dialog)

Toggles a dialog: if the dialog is not shown, show it; else hide it.

Parameters
dialogthe dialog to toggle
Returns
whether the dialog is shown

Definition at line 789 of file JXCWindowRenderer.java.

References com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsAdd(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogsRemove(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateServerSettings().

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.toggleDialog().

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

◆ updateServerSettings()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateServerSettings ( )

◆ updateWindowSize()

void com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateWindowSize ( final int  windowWidth,
final int  windowHeight 
)
private

Member Data Documentation

◆ bufferStrategy

BufferStrategy com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.bufferStrategy
private

◆ componentListener

final ComponentListener com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.componentListener
private
Initial value:
= new ComponentListener() {
@Override
public void componentResized(final ComponentEvent e) {
final RootPaneContainer tmpFrame = frame;
assert tmpFrame != null;
final int width = tmpFrame.getContentPane().getWidth();
final int height = tmpFrame.getContentPane().getHeight();
updateWindowSize(width, height);
}
@Override
public void componentMoved(final ComponentEvent e) {
}
@Override
public void componentShown(final ComponentEvent e) {
}
@Override
public void componentHidden(final ComponentEvent e) {
}
}

The ComponentListener attached to frame.

Definition at line 322 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.endRendering(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode().

◆ crossfireServerConnection

final CrossfireServerConnection com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.crossfireServerConnection
private

◆ currentGui

Gui com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.currentGui
private

◆ debugScreen

final Writer com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreen
private

◆ DEFAULT_MAP_HEIGHT

final int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.DEFAULT_MAP_HEIGHT = 9
staticprivate

The default map height to request from the server.

Definition at line 102 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getMapSize().

◆ DEFAULT_MAP_WIDTH

final int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.DEFAULT_MAP_WIDTH = 9
staticprivate

The default map width to request from the server.

Definition at line 97 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getMapSize().

◆ DEFAULT_NUM_LOOK_OBJECTS

final int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.DEFAULT_NUM_LOOK_OBJECTS = 50
staticprivate

The default number of ground view objects.

Definition at line 92 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getNumLookObjects().

◆ defaultDisplayMode

final DisplayMode com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.defaultDisplayMode
private

◆ floorLists

final Collection<GUIFloorList> com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.floorLists = new CopyOnWriteArrayList<>()
private

◆ FORMATTER

final DateTimeFormatter com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS ", Locale.ENGLISH)
staticprivate

A formatter for timestamps.

Definition at line 316 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.debugScreenWrite().

◆ frame

JFrame com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.frame
private

◆ graphicsDevice

final GraphicsDevice com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsDevice
private

◆ graphicsEnvironment

final GraphicsEnvironment com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.graphicsEnvironment
private

◆ isFullScreen

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.isFullScreen
private

◆ layeredPane

final Container com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.layeredPane
private

◆ maps

final Collection<GUIMap> com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.maps = new CopyOnWriteArrayList<>()
private

◆ maximumWindowBounds

final Rectangle com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.maximumWindowBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()
private

◆ mouseInputListener

final MouseInputListener com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.mouseInputListener
private

◆ mouseTracker

final MouseTracker com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.mouseTracker
private

◆ mouseWheelListener

final MouseWheelListener com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.mouseWheelListener
private
Initial value:
= new MouseWheelListener() {
@Override
public void mouseWheelMoved(final MouseWheelEvent e) {
mouseTracker.mouseWheelMoved(findElement(e.getComponent(), e), e);
}
}

A MouseInputListener that forwards to mouseTracker.

Definition at line 219 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.addMouseTracker(), and com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.removeMouseTracker().

◆ offsetX

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.offsetX
private

◆ offsetY

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.offsetY
private

◆ openDialogs

final List<Gui> com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialogs = new CopyOnWriteArrayList<>()
private

◆ rendererGuiState

RendererGuiState com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiState = RendererGuiState.START
private

◆ rendererGuiStateListeners

final EventListenerList2<RendererGuiStateListener> com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.rendererGuiStateListeners = new EventListenerList2<>()
private

◆ tooltip

Component com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.tooltip
private

The tooltip to use, or

null

if no tooltips should be shown.

Definition at line 284 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setTooltip().

◆ wasDisplayed

boolean com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.wasDisplayed
private

Records whether the frame has been displayed before.

Definition at line 304 of file JXCWindowRenderer.java.

Referenced by com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode().

◆ windowHeight

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.windowHeight
private

◆ windowWidth

int com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.windowWidth
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.mouseTracker
final MouseTracker mouseTracker
Definition: JXCWindowRenderer.java:134
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateServerSettings
void updateServerSettings()
Definition: JXCWindowRenderer.java:1341
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.findElement
static AbstractGUIElement findElement(@NotNull final Component component, @NotNull final MouseEvent mouseEvent)
Definition: JXCWindowRenderer.java:1127
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateWindowSize
void updateWindowSize(final int windowWidth, final int windowHeight)
Definition: JXCWindowRenderer.java:577
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.frame
JFrame frame
Definition: JXCWindowRenderer.java:108
com.realtime.crossfire.jxclient.gui.misc.MouseTracker.mouseWheelMoved
void mouseWheelMoved(@Nullable final GUIElement element, @NotNull final MouseWheelEvent e)
Definition: MouseTracker.java:276
com.realtime.crossfire.jxclient.gui.misc.MouseTracker.paintActiveComponent
void paintActiveComponent(@NotNull final Graphics g)
Definition: MouseTracker.java:290