Gridarta Editor
net.sf.gridarta.gui.misc.MainView Class Reference

Main window of the level editor. More...

+ Collaboration diagram for net.sf.gridarta.gui.misc.MainView:

Public Member Functions

void addTab (@NotNull final Tab tab)
 Adds a tab. More...
 
Tab getActiveTab (@NotNull final Location location, final boolean alternativeLocation)
 Returns the active Tab on a given Location of the main view. More...
 
void handleThrowable (final Throwable t)
 This implementation displays the exception in a modal message dialog. More...
 
 MainView (@NotNull final JFrame frame, @NotNull final ActionListener exitAction, @NotNull final Component mapDesktop, @Nullable final ImageIcon icon, @NotNull final Exiter exiter)
 Constructs the main view and registers the given main controller. More...
 

Static Private Member Functions

static void setSeverity (@NotNull final Tab tab, @NotNull final Severity severity)
 Sets a Tab's Severity. More...
 

Private Attributes

final Component frame
 The main window of the editor. More...
 
final TabbedPanel tabbedPanel
 The TabbedPanel that displays frame and all open tabs. More...
 

Static Private Attributes

static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
 Preferences. More...
 
static final String WINDOW_HEIGHT = "MainWindow.height"
 The key used to store the main windows height to INI file. More...
 
static final String WINDOW_STATE = "WindowState"
 The key used to store the main window state in the preferences. More...
 
static final String WINDOW_WIDTH = "MainWindow.width"
 The key used to store the main windows width to INI file. More...
 
static final String WINDOW_X = "MainWindow.x"
 The key used to store the main windows x-coordinate to INI file. More...
 
static final String WINDOW_Y = "MainWindow.y"
 The key used to store the main windows y-coordinate to INI file. More...
 

Detailed Description

Main window of the level editor.

Contains the desktop for the map windows (internal frames) and the tools.

Author
Christian Hujer
Andreas Kirschbaum

Definition at line 53 of file MainView.java.

Constructor & Destructor Documentation

◆ MainView()

net.sf.gridarta.gui.misc.MainView.MainView ( @NotNull final JFrame  frame,
@NotNull final ActionListener  exitAction,
@NotNull final Component  mapDesktop,
@Nullable final ImageIcon  icon,
@NotNull final Exiter  exiter 
)

Constructs the main view and registers the given main controller.

Parameters
framethe main window of the editor
exitActionthe action to execute when the window is closed
mapDesktopthe map desktop to show
iconthe application's icon or
null
for default
exiterthe exiter instance

Definition at line 105 of file MainView.java.

References net.sf.gridarta.gui.misc.MainView.frame.

Member Function Documentation

◆ addTab()

void net.sf.gridarta.gui.misc.MainView.addTab ( @NotNull final Tab  tab)

Adds a tab.

Parameters
tabthe tab

Definition at line 161 of file MainView.java.

References net.sf.gridarta.gui.utils.tabbedpanel.TabbedPanel.addTab(), and net.sf.gridarta.gui.misc.MainView.setSeverity().

Referenced by net.sf.gridarta.maincontrol.GUIMainControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.GUIMainControl().

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

◆ getActiveTab()

Tab net.sf.gridarta.gui.misc.MainView.getActiveTab ( @NotNull final Location  location,
final boolean  alternativeLocation 
)

Returns the active Tab on a given Location of the main view.

Parameters
locationthe location
alternativeLocationwhether the alternative location should be checked
Returns
the tab or
null
if no active tab exists

Definition at line 184 of file MainView.java.

References net.sf.gridarta.gui.utils.tabbedpanel.TabbedPanel.getActiveTab().

Referenced by net.sf.gridarta.gui.misc.MainViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.gameObjectTextEditor().

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

◆ handleThrowable()

void net.sf.gridarta.gui.misc.MainView.handleThrowable ( final Throwable  t)

This implementation displays the exception in a modal message dialog.

Definition at line 201 of file MainView.java.

Referenced by net.sf.gridarta.maincontrol.GUIMainControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.handleThrowable().

+ Here is the caller graph for this function:

◆ setSeverity()

static void net.sf.gridarta.gui.misc.MainView.setSeverity ( @NotNull final Tab  tab,
@NotNull final Severity  severity 
)
staticprivate

Sets a Tab's Severity.

The severity affects the tab's button's color.

Parameters
tabthe tab
severitythe severity

Definition at line 194 of file MainView.java.

Referenced by net.sf.gridarta.gui.misc.MainView.addTab().

+ Here is the caller graph for this function:

Member Data Documentation

◆ frame

final Component net.sf.gridarta.gui.misc.MainView.frame
private

The main window of the editor.

Definition at line 89 of file MainView.java.

Referenced by net.sf.gridarta.gui.misc.MainView.MainView().

◆ PREFERENCES

final Preferences net.sf.gridarta.gui.misc.MainView.PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
staticprivate

Preferences.

Definition at line 58 of file MainView.java.

◆ tabbedPanel

final TabbedPanel net.sf.gridarta.gui.misc.MainView.tabbedPanel
private

The TabbedPanel that displays frame and all open tabs.

Definition at line 95 of file MainView.java.

◆ WINDOW_HEIGHT

final String net.sf.gridarta.gui.misc.MainView.WINDOW_HEIGHT = "MainWindow.height"
staticprivate

The key used to store the main windows height to INI file.

Definition at line 83 of file MainView.java.

◆ WINDOW_STATE

final String net.sf.gridarta.gui.misc.MainView.WINDOW_STATE = "WindowState"
staticprivate

The key used to store the main window state in the preferences.

Definition at line 63 of file MainView.java.

◆ WINDOW_WIDTH

final String net.sf.gridarta.gui.misc.MainView.WINDOW_WIDTH = "MainWindow.width"
staticprivate

The key used to store the main windows width to INI file.

Definition at line 78 of file MainView.java.

◆ WINDOW_X

final String net.sf.gridarta.gui.misc.MainView.WINDOW_X = "MainWindow.x"
staticprivate

The key used to store the main windows x-coordinate to INI file.

Definition at line 68 of file MainView.java.

◆ WINDOW_Y

final String net.sf.gridarta.gui.misc.MainView.WINDOW_Y = "MainWindow.y"
staticprivate

The key used to store the main windows y-coordinate to INI file.

Definition at line 73 of file MainView.java.


The documentation for this class was generated from the following file: