20 package net.sf.gridarta.gui.dialog.plugin.parameter;
22 import java.awt.Component;
23 import javax.swing.JComponent;
24 import javax.swing.JFileChooser;
25 import javax.swing.JOptionPane;
26 import javax.swing.JPanel;
27 import javax.swing.event.DocumentEvent;
28 import javax.swing.event.DocumentListener;
38 import org.jetbrains.annotations.NotNull;
58 private final JComponent
config =
new JPanel();
69 value =
new JFileField(parent,
"mapPathPluginParameter", mapFile.
getMapsDir(), mapFile.
getFile(), JFileChooser.FILES_AND_DIRECTORIES);
73 public void insertUpdate(
final DocumentEvent e) {
78 public void removeUpdate(
final DocumentEvent e) {
83 public void changedUpdate(
final DocumentEvent e) {
90 private void setFile() {
92 parameter.setFile(value.
getFile());
94 JOptionPane.showMessageDialog(parent,
"Invalid file: " + ex.getMessage());
void addDocumentListener(@NotNull final DocumentListener documentListener)
Adds a DocumentListener to the text input field.
This class contains methods for converting relative map paths to absolute map paths and vice versa...
Graphical User Interface of Gridarta.
Reading and writing of maps, handling of paths.
A component for selecting files.
Interface for views that display plugin parameters.
static AbsoluteMapPath newAbsoluteMapPath(@NotNull final String string)
Creates an AbsoluteMapPath instance from string representation.
MapPathParameterView(@NotNull final Component parent, @NotNull final MapPathParameter< G, A, R > parameter, @NotNull final PathManager pathManager)
Creates a new instance.
Base package of all Gridarta classes.
JComponent getValueComponent()
Returns a JComponent for editing the parameter value.
Reflects a game object (object on a map).
JComponent getConfigComponent()
Returns a JComponent for editing the parameter configuration.
GameObjects are the objects based on Archetypes found on maps.
Utility class for MapPath related functions.
File getMapsDir()
Returns the base directory this map file is part of.
final JFileField value
The component for editing the parameter's value.
File getFile()
Returns a File for this map file.
An exception that is thrown if the string representation of value in a PluginParameter cannot be conv...
A PluginParameterView that displays a MapPathParameter.
File getFile()
Returns the currently selected file.
A PluginParameter that holds a path with in the maps directory.
The location of a map file with a map directory.
Interface for MapArchObjects.
final JComponent config
The component for editing the parameter's configuration.