Gridarta Editor
net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Referenceabstract

Dialog used to ask the user the properties for the new level. More...

+ Inheritance diagram for net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void mapCancel ()
 Action method for cancel. More...
 
void mapOkay ()
 Action method for okay. More...
 
void setValue (@Nullable final Object newValue)
 

Protected Member Functions

 AbstractNewMapDialog ()
 Constructs a new map dialog. More...
 
void addDocumentListener (@NotNull final JTextComponent textComponent)
 Watches for text changes in a text component and enables the "OK" button accordingly. More...
 
abstract void addFields (@NotNull JPanel panel, @NotNull GridBagConstraints gbcLabel, @NotNull GridBagConstraints gbcField)
 Adds additional fields to the dialog. More...
 
abstract JPanel createMapNamePanel ()
 
JPanel createMapParametersPanel ()
 
abstract boolean createNew ()
 Checks the given values and creates a new map. More...
 
void init1 (@NotNull final Component parentComponent, @NotNull final String dialogTitle)
 Initializes the dialog. More...
 
void init2 ()
 Initializes the dialog. More...
 
boolean isOkButtonEnabled ()
 Returns whether the "OK" button is enabled depending on the dialog's contents. More...
 
void updateOkButton ()
 Updates the enabled state of the "OK" button depending on the dialog's contents. More...
 

Static Protected Attributes

static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
 Preferences. More...
 

Private Member Functions

JPanel createPanel ()
 

Private Attributes

final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this))
 JButton for cancel. More...
 
JDialog dialog
 
final DocumentListener documentListener
 The DocumentListener attached to input fields for detecting changes. More...
 
final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this))
 JButton for ok. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 Action Builder. More...
 
static final long serialVersionUID = 1L
 Serial Version UID. More...
 

Detailed Description

Dialog used to ask the user the properties for the new level.

Contains a tabbed pane for creating a level either based on a template or from a scratch.

Author
Michael Toennies
Andreas Vogl
Christian Hujer @noinspection AbstractClassExtendsConcreteClass

Definition at line 62 of file AbstractNewMapDialog.java.

Constructor & Destructor Documentation

◆ AbstractNewMapDialog()

net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.AbstractNewMapDialog ( )
protected

Constructs a new map dialog.

Builds the dialog UI.

Definition at line 123 of file AbstractNewMapDialog.java.

Member Function Documentation

◆ addDocumentListener()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addDocumentListener ( @NotNull final JTextComponent  textComponent)
protected

Watches for text changes in a text component and enables the "OK" button accordingly.

Parameters
textComponentthe text component to watch

Definition at line 250 of file AbstractNewMapDialog.java.

◆ addFields()

abstract void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addFields ( @NotNull JPanel  panel,
@NotNull GridBagConstraints  gbcLabel,
@NotNull GridBagConstraints  gbcField 
)
abstractprotected

Adds additional fields to the dialog.

Will be called once when the dialog is created.

Parameters
panelthe panel to add the fields to
gbcLabelthe grid bag constraints for the label part
gbcFieldthe grid bag constraints for the input field

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.createMapParametersPanel().

+ Here is the caller graph for this function:

◆ createMapNamePanel()

abstract JPanel net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createMapNamePanel ( )
abstractprotected

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.createPanel().

+ Here is the caller graph for this function:

◆ createMapParametersPanel()

JPanel net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createMapParametersPanel ( )
protected

Definition at line 170 of file AbstractNewMapDialog.java.

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.createPanel().

+ Here is the caller graph for this function:

◆ createNew()

abstract boolean net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createNew ( )
abstractprotected

Checks the given values and creates a new map.

Returns
true
if the map was created,
false
if the parameters were wrong

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.mapOkay().

+ Here is the caller graph for this function:

◆ createPanel()

JPanel net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createPanel ( )
private

Definition at line 154 of file AbstractNewMapDialog.java.

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.init1().

+ Here is the caller graph for this function:

◆ init1()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.init1 ( @NotNull final Component  parentComponent,
@NotNull final String  dialogTitle 
)
protected

Initializes the dialog.

Parameters
parentComponentthe parent component of this dialog
dialogTitlethe dialog's title

Definition at line 131 of file AbstractNewMapDialog.java.

◆ init2()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.init2 ( )
protected

Initializes the dialog.

Definition at line 148 of file AbstractNewMapDialog.java.

◆ isOkButtonEnabled()

boolean net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isOkButtonEnabled ( )
protected

Returns whether the "OK" button is enabled depending on the dialog's contents.

Returns
whether the "OK" button is enabled

Definition at line 241 of file AbstractNewMapDialog.java.

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.mapOkay(), and net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.updateOkButton().

+ Here is the caller graph for this function:

◆ mapCancel()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapCancel ( )

Action method for cancel.

Definition at line 209 of file AbstractNewMapDialog.java.

◆ mapOkay()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapOkay ( )

Action method for okay.

Definition at line 199 of file AbstractNewMapDialog.java.

◆ setValue()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setValue ( @Nullable final Object  newValue)

◆ updateOkButton()

void net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateOkButton ( )
protected

Updates the enabled state of the "OK" button depending on the dialog's contents.

Definition at line 232 of file AbstractNewMapDialog.java.

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

◆ cancelButton

final JButton net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this))
private

◆ dialog

◆ documentListener

final DocumentListener net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.documentListener
private
Initial value:
= new DocumentListener() {
@Override
public void insertUpdate(@NotNull final DocumentEvent e) {
}
@Override
public void removeUpdate(@NotNull final DocumentEvent e) {
}
@Override
public void changedUpdate(@NotNull final DocumentEvent e) {
}
}

The DocumentListener attached to input fields for detecting changes.

Definition at line 101 of file AbstractNewMapDialog.java.

Referenced by net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G, A, R >.addDocumentListener().

◆ okButton

final JButton net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this))
private

◆ PREFERENCES

final Preferences net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.PREFERENCES = Preferences.userNodeForPackage(MainControl.class)
staticprotected

Preferences.

Definition at line 79 of file AbstractNewMapDialog.java.

◆ serialVersionUID

final long net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.serialVersionUID = 1L
staticprivate

Serial Version UID.

Definition at line 67 of file AbstractNewMapDialog.java.


The documentation for this class was generated from the following file:
net.sf.gridarta.gui.dialog.newmap.AbstractNewMapDialog.updateOkButton
void updateOkButton()
Updates the enabled state of the "OK" button depending on the dialog's contents.
Definition: AbstractNewMapDialog.java:232