20 package net.sf.gridarta.gui.dialog.prefs;
22 import java.awt.Component;
23 import java.awt.GridBagLayout;
24 import javax.swing.AbstractButton;
25 import javax.swing.Box;
26 import javax.swing.JCheckBox;
27 import javax.swing.JComponent;
28 import javax.swing.JPanel;
29 import javax.swing.JTextField;
30 import javax.swing.border.Border;
31 import javax.swing.border.CompoundBorder;
32 import javax.swing.border.TitledBorder;
33 import javax.swing.event.ChangeEvent;
34 import javax.swing.event.ChangeListener;
35 import javax.swing.text.JTextComponent;
42 import net.
sf.japi.swing.action.ActionBuilder;
43 import net.
sf.japi.swing.action.ActionBuilderFactory;
44 import net.
sf.japi.swing.prefs.AbstractPrefs;
45 import org.jetbrains.annotations.NotNull;
63 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
125 setListLabelIcon(ACTION_BUILDER.getIcon(
"prefsMisc.icon"));
130 add(Box.createVerticalGlue());
164 checkMaps.setSelected(
true);
181 final JComponent panel =
new JPanel(
new GridBagLayout());
184 userField =
new JTextField(projectSettings.
getUserName());
195 final JComponent panel =
new JPanel(
new GridBagLayout());
198 checkMaps =
new JCheckBox(ACTION_BUILDER.createAction(
false,
"optionsCheckMaps"));
210 final JComponent panel =
new JPanel(
new GridBagLayout());
214 pasteExitName =
new JCheckBox(ACTION_BUILDER.createAction(
false,
"optionsExitConnectorPasteExitName"));
218 autoCreateExit =
new JCheckBox(ACTION_BUILDER.createAction(
false,
"optionsExitConnectorAutoCreateExit"));
226 autoCreateExit.addChangeListener(
new ChangeListener() {
229 public void stateChanged(
final ChangeEvent e) {
230 exitArchetypeName.setEnabled(autoCreateExit.isSelected());
234 exitArchetypeName.setEnabled(autoCreateExit.isSelected());
static final ActionBuilder ACTION_BUILDER
Action Builder.
Component createUserPanel()
Creates the sub-panel with the user settings.
Graphical User Interface of Gridarta.
Settings that apply to a project.
static Border createTitledBorder(@NotNull final String title)
Create a titled border.
final ProjectSettings projectSettings
The ProjectSettings to affect.
void setUserName(@NotNull String userName)
Sets the user name.
static boolean isPerformingRealChecks()
Get whether to actually perform real checks or just file endings.
static void setPerformingRealChecks(final boolean performingRealChecks)
Set whether to actually perform real checks or just file endings.
void addComponent(@NotNull final Component component)
Adds a component to the container.
void setExitArchetypeName(@NotNull String exitArchetypeName)
Sets the archetype name for creating exit game objects.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
Base package of all Gridarta classes.
boolean isAutoCreateExit()
Returns whether exit game objects should be auto-created when needed.
Swing FileFilter implementation that filters Daimonin map files.
final EditorSettings editorSettings
The EditorSettings to affect.
AbstractButton autoCreateExit
Check box to set whether exit game objects should be auto-created.
JTextComponent exitArchetypeName
The archetype name for auto-creating exits.
String getUserName()
Returns the user name.
Preferences Module for miscellaneous preferences.
String getUserNameDefault()
Returns the default user name.
Component createExitConnectorPanel()
Creates the sub-panel with the exit connector settings.
final ExitConnectorModel exitConnectorModel
The ExitConnectorModel to affect.
Helper class for preference panes.
AbstractButton pasteExitName
Check box to set whether the map name should be pasted into exit game objects.
MiscPreferences(@NotNull final ExitConnectorModel exitConnectorModel, @NotNull final ProjectSettings projectSettings, @NotNull final EditorSettings editorSettings)
Creates a new instance.
void setAutoCreateExit(boolean autoCreateExit)
Sets whether exit game objects should be auto-created when needed.
String getExitArchetypeName()
Returns the archetype name when creating exit game objects.
Utility class for ActionBuilder related functions.
Stores information needed by the exit connector.
boolean isPasteExitName()
Returns whether the exit name should be updated.
Border DIALOG_BORDER
The Border object to be used when creating dialogs.
AbstractButton checkMaps
Check box to set whether map files should be really checked.
static final long serialVersionUID
The serial version UID.
boolean AUTO_CREATE_EXIT_DEFAULT
The default value for isAutoCreateExit().
static JLabel newLabel(@NotNull final ActionBuilder actionBuilder, @NotNull final String key)
Creates a new JLabel from a resource key.
String EXIT_ARCHETYPE_NAME_DEFAULT
The default value for getExitArchetypeName().
void setPasteExitName(boolean pasteExitName)
Sets whether the exit name should be updated.
Settings that apply to the editor.
boolean PASTE_EXIT_NAME_DEFAULT
The default value for isPasteExitName().
JTextComponent userField
TextField for user / artist name.
Defines common UI constants used in different dialogs.
Component createCheckMapsPanel()
Creates the sub-panel with the check maps settings.