Gridarta Editor
net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Referenceabstract

Base class for GameObjectAttributesTab implementations. More...

+ Inheritance diagram for net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void addGameObjectAttributesTabListener (@NotNull final GameObjectAttributesTabListener< G, A, R > listener)
 
void apply ()
 
Severity getTabSeverity ()
 
void removeGameObjectAttributesTabListener (@NotNull final GameObjectAttributesTabListener< G, A, R > listener)
 
- Public Member Functions inherited from net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesTab< G, A, R >
void activate ()
 Sets the focus to this component. More...
 
void addGameObjectAttributesTabListener ( @NotNull GameObjectAttributesTabListener< G, A, R > listener)
 Adds a listener. More...
 
void apply ()
 Applies the current settings. More...
 
boolean canApply ()
 Returns whether a selected game object exists and the current value differs from the initially set value. More...
 
JPanel getPanel ()
 Creates the contents panel. More...
 
Severity getTabSeverity ()
 Returns the tab severity. More...
 
void removeGameObjectAttributesTabListener ( @NotNull GameObjectAttributesTabListener< G, A, R > listener)
 Removes a listener. More...
 

Protected Member Functions

 AbstractGameObjectAttributesTab (@NotNull final GameObjectAttributesModel< G, A, R > gameObjectAttributesModel)
 Creates a new instance. More...
 
void addAutoApply (@NotNull final Component component)
 Registers a component that auto-applies when the focus is lost. More...
 
abstract void apply (@NotNull G gameObject)
 Applies settings to the given game object. More...
 
GameObject< G, A, R > getSelectedGameObject ()
 Returns the currently selected GameObject. More...
 
abstract void refresh (@Nullable G gameObject)
 Refreshes the display. More...
 
void setTabSeverity (@NotNull final Severity tabSeverity)
 Sets the tab severity. More...
 

Private Member Functions

void fireApply ()
 Notify all listeners to apply the changes. More...
 

Private Attributes

final FocusListener focusListener
 The focus listener to implement auto-applying. More...
 
final Collection< GameObjectAttributesTabListener< G, A, R > > listeners = new ArrayList<>()
 The registered listeners. More...
 
selectedGameObject
 The currently selected game object. More...
 
Severity tabSeverity = Severity.DEFAULT
 The tab severity. More...
 

Detailed Description

Base class for GameObjectAttributesTab implementations.

Author
Andreas Kirschbaum

Definition at line 38 of file AbstractGameObjectAttributesTab.java.

Constructor & Destructor Documentation

◆ AbstractGameObjectAttributesTab()

net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.AbstractGameObjectAttributesTab ( @NotNull final GameObjectAttributesModel< G, A, R >  gameObjectAttributesModel)
protected

Creates a new instance.

Parameters
gameObjectAttributesModelthe model to track

Definition at line 80 of file AbstractGameObjectAttributesTab.java.

Member Function Documentation

◆ addAutoApply()

void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addAutoApply ( @NotNull final Component  component)
protected

Registers a component that auto-applies when the focus is lost.

Parameters
componentthe component

Definition at line 161 of file AbstractGameObjectAttributesTab.java.

◆ addGameObjectAttributesTabListener()

void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addGameObjectAttributesTabListener ( @NotNull final GameObjectAttributesTabListener< G, A, R >  listener)

Definition at line 114 of file AbstractGameObjectAttributesTab.java.

◆ apply() [1/2]

void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.apply ( )

Definition at line 130 of file AbstractGameObjectAttributesTab.java.

Referenced by net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G, A, R >.apply().

+ Here is the caller graph for this function:

◆ apply() [2/2]

abstract void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.apply ( @NotNull G  gameObject)
abstractprotected

Applies settings to the given game object.

Parameters
gameObjectthe game object to set the contents of

◆ fireApply()

void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.fireApply ( )
private

Notify all listeners to apply the changes.

Definition at line 151 of file AbstractGameObjectAttributesTab.java.

◆ getSelectedGameObject()

GameObject<G, A, R> net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getSelectedGameObject ( )
protected

Returns the currently selected GameObject.

Returns
the currently selected game object or
null

Definition at line 170 of file AbstractGameObjectAttributesTab.java.

◆ getTabSeverity()

Severity net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getTabSeverity ( )

Definition at line 125 of file AbstractGameObjectAttributesTab.java.

◆ refresh()

abstract void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.refresh ( @Nullable G  gameObject)
abstractprotected

Refreshes the display.

Parameters
gameObjectthe game object to set the contents from

Referenced by net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G, A, R >.AbstractGameObjectAttributesTab().

+ Here is the caller graph for this function:

◆ removeGameObjectAttributesTabListener()

void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeGameObjectAttributesTabListener ( @NotNull final GameObjectAttributesTabListener< G, A, R >  listener)

Definition at line 119 of file AbstractGameObjectAttributesTab.java.

◆ setTabSeverity()

void net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setTabSeverity ( @NotNull final Severity  tabSeverity)
protected

Sets the tab severity.

Parameters
tabSeveritythe tab severity

Definition at line 102 of file AbstractGameObjectAttributesTab.java.

Member Data Documentation

◆ focusListener

final FocusListener net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.focusListener
private
Initial value:
= new FocusListener() {
@Override
public void focusGained(final FocusEvent e) {
}
@Override
public void focusLost(final FocusEvent e) {
}
}

The focus listener to implement auto-applying.

See {}.

Definition at line 62 of file AbstractGameObjectAttributesTab.java.

Referenced by net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab< G, A, R >.addAutoApply().

◆ listeners

◆ selectedGameObject

◆ tabSeverity


The documentation for this class was generated from the following file:
net.sf.gridarta.gui.panel.gameobjectattributes.AbstractGameObjectAttributesTab.fireApply
void fireApply()
Notify all listeners to apply the changes.
Definition: AbstractGameObjectAttributesTab.java:151