Class AbstractGameObjectAttributesTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab<G,A,R>
-
- All Implemented Interfaces:
GameObjectAttributesTab<G,A,R>
- Direct Known Subclasses:
ArchTab,EventsTab,FaceTab,MsgTextTab,TextEditorTab
public abstract class AbstractGameObjectAttributesTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements GameObjectAttributesTab<G,A,R>
Base class forGameObjectAttributesTabimplementations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGameObjectAttributesTab(@NotNull GameObjectAttributesModel<G,A,R> gameObjectAttributesModel)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddAutoApply(@NotNull java.awt.Component component)Registers a component that auto-applies when the focus is lost.voidaddGameObjectAttributesTabListener(@NotNull GameObjectAttributesTabListener<G,A,R> listener)Adds a listener.voidapply()Applies the current settings.protected abstract voidapply(G gameObject)Applies settings to the given game object.protected @Nullable GameObject<G,A,R>getSelectedGameObject()Returns the currently selectedGameObject.@NotNull SeveritygetTabSeverity()Returns the tab severity.protected abstract voidrefresh(G gameObject)Refreshes the display.voidremoveGameObjectAttributesTabListener(@NotNull GameObjectAttributesTabListener<G,A,R> listener)Removes a listener.protected voidsetTabSeverity(@NotNull Severity tabSeverity)Sets the tab severity.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesTab
activate, canApply, getPanel
-
-
-
-
Constructor Detail
-
AbstractGameObjectAttributesTab
protected AbstractGameObjectAttributesTab(@NotNull @NotNull GameObjectAttributesModel<G,A,R> gameObjectAttributesModel)Creates a new instance.- Parameters:
gameObjectAttributesModel- the model to track
-
-
Method Detail
-
setTabSeverity
protected void setTabSeverity(@NotNull @NotNull Severity tabSeverity)Sets the tab severity.- Parameters:
tabSeverity- the tab severity
-
addGameObjectAttributesTabListener
public void addGameObjectAttributesTabListener(@NotNull @NotNull GameObjectAttributesTabListener<G,A,R> listener)Description copied from interface:GameObjectAttributesTabAdds a listener.- Specified by:
addGameObjectAttributesTabListenerin interfaceGameObjectAttributesTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
listener- the listener
-
removeGameObjectAttributesTabListener
public void removeGameObjectAttributesTabListener(@NotNull @NotNull GameObjectAttributesTabListener<G,A,R> listener)Description copied from interface:GameObjectAttributesTabRemoves a listener.- Specified by:
removeGameObjectAttributesTabListenerin interfaceGameObjectAttributesTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
listener- the listener
-
getTabSeverity
@NotNull public @NotNull Severity getTabSeverity()
Description copied from interface:GameObjectAttributesTabReturns the tab severity.- Specified by:
getTabSeverityin interfaceGameObjectAttributesTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Returns:
- the tab severity
-
apply
public void apply()
Description copied from interface:GameObjectAttributesTabApplies the current settings. It will be run within a map transaction for the current game object. This function will not be called unlessGameObjectAttributesTab.canApply()returnstrue.- Specified by:
applyin interfaceGameObjectAttributesTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
refresh
protected abstract void refresh(@Nullable G gameObject)Refreshes the display.- Parameters:
gameObject- the game object to set the contents from
-
apply
protected abstract void apply(@NotNull G gameObject)Applies settings to the given game object.- Parameters:
gameObject- the game object to set the contents of
-
addAutoApply
protected void addAutoApply(@NotNull @NotNull java.awt.Component component)Registers a component that auto-applies when the focus is lost.- Parameters:
component- the component
-
getSelectedGameObject
@Nullable protected @Nullable GameObject<G,A,R> getSelectedGameObject()
Returns the currently selectedGameObject.- Returns:
- the currently selected game object or
null
-
-