summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/BooleanFieldEditorDialog.java
blob: ad0f6c9570f005df88d5bcf0016c276ea65aa747 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package NET.worlds.scape;

class BooleanFieldEditorDialog extends CheckboxEditorDialog {
   private Property property;

   BooleanFieldEditorDialog(EditTile parent, String title, Property property, String[] choices) {
      super(parent, title, choices);
      this.property = property;
      this.ready();
   }

   @Override
   protected int getValue() {
      Boolean value = (Boolean) this.property.get();

      return (value != null && value) ? 1 : 0;
   }

   @Override
   protected void setValue(int choice) {
      this.parent.addUndoableSet(this.property, new Boolean(choice == 1));
   }
}