Package net.runelite.client.ui
Class ClientUI
- java.lang.Object
-
- net.runelite.client.ui.ClientUI
-
@Singleton public class ClientUI extends Object
Client UI.
-
-
Field Summary
Fields Modifier and Type Field Description static BufferedImage
ICON
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forceFocus()
Attempt to forcibly bring the client frame to frontnet.runelite.api.Point
getCanvasOffset()
Get offset of game canvas in game windowCursor
getCurrentCursor()
Returns current cursor set on game containerCursor
getDefaultCursor()
Returns current custom cursor or default system cursor if cursor is not setGraphicsConfiguration
getGraphicsConfiguration()
int
getHeight()
Gets component height.TrayIcon
getTrayIcon()
int
getWidth()
Gets component width.void
init()
Initialize UI.boolean
isFocused()
Returns true if this component has focus.void
onConfigChanged(ConfigChanged event)
void
onGameStateChanged(net.runelite.api.events.GameStateChanged event)
void
onNavigationButtonAdded(NavigationButtonAdded event)
void
onNavigationButtonRemoved(NavigationButtonRemoved event)
void
paint(Graphics graphics)
Paint this component to target graphicsvoid
paintOverlays(Graphics2D graphics)
Paint UI related overlays to target graphicsvoid
requestFocus()
Request focus on this component and then on client componentvoid
resetCursor()
Resets client window cursor to default one.void
setCursor(Cursor cursor)
Changes cursor for client window.void
setCursor(BufferedImage image, String name)
Changes cursor for client window.void
show()
-
-
-
Field Detail
-
ICON
public static final BufferedImage ICON
-
-
Method Detail
-
onConfigChanged
@Subscribe public void onConfigChanged(ConfigChanged event)
-
onNavigationButtonAdded
@Subscribe public void onNavigationButtonAdded(NavigationButtonAdded event)
-
onNavigationButtonRemoved
@Subscribe public void onNavigationButtonRemoved(NavigationButtonRemoved event)
-
onGameStateChanged
@Subscribe public void onGameStateChanged(net.runelite.api.events.GameStateChanged event)
-
show
public void show()
-
paint
public void paint(Graphics graphics)
Paint this component to target graphics- Parameters:
graphics
- the graphics
-
getWidth
public int getWidth()
Gets component width.- Returns:
- the width
-
getHeight
public int getHeight()
Gets component height.- Returns:
- the height
-
isFocused
public boolean isFocused()
Returns true if this component has focus.- Returns:
- true if component has focus
-
requestFocus
public void requestFocus()
Request focus on this component and then on client component
-
forceFocus
public void forceFocus()
Attempt to forcibly bring the client frame to front
-
getCurrentCursor
public Cursor getCurrentCursor()
Returns current cursor set on game container- Returns:
- awt cursor
-
getDefaultCursor
public Cursor getDefaultCursor()
Returns current custom cursor or default system cursor if cursor is not set- Returns:
- awt cursor
-
setCursor
public void setCursor(BufferedImage image, String name)
Changes cursor for client window. Requires $init()
to be called first. FIXME: This is working properly only on Windows, Linux and Mac are displaying cursor incorrectly- Parameters:
image
- cursor imagename
- cursor name
-
setCursor
public void setCursor(Cursor cursor)
Changes cursor for client window. Requires $init()
to be called first.- Parameters:
cursor
- awt cursor
-
resetCursor
public void resetCursor()
Resets client window cursor to default one.- See Also:
setCursor(BufferedImage, String)
-
getCanvasOffset
public net.runelite.api.Point getCanvasOffset()
Get offset of game canvas in game window- Returns:
- game canvas offset
-
paintOverlays
public void paintOverlays(Graphics2D graphics)
Paint UI related overlays to target graphics- Parameters:
graphics
- target graphics
-
getGraphicsConfiguration
public GraphicsConfiguration getGraphicsConfiguration()
-
getTrayIcon
public TrayIcon getTrayIcon()
-
-