Gridarta Editor
net.sf.gridarta.gui.dialog.prefs.ResPreferences Class Reference

Preferences Module for resource preferences. More...

+ Inheritance diagram for net.sf.gridarta.gui.dialog.prefs.ResPreferences:
+ Collaboration diagram for net.sf.gridarta.gui.dialog.prefs.ResPreferences:

Public Member Functions

void apply ()
 
void defaults ()
 
boolean isChanged ()
 
 ResPreferences (@NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings, @NotNull final ConfigSourceFactory configSourceFactory)
 Creates a new instance. More...
 
void revert ()
 

Private Member Functions

Component buildImageSetBox ()
 Constructs the combo box for the selection of image sets. More...
 
Component createGlobalPanel ()
 Creates the sub-panel with the editor settings. More...
 
Component createResourcePanel ()
 Creates the sub-panel with the resource paths. More...
 
String getCurrentImageSet ()
 Returns the name of the currently selected image set. More...
 

Static Private Member Functions

static String convertImageSet (@Nullable final String imageSet)
 Returns a human readable name for a given image set. More...
 
static Border createTitledBorder (final String titleKey)
 Creates a titled border. More...
 

Private Attributes

JFileField archField
 TextField for arch directory path. More...
 
JComboBox< ConfigSourceconfigSourceComboBox
 ComboBox for choosing the configuration source. More...
 
final ConfigSourceFactory configSourceFactory
 The ConfigSourceFactory to use. More...
 
final EditorSettings editorSettings
 The editor settings instance. More...
 
JComboBox< String > imageSetBox
 ComboBox for choosing the image set. More...
 
String[] imageSets
 Contains all supported image sets. More...
 
final ItemListener itemListener
 The ItemListener attached to configSourceComboBox. More...
 
JFileField mapField
 TextField for map directory path. More...
 
JFileField mediaField
 TextField for media directory path. More...
 
final ProjectSettings projectSettings
 The project settings instance. More...
 

Static Private Attributes

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

Detailed Description

Preferences Module for resource preferences.

Author
Christian Hujer
Andreas Kirschbaum @serial exclude

Definition at line 58 of file ResPreferences.java.

Constructor & Destructor Documentation

◆ ResPreferences()

net.sf.gridarta.gui.dialog.prefs.ResPreferences.ResPreferences ( @NotNull final ProjectSettings  projectSettings,
@NotNull final EditorSettings  editorSettings,
@NotNull final ConfigSourceFactory  configSourceFactory 
)

Member Function Documentation

◆ apply()

◆ buildImageSetBox()

Component net.sf.gridarta.gui.dialog.prefs.ResPreferences.buildImageSetBox ( )
private

◆ convertImageSet()

static String net.sf.gridarta.gui.dialog.prefs.ResPreferences.convertImageSet ( @Nullable final String  imageSet)
staticprivate

Returns a human readable name for a given image set.

Parameters
imageSetthe image set
Returns
the name

Definition at line 335 of file ResPreferences.java.

Referenced by net.sf.gridarta.gui.dialog.prefs.ResPreferences.getCurrentImageSet(), and net.sf.gridarta.gui.dialog.prefs.ResPreferences.isChanged().

+ Here is the caller graph for this function:

◆ createGlobalPanel()

Component net.sf.gridarta.gui.dialog.prefs.ResPreferences.createGlobalPanel ( )
private

◆ createResourcePanel()

◆ createTitledBorder()

static Border net.sf.gridarta.gui.dialog.prefs.ResPreferences.createTitledBorder ( final String  titleKey)
staticprivate

Creates a titled border.

Parameters
titleKeythe action key for border title
Returns
the titled border

Definition at line 165 of file ResPreferences.java.

References net.sf.gridarta.gui.dialog.prefs.ResPreferences.ACTION_BUILDER, net.sf.gridarta.gui.utils.GUIConstants.DIALOG_BORDER, and net.sf.gridarta.utils.ActionBuilderUtils.getString().

Referenced by net.sf.gridarta.gui.dialog.prefs.ResPreferences.createGlobalPanel(), and net.sf.gridarta.gui.dialog.prefs.ResPreferences.createResourcePanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaults()

◆ getCurrentImageSet()

String net.sf.gridarta.gui.dialog.prefs.ResPreferences.getCurrentImageSet ( )
private

Returns the name of the currently selected image set.

Returns
the name or "disabled" if no image set is selected

Definition at line 325 of file ResPreferences.java.

References net.sf.gridarta.gui.dialog.prefs.ResPreferences.convertImageSet(), net.sf.gridarta.model.settings.ProjectSettings.getImageSet(), and net.sf.gridarta.gui.dialog.prefs.ResPreferences.projectSettings.

Referenced by net.sf.gridarta.gui.dialog.prefs.ResPreferences.buildImageSetBox(), net.sf.gridarta.gui.dialog.prefs.ResPreferences.isChanged(), and net.sf.gridarta.gui.dialog.prefs.ResPreferences.revert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isChanged()

◆ revert()

Member Data Documentation

◆ ACTION_BUILDER

◆ archField

◆ configSourceComboBox

◆ configSourceFactory

◆ editorSettings

◆ imageSetBox

◆ imageSets

String [] net.sf.gridarta.gui.dialog.prefs.ResPreferences.imageSets
private

◆ itemListener

final ItemListener net.sf.gridarta.gui.dialog.prefs.ResPreferences.itemListener
private
Initial value:
= new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
final ConfigSource configSource = (ConfigSource) e.getItem();
archField.setEnabled(configSource.isArchDirectoryInputFieldEnabled());
}
}
}

The ItemListener attached to configSourceComboBox.

Definition at line 129 of file ResPreferences.java.

Referenced by net.sf.gridarta.gui.dialog.prefs.ResPreferences.createGlobalPanel().

◆ mapField

◆ mediaField

◆ projectSettings

◆ serialVersionUID

final long net.sf.gridarta.gui.dialog.prefs.ResPreferences.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 63 of file ResPreferences.java.


The documentation for this class was generated from the following file:
net.sf.gridarta.gui.dialog.prefs.ResPreferences.archField
JFileField archField
TextField for arch directory path.
Definition: ResPreferences.java:93
net.sf.gridarta.gui.utils.JFileField.setEnabled
void setEnabled(final boolean enabled)
Definition: JFileField.java:176