Package org.collebol.engine.gui
Class MainWindow
java.lang.Object
org.collebol.engine.gui.MainWindow
- All Implemented Interfaces:
Runnable
The MainWindow class represents the main window of the EJGEngine application.
It is responsible for initializing and managing the window, handling input events,
and rendering the panels.
This class provides methods to register and switch between different panels, set window properties such as title and size, and display development tools.
By default, the Main class extended to EJGEngine instance has already a MainWindow object made.
Usage:
MainWindow mainWindow = new MainWindow(engine);
mainWindow.run();
For more information, please refer to the EJGEngine Wiki.
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a MainWindow instance with the specified engine. -
Method Summary
Modifier and TypeMethodDescriptionGives the current panel of the window.intintintintintgetScale()intgetTitle()intgetWidth()voidregisterPanel(Panel panel) Add a panel to the window where you can switch between.voidrun()Runs the main loop of the window, initializing and rendering the panels.voidsetHeight(int height) voidsetMaxTileHeight(int maxTileHeight) voidsetMaxTileWidth(int maxTileWidth) voidsetPanel(int i) Display the given panel.voidsetRefreshInterval(int refreshInterval) voidsetScale(int scale) voidsetTileSize(int tileSize) voidvoidsetWidth(int width) voidThere will be development tools rendered on the panel.
-
Constructor Details
-
MainWindow
Constructs a MainWindow instance with the specified engine.- Parameters:
e- the EJGEngine instance
-
-
Method Details
-
run
public void run()Runs the main loop of the window, initializing and rendering the panels. -
showDevelopmentTools
public void showDevelopmentTools()There will be development tools rendered on the panel.- Grid lines
- Coordinates
- Origin-point
- Screen details
-
registerPanel
Add a panel to the window where you can switch between.- Parameters:
panel- A panel in the main window
-
setPanel
public void setPanel(int i) Display the given panel.- Parameters:
i- Panel id.
-
getCurrentPanel
Gives the current panel of the window.- Returns:
- The panel that is displaying!
-
getTitle
-
setTitle
-
getRefreshInterval
public int getRefreshInterval() -
setRefreshInterval
public void setRefreshInterval(int refreshInterval) -
getTileSize
public int getTileSize() -
setTileSize
public void setTileSize(int tileSize) -
getScale
public int getScale() -
setScale
public void setScale(int scale) -
getMaxTileWidth
public int getMaxTileWidth() -
setMaxTileWidth
public void setMaxTileWidth(int maxTileWidth) -
getMaxTileHeight
public int getMaxTileHeight() -
setMaxTileHeight
public void setMaxTileHeight(int maxTileHeight) -
getWidth
public int getWidth() -
setWidth
public void setWidth(int width) -
getHeight
public int getHeight() -
setHeight
public void setHeight(int height) -
getMouseHandler
-