20 package net.sf.gridarta.gui.misc;
22 import javax.swing.Action;
31 import net.
sf.japi.swing.action.ActionMethod;
32 import org.jetbrains.annotations.NotNull;
33 import org.jetbrains.annotations.Nullable;
112 final boolean gameObjectTextEditorIsActive = activeTab != null && activeTab == gameObjectTab && activeTab2 ==
textEditorTab;
113 if (!gameObjectTextEditorIsActive) {
117 prevTab2 = activeTab2;
119 gameObjectTab.
getButton().setSelected(
true);
120 gameObjectAttributesControl.
selectTab(textEditorTab);
122 }
else if (prevTabSaved) {
123 prevTabSaved =
false;
125 if (prevTab != null) {
129 gameObjectTab.
getButton().setSelected(
false);
131 if (prevTab2 != null) {
132 gameObjectAttributesControl.
selectTab(prevTab2);
140 public void setAction(@NotNull
final Action action, @NotNull
final String name) {
final GameObjectAttributesControl< G, A, R > gameObjectAttributesControl
The GameObjectAttributesControl to display.
void gameObjectTextEditor()
Action method to open the game object text editor.
Tab prevTab
The previously active Tab before the last switch to gameObjectTab.
Implements actions related to the MainView.
Graphical User Interface of Gridarta.
A tab in a TabbedPanel component.
GameObjectAttributesTab< G, A, R > prevTab2
The previously active GameObjectAttributesTab in gameObjectTab before the last switch to textEditorTa...
The tab containing the game object text editor.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
boolean prevTabSaved
Whether a previously selected tab has been remembered.
Main window of the level editor.
MainViewActions(@NotNull final MainView mainView, @NotNull final GameObjectAttributesControl< G, A, R > gameObjectAttributesControl, @NotNull final Tab gameObjectTab, @NotNull final TextEditorTab< G, A, R > textEditorTab)
Creates a new instance.
final TextEditorTab< G, A, R > textEditorTab
The GameObjectAttributesTab that displays the game object text editor.
Base package of all Gridarta classes.
Location getLocation()
Returns the tab's location.
Reflects a game object (object on a map).
Tab getActiveTab(@NotNull final Location location, final boolean alternativeLocation)
Returns the active Tab on a given Location of the main view.
GameObjects are the objects based on Archetypes found on maps.
void activate()
Sets the focus to this component.
GameObjectAttributesTab< G, A, R > getSelectedTab()
Returns the selected tab.
Common base class for the panel that allows users to edit a GameObject's attributes.
final MainView mainView
The MainView instance.
AbstractButton getButton()
Returns the AbstractButton for showing or hiding the component.
boolean isAlternativeLocation()
Returns whether the button is shown in the alternative location.
A tab in the game object attributes panel.
Interface for MapArchObjects.
void selectTab(@NotNull final GameObjectAttributesTab< G, A, R > tab)
Selects a tab.
final Tab gameObjectTab
The game object Tab to display.