20 package net.sf.gridarta.gui.dialog.plugin.parameter;
22 import java.awt.Component;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import javax.swing.AbstractButton;
26 import javax.swing.JButton;
27 import javax.swing.JCheckBox;
28 import javax.swing.JComponent;
29 import javax.swing.JOptionPane;
34 import org.jetbrains.annotations.NotNull;
45 private final AbstractButton
value =
new JCheckBox();
51 private final AbstractButton
config =
new JButton(
"...");
59 value.addActionListener(
new ActionListener() {
62 public void actionPerformed(@NotNull
final ActionEvent e) {
63 if (value.isSelected()) {
64 parameter.setValue(Boolean.TRUE);
65 value.setText(parameter.getTrueText());
67 parameter.setValue(Boolean.FALSE);
68 value.setText(parameter.getFalseText());
74 config.setBorderPainted(
false);
75 config.addActionListener(
new ActionListener() {
78 public void actionPerformed(@NotNull
final ActionEvent e) {
79 final String yes = JOptionPane.showInputDialog(parent,
"Checked text", parameter.getTrueText());
83 parameter.setTrueText(yes);
85 final String no = JOptionPane.showInputDialog(parent,
"Unchecked text", parameter.getFalseText());
89 parameter.setFalseText(no);
Interface for views that display plugin parameters.
final AbstractButton config
The component for editing the parameter's configuration.
Base package of all Gridarta classes.
A PluginParameter that holds a boolean value.
Reflects a game object (object on a map).
BooleanParameterView(@NotNull final Component parent, @NotNull final BooleanParameter< G, A, R > parameter)
Creates a new instance.
GameObjects are the objects based on Archetypes found on maps.
final AbstractButton value
The component for editing the parameter's value.
A PluginParameterView for an BooleanParameter.
JComponent getConfigComponent()
Returns a JComponent for editing the parameter configuration.
JComponent getValueComponent()
Returns a JComponent for editing the parameter value.
Interface for MapArchObjects.