Gridarta Editor
MoveToActions.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2015 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.gui.utils.tabbedpanel;
21 
23 import net.sf.japi.swing.action.ActionMethod;
24 import org.jetbrains.annotations.NotNull;
25 
30 public class MoveToActions {
31 
35  @NotNull
36  private final Tab tab;
37 
41  @NotNull
42  private final TabbedPanel tabbedPanel;
43 
49  public MoveToActions(@NotNull final Tab tab, @NotNull final TabbedPanel tabbedPanel) {
50  this.tab = tab;
51  this.tabbedPanel = tabbedPanel;
52  }
53 
57  @ActionMethod
58  public void tabButtonMoveToTop() {
59  tabbedPanel.moveTab(tab, Location.TOP);
60  }
61 
65  @ActionMethod
66  public void tabButtonMoveToBottom() {
67  tabbedPanel.moveTab(tab, Location.BOTTOM);
68  }
69 
73  @ActionMethod
74  public void tabButtonMoveToLeft() {
75  tabbedPanel.moveTab(tab, Location.LEFT);
76  }
77 
81  @ActionMethod
82  public void tabButtonMoveToRight() {
83  tabbedPanel.moveTab(tab, Location.RIGHT);
84  }
85 
90  @ActionMethod
91  public boolean isTabSplitMode() {
92  return tab.isAlternativeLocation();
93  }
94 
99  @ActionMethod
100  public void setTabSplitMode(final boolean splitMode) {
101  tabbedPanel.setTabSplitMode(tab, splitMode);
102  }
103 
104 }
Defines ActionMethods to move tab locations.
MoveToActions(@NotNull final Tab tab, @NotNull final TabbedPanel tabbedPanel)
Creates a new instance.
void setTabSplitMode(@NotNull final Tab tab, final boolean splitMode)
Toggles split mode for the given tab.
void tabButtonMoveToTop()
Action method to move the menu to Location#TOP.
Graphical User Interface of Gridarta.
void tabButtonMoveToLeft()
Action method to move the menu to Location#LEFT.
A tab in a TabbedPanel component.
Definition: Tab.java:53
void tabButtonMoveToRight()
Action method to move the menu to Location#RIGHT.
void setTabSplitMode(final boolean splitMode)
Action method set split mode.
boolean isTabSplitMode()
Action method to query split mode.
Base package of all Gridarta classes.
A Component that always displays another component and optionally a number of tabs around it...
void moveTab(@NotNull final Tab tab, @NotNull final Location location)
Moves the tab to the given location.
void tabButtonMoveToBottom()
Action method to move the menu to Location#BOTTOM.
boolean isAlternativeLocation()
Returns whether the button is shown in the alternative location.
Definition: Tab.java:338
final TabbedPanel tabbedPanel
The TabbedPanel to forward to.