package NET.worlds.scape; import java.util.StringTokenizer; class Point2EditorDialog extends ListEditorDialog { protected Property property; protected Point2 p; Point2EditorDialog(EditTile parent, String title, Property property) { super(parent, title); this.property = property; this.ready(); } @Override protected void build() { this.p = (Point2)this.property.get(); super.build(); } @Override protected int getElementCount() { return 2; } @Override protected String getElement(int index) { switch (index) { case 0: return "" + this.p.x; default: return "" + this.p.y; } } @Override protected boolean setElements(StringTokenizer e) { Point2 p = new Point2(); int count = 0; while (e.hasMoreTokens()) { try { float tmp = Float.valueOf(e.nextToken()); switch (count++) { case 0: p.x = tmp; break; case 1: p.y = tmp; break; default: return false; } } catch (Exception var5) { return false; } } if (count != 2) { return false; } else { this.parent.addUndoableSet(this.property, p); return true; } } }