diff options
Diffstat (limited to 'NET/worlds/scape/IntegerPropertyEditor.java')
| -rw-r--r-- | NET/worlds/scape/IntegerPropertyEditor.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/NET/worlds/scape/IntegerPropertyEditor.java b/NET/worlds/scape/IntegerPropertyEditor.java new file mode 100644 index 0000000..dc210ac --- /dev/null +++ b/NET/worlds/scape/IntegerPropertyEditor.java @@ -0,0 +1,35 @@ +package NET.worlds.scape; + +import NET.worlds.console.PolledDialog; + +public class IntegerPropertyEditor extends PropEditor { + boolean rangeLimits = false; + int minVal; + int maxVal; + + private IntegerPropertyEditor(Property property) { + super(property); + } + + private IntegerPropertyEditor(Property property, int minVal, int maxVal) { + super(property); + this.rangeLimits = true; + this.minVal = minVal; + this.maxVal = maxVal; + } + + @Override + public PolledDialog edit(EditTile parent, String title) { + return new IntegerFieldEditorDialog(parent, title, this.property, this); + } + + public static Property make(Property property) { + property.setPropertyType(1); + return property.setEditor(new IntegerPropertyEditor(property)); + } + + public static Property make(Property property, int minVal, int maxVal) { + property.setPropertyType(1); + return property.setEditor(new IntegerPropertyEditor(property, minVal, maxVal)); + } +} |