20 package net.sf.gridarta.gui.dialog.plugin.parameter.map;
22 import java.awt.event.ItemEvent;
23 import java.awt.event.ItemListener;
24 import javax.swing.JComboBox;
25 import javax.swing.JComponent;
26 import javax.swing.JPanel;
35 import org.jetbrains.annotations.NotNull;
46 private final JComboBox<MapControl<G, A, R>>
value =
new JComboBox<>();
53 private final JComponent
config =
new JPanel();
63 value.addItemListener(
new ItemListener() {
66 public void itemStateChanged(
final ItemEvent e) {
67 if (e.getStateChange() == ItemEvent.SELECTED) {
68 if (value.getSelectedIndex() == 0) {
69 parameter.setValueToCurrent();
72 final String stringValue;
73 if (mapControl == null) {
79 parameter.setStringValue(stringValue);
84 value.setSelectedItem(parameter.getValueOrNull());
String getPath()
Returns the map path information.
A PluginParameter that holds a MapControl value.
A MapManager manages all opened maps.
Graphical User Interface of Gridarta.
AbsoluteMapPath getMapPath()
Returns the map path within getMapsDir().
Interface for views that display plugin parameters.
A PluginParameterView for a MapParameter.
MapModel< G, A, R > getMapModel()
Returns the map model.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
final JComboBox< MapControl< G, A, R > > value
The component for editing the parameter's value.
Currently nothing more than a marker interface for unification.
MapFile getMapFile()
Returns the map file.
JComponent getValueComponent()
Returns a JComponent for editing the parameter value.
final JComponent config
The component for editing the parameter's configuration.
The location of a map file with a map directory.
MapParameterView(@NotNull final MapParameter< G, A, R > parameter, @NotNull final MapManager< G, A, R > mapManager)
Creates a new instance.
Interface for MapArchObjects.
JComponent getConfigComponent()
Returns a JComponent for editing the parameter configuration.