Source Code Cross Referenced for Slider.java in  » Web-Framework » ThinWire » thinwire » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » ThinWire » thinwire.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:        #IFNDEF ALT_LICENSE
003:                                   ThinWire(R) RIA Ajax Framework
004:                         Copyright (C) 2003-2007 Custom Credit Systems
005:
006:          This library is free software; you can redistribute it and/or modify it under
007:          the terms of the GNU Lesser General Public License as published by the Free
008:          Software Foundation; either version 2.1 of the License, or (at your option) any
009:          later version.
010:
011:          This library is distributed in the hope that it will be useful, but WITHOUT ANY
012:          WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
013:          PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
014:
015:          You should have received a copy of the GNU Lesser General Public License along
016:          with this library; if not, write to the Free Software Foundation, Inc., 59
017:          Temple Place, Suite 330, Boston, MA 02111-1307 USA
018:
019:          Users who would rather have a commercial license, warranty or support should
020:          contact the following company who invented, built and supports the technology:
021:          
022:                        Custom Credit Systems, Richardson, TX 75081, USA.
023:           	            email: info@thinwire.com    ph: +1 (888) 644-6405
024:         	                        http://www.thinwire.com
025:        #ENDIF
026:         [ v1.2_RC2 ] 
027:         */
028:        package thinwire.ui;
029:
030:        /**
031:         * A Slider is a screen element that has a cursor that can be set to any position between zero and a specified length.
032:         * Sliders are either horizontal or vertical depending on their dimensions.  If the width is greater than the height,
033:         * then the Slider is horizontal, otherwise it is vertical.
034:         * <p>
035:         * <b>Example:</b> <br>
036:         * <img src="doc-files/Slider-1.png"> <br>
037:         * 
038:         * <pre>
039:         * Frame f = Application.current().getFrame();
040:         * f.setTitle(&quot;Slider Test&quot;);
041:         * Dialog d = new Dialog(&quot;Slider Test&quot;);
042:         * d.setBounds(10, 10, 250, 150);
043:         * final Slider s = new Slider(5, 3);
044:         * s.setBounds(10, 10, 100, 20);
045:         * s.addPropertyChangeListener(Slider.PROPERTY_CURRENT_INDEX, new PropertyChangeListener() {
046:         *     public void propertyChange(PropertyChangeEvent ev) {
047:         *         tf.setText(String.valueOf((Integer) ev.getNewValue()));
048:         *     }
049:         * });
050:         * d.getChildren().add(s);
051:         * final TextField tf = new TextField();
052:         * tf.setBounds(10, 40, 50, 20);
053:         * tf.setText(String.valueOf(s.getCurrentIndex()));
054:         * d.getChildren().add(tf);
055:         * Button b = new Button(&quot;SetValue&quot;);
056:         * b.setBounds(70, 35, 60, 30);
057:         * b.addActionListener(Button.ACTION_CLICK, new ActionListener() {
058:         *     public void actionPerformed(ActionEvent ev) {
059:         *         s.setCurrentIndex(Integer.parseInt(tf.getText()));
060:         *     }
061:         * });
062:         * d.getChildren().add(b);
063:         * f.getChildren().add(d);
064:         * </pre>
065:         * 
066:         * </p>
067:         * <p>
068:         * <b>Keyboard Navigation:</b><br>
069:         * <table border="1">
070:         * <tr>
071:         * <td>KEY</td>
072:         * <td>RESPONSE</td>
073:         * <td>NOTE</td>
074:         * </tr>
075:         * <tr>
076:         * <td>Right Arrow</td>
077:         * <td>Increments the cursorIndex by 1 and Fires PropertyChangeEvent( propertyName = Slider.PROPERTY_CURSOR_INDEX )</td>
078:         * <td>Only if the component is horizontal.</td>
079:         * </tr>
080:         * <tr>
081:         * <td>Left Arrow</td>
082:         * <td>Decrements the cursorIndex by 1 and Fires PropertyChangeEvent( propertyName = Slider.PROPERTY_CURSOR_INDEX )</td>
083:         * <td>Only if the component is horizontal.</td>
084:         * </tr>
085:         * <tr>
086:         * <td>Up Arrow</td>
087:         * <td>Increments the cursorIndex by 1 and Fires PropertyChangeEvent( propertyName = Slider.PROPERTY_CURSOR_INDEX )</td>
088:         * <td>Only if the component is vertical.</td>
089:         * </tr>
090:         * <tr>
091:         * <td>Down Arrow</td>
092:         * <td>Decrements the cursorIndex by 1 and Fires PropertyChangeEvent( propertyName = Slider.PROPERTY_CURSOR_INDEX )</td>
093:         * <td>Only if the component is vertical.</td>
094:         * </tr>
095:         * </table>
096:         * </p>
097:         * 
098:         * @author Ted C. Howard
099:         */
100:        public class Slider extends AbstractRangeComponent {
101:            /**
102:             * Constructs a new <code>Slider</code> with a length of 100 and initial currentIndex of 0.
103:             *
104:             */
105:            public Slider() {
106:                this (100);
107:            }
108:
109:            /**
110:             * Constructs a new <code>Slider</code> with the specified length and an initial currentIndex of 0.
111:             * @param length the number of increments on the Slider
112:             */
113:            public Slider(int length) {
114:                this (length, 0);
115:            }
116:
117:            /**
118:             * Constructs a new <code>Slider</code> with the specifed length and initial currentIndex.
119:             * @param length the number of increments on the Slider
120:             * @param currentIndex the initial position of the cursor
121:             */
122:            public Slider(int length, int currentIndex) {
123:                setLength(length);
124:                setCurrentIndex(currentIndex);
125:            }
126:
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.