 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.dialog.newmap;
22 import java.awt.Component;
23 import java.awt.FlowLayout;
24 import java.io.IOException;
25 import javax.swing.JPanel;
26 import javax.swing.JTextField;
27 import javax.swing.text.JTextComponent;
36 import net.
sf.japi.swing.action.ActionBuilder;
37 import net.
sf.japi.swing.action.ActionBuilderFactory;
38 import org.jetbrains.annotations.NotNull;
39 import org.jetbrains.annotations.Nullable;
56 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
98 final JPanel panel =
new JPanel(
new FlowLayout(FlowLayout.RIGHT));
107 if (mapSize ==
null) {
112 if (pickmapName ==
null) {
119 ACTION_BUILDER.showMessageDialog(
this,
"pickmapExists", pickmapName);
121 }
catch (
final IOException ex) {
122 ACTION_BUILDER.showMessageDialog(
this,
"pickmapIOError", pickmapName, ex.getMessage());
142 return folderName.length() <= 0 ? null : folderName;
final PickmapChooserView< G, A, R > pickmapChooserView
The pickmap chooser view.
static final long serialVersionUID
Serial Version UID.
A View for choosing pickmaps.
Classes implementing the pickmap chooser.
final JTextComponent pickmapNameField
Textfield for the name of the map.
static final ActionBuilder ACTION_BUILDER
Action Builder.
Base package of all Gridarta classes.
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.
Indicates that a pickmap name is not unique within its folder.
Graphical User Interface of Gridarta.
int getMapHeight()
Returns the current map height value.
GameObjects are the objects based on Archetypes found on maps.
JPanel createMapNamePanel()
Dialog to create a new pickmap file.
Interface for MapArchObjects.
NewPickmapDialog(@NotNull final ObjectChooser< G, A, R > objectChooser, @NotNull final Component parentComponent, final int defaultWidth, final int defaultHeight, @NotNull final PickmapChooserView< G, A, R > pickmapChooserView)
Creates a "new pickmap" dialog.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
String getPickmapName()
Returns the current pickmap name value.
Common base interface for ObjectChoosers.
final int defaultWidth
The default width for new maps.
boolean isOkButtonEnabled()
Size2D getMapSize()
Validate the map size fields and return the result.
void newPickmap(@NotNull final Size2D mapSize, @NotNull final String pickmapName)
Add a new pickmap.
final ObjectChooser< G, A, R > objectChooser
The object chooser instance to use.
void movePickmapChooserToFront()
Move the Pickmap Chooser in front of the Archetype Chooser.
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.
The class Size2D represents a 2d rectangular area.