01: /*
02: #IFNDEF ALT_LICENSE
03: ThinWire(R) RIA Ajax Framework
04: Copyright (C) 2003-2007 Custom Credit Systems
05:
06: This library is free software; you can redistribute it and/or modify it under
07: the terms of the GNU Lesser General Public License as published by the Free
08: Software Foundation; either version 2.1 of the License, or (at your option) any
09: later version.
10:
11: This library is distributed in the hope that it will be useful, but WITHOUT ANY
12: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13: PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14:
15: You should have received a copy of the GNU Lesser General Public License along
16: with this library; if not, write to the Free Software Foundation, Inc., 59
17: Temple Place, Suite 330, Boston, MA 02111-1307 USA
18:
19: Users who would rather have a commercial license, warranty or support should
20: contact the following company who invented, built and supports the technology:
21:
22: Custom Credit Systems, Richardson, TX 75081, USA.
23: email: info@thinwire.com ph: +1 (888) 644-6405
24: http://www.thinwire.com
25: #ENDIF
26: [ v1.2_RC2 ]
27: */
28: package thinwire.ui;
29:
30: abstract class AbstractRangeComponent extends AbstractComponent
31: implements RangeComponent {
32: private int length;
33: private int currentIndex;
34:
35: public int getCurrentIndex() {
36: return currentIndex;
37: }
38:
39: public void setCurrentIndex(int currentIndex) {
40: if (currentIndex < 0 || currentIndex >= length)
41: throw new IllegalArgumentException(
42: "currentIndex < 0 || currentIndex >= length");
43: int oldIndex = this .currentIndex;
44: this .currentIndex = currentIndex;
45: firePropertyChange(this , PROPERTY_CURRENT_INDEX, oldIndex,
46: this .currentIndex);
47: }
48:
49: public int getLength() {
50: return length;
51: }
52:
53: public void setLength(int length) {
54: if (length < 1)
55: throw new IllegalArgumentException("length < 1");
56: int oldLength = this.length;
57: this.length = length;
58: firePropertyChange(this, PROPERTY_LENGTH, oldLength,
59: this.length);
60: }
61: }
|