 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.dialog.newmap;
22 import java.awt.GridBagConstraints;
23 import javax.swing.JPanel;
24 import javax.swing.JTextField;
31 import net.
sf.japi.swing.action.ActionBuilder;
32 import net.
sf.japi.swing.action.ActionBuilderFactory;
33 import org.jetbrains.annotations.NotNull;
34 import org.jetbrains.annotations.Nullable;
52 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
107 protected void addFields(@NotNull
final JPanel panel, @NotNull
final GridBagConstraints gbcLabel, @NotNull
final GridBagConstraints gbcField) {
144 return new Size2D(width, height);
154 return width < 1 ? -1 : width;
165 return height < 1 ? -1 : height;
static final Preferences PREFERENCES
Preferences.
static int parseInt(@NotNull final String s)
Parses an integer string.
Base package of all Gridarta classes.
final String heightKey
The preference key for storing the map height; may be.
final int defaultHeight
The default height for new maps.
Reflects a game object (object on a map).
static JLabel newLabel(@NotNull final ActionBuilder actionBuilder, @NotNull final String key)
Creates a new JLabel from a resource key.
int getMapHeight()
Returns the current map height value.
void addDocumentListener( @NotNull final JTextComponent textComponent)
Watches for text changes in a text component and enables the "OK" button accordingly.
final JTextField mapHeightField
Textfield for the height of the new map.
GameObjects are the objects based on Archetypes found on maps.
Dialog used to ask the user the properties for the new level.
Interface for MapArchObjects.
final String widthKey
The preference key for storing the map width; may be.
final int defaultWidth
The default width for new maps.
Size2D getMapSize()
Validate the map size fields and return the result.
An abstract base class implementing a AbstractNewMapDialog supporting map size input fields.
int getMapWidth()
Returns the current map width value.
Utility class for ActionBuilder related functions.
final JTextField mapWidthField
Textfield for the width of the new map.
void setMapSizeEnabled(final boolean enabled)
Enables or disables the map size input fields.
AbstractMapsizeNewMapDialog(@Nullable final String widthKey, @Nullable final String heightKey, final int defaultWidth, final int defaultHeight)
Creates a new instance.
void addFields(@NotNull final JPanel panel, @NotNull final GridBagConstraints gbcLabel, @NotNull final GridBagConstraints gbcField)
The class Size2D represents a 2d rectangular area.
static final ActionBuilder ACTION_BUILDER
Action Builder.
static final long serialVersionUID
The serial version UID.
Utility class for parsing strings into numbers.