Class Tab
- java.lang.Object
-
- net.sf.gridarta.gui.utils.tabbedpanel.Tab
-
- Direct Known Subclasses:
GameObjectTab,GameObjectTextEditorTab,WarningsTab
public class Tab extends java.lang.ObjectA tab in aTabbedPanelcomponent. It consists of anAbstractButtonto show or hide an associatedJComponentthat is displayed when the tab is active. Each tab is associated with aLocation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTabListener(@NotNull TabListener listener)Adds aTabListenerto be notified.@NotNull javax.swing.AbstractButtongetButton()Returns theAbstractButtonfor showing or hiding the component.@NotNull java.awt.ComponentgetComponent()Returns theComponentthat is shown when this tab is active.@NotNull LocationgetLocation()Returns the tab's location.@NotNull javax.swing.JMenugetMoveToMenu()Returns the "Move To" menu within the button's context menu.@NotNull javax.swing.JPopupMenugetPopupMenu()Returns the button's context menu.@NotNull SeveritygetSeverity()Returns the tab'sSeverity.intgetSize()Returns the tab's size.booleanisAlternativeLocation()Returns whether the button is shown in the alternative location.booleanisOpen()Returns the tab's open status.voidremoveTabListener(@NotNull TabListener listener)Removes aTabListenerto be notified.voidsetAlternativeLocation(boolean alternativeLocation)Sets whether the button is shown in the alternative location.voidsetLocation(@NotNull Location location)Sets the tab's location.voidsetOpen(boolean open)Sets the tab's open status.protected voidsetSeverity(@NotNull Severity severity)Sets the tab'sSeverity.voidsetSize(int size)Sets the tab's size.voidsetSplitModeAction(@Nullable net.sf.japi.swing.action.ToggleAction splitModeAction)Sets theToggleActionto update if the "split mode" state changes.
-
-
-
Constructor Detail
-
Tab
public Tab(@NotNull @NotNull java.lang.String ident, @NotNull @NotNull javax.swing.JComponent component, @NotNull @NotNull Location defaultLocation, boolean alternativeLocation, int index, boolean defaultOpen)Creates a new instance.- Parameters:
ident- the tab's identification stringcomponent- the component that is shown when this tab is activedefaultLocation- the tab's default locationalternativeLocation- whether the tab is shown in the alternative locationindex- the tab's index for orderingdefaultOpen- the tab's default opened status
-
-
Method Detail
-
addTabListener
public void addTabListener(@NotNull @NotNull TabListener listener)Adds aTabListenerto be notified.- Parameters:
listener- the listener
-
removeTabListener
public void removeTabListener(@NotNull @NotNull TabListener listener)Removes aTabListenerto be notified.- Parameters:
listener- the listener
-
getComponent
@NotNull public @NotNull java.awt.Component getComponent()
Returns theComponentthat is shown when this tab is active.- Returns:
- the component
-
getButton
@NotNull public @NotNull javax.swing.AbstractButton getButton()
Returns theAbstractButtonfor showing or hiding the component.- Returns:
- the button
-
getPopupMenu
@NotNull public @NotNull javax.swing.JPopupMenu getPopupMenu()
Returns the button's context menu.- Returns:
- the menu
-
getMoveToMenu
@NotNull public @NotNull javax.swing.JMenu getMoveToMenu()
Returns the "Move To" menu within the button's context menu.- Returns:
- the "Move To" menu
-
setSplitModeAction
public void setSplitModeAction(@Nullable @Nullable net.sf.japi.swing.action.ToggleAction splitModeAction)Sets theToggleActionto update if the "split mode" state changes.- Parameters:
splitModeAction- the toggle action
-
isAlternativeLocation
public boolean isAlternativeLocation()
Returns whether the button is shown in the alternative location.- Returns:
- whether the button is shown in the alternative location
-
setAlternativeLocation
public void setAlternativeLocation(boolean alternativeLocation)
Sets whether the button is shown in the alternative location.- Parameters:
alternativeLocation- whether the button is shown in the alternative location
-
getLocation
@NotNull public @NotNull Location getLocation()
Returns the tab's location.- Returns:
- the location
-
setLocation
public void setLocation(@NotNull @NotNull Location location)Sets the tab's location.- Parameters:
location- the location
-
getSize
public int getSize()
Returns the tab's size. Depending on the tab's location either width or height is returned.- Returns:
- the size
-
setSize
public void setSize(int size)
Sets the tab's size.- Parameters:
size- the size; depending on the tab's location either width or height
-
isOpen
public boolean isOpen()
Returns the tab's open status.- Returns:
- whether the tab is open
-
setOpen
public void setOpen(boolean open)
Sets the tab's open status.- Parameters:
open- the tab's open status
-
getSeverity
@NotNull public @NotNull Severity getSeverity()
Returns the tab'sSeverity.- Returns:
- the severity
-
-