Source Code Cross Referenced for XSlider.java in  » XML-UI » xui32 » com » xoetrope » swing » 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 » XML UI » xui32 » com.xoetrope.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        package com.xoetrope.swing;
02:
03:        import java.awt.Dimension;
04:        import javax.swing.JSlider;
05:        import javax.swing.event.ChangeEvent;
06:        import javax.swing.event.ChangeListener;
07:
08:        /**
09:         * Wraps JSlider and adds some convenience methods and configuration
10:         *
11:         * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
12:         * the GNU Public License (GPL), please see license.txt for more details. If
13:         * you make commercial use of this software you must purchase a commercial
14:         * license from Xoetrope.</p>
15:         * <p> $Revision: 1.9 $</p>
16:         */
17:        public class XSlider extends JSlider implements  ChangeListener {
18:            private final static int DEFAULT_WIDTH = 100;
19:            private final static int DEFAULT_HEIGHT = 15;
20:
21:            private final static int DEFAULT_MIN = 0;
22:            private final static int DEFAULT_MAX = 100;
23:
24:            /**
25:             * Create a new slider
26:             */
27:            public XSlider() {
28:                initialize();
29:            }
30:
31:            private void initialize() {
32:                setPreferredSize(new Dimension(100, 25));
33:
34:                setMinimum(DEFAULT_MIN);
35:                setMaximum(DEFAULT_MAX);
36:
37:                setPaintTicks(true);
38:                setPaintLabels(true);
39:                setMajorTickSpacing(50);
40:                setMinorTickSpacing(10);
41:
42:                addChangeListener(this );
43:            }
44:
45:            /**
46:             * Set one or more attributes of the component.
47:             * <OL>
48:             * <LI>min, value=the minimum field value</LI>
49:             * <LI>max, value=the maximum field value</LI>
50:             * <LI>step, value=the field step size</LI>
51:             * </OL>
52:             * @param attribName the attribute name
53:             * @param attribValue the attribute value
54:             */
55:            public void setAttribute(String attribName, Object attribValue) {
56:                String attribNameLwr = attribName.toLowerCase();
57:                String attribValueLwr = ((String) attribValue).toLowerCase();
58:                if (attribNameLwr.equals("minimum"))
59:                    setMinimum(Integer.parseInt(attribValueLwr));
60:                else if (attribNameLwr.equals("maximum"))
61:                    setMaximum(Integer.parseInt(attribValueLwr));
62:                else if (attribNameLwr.equals("increment"))
63:                    setIncrement(Integer.parseInt(attribValueLwr));
64:            }
65:
66:            /**
67:             * The state has changed
68:             * @param e the state change event
69:             */
70:            public void stateChanged(ChangeEvent e) {
71:            }
72:
73:            /**
74:             * Determines if the object can accept the input focus in response to user tab
75:             * key presses.
76:             * @return false.
77:             */
78:            public boolean isFocusable() {
79:                return true;
80:            }
81:
82:            /**
83:             * Sets the controls page size.
84:             * @param mi Set the slider increment
85:             */
86:            public void setIncrement(int mi) {
87:                setMajorTickSpacing(mi);
88:                setSnapToTicks(true);
89:            }
90:
91:            /**
92:             * Gets the control's page size.
93:             * @return the slider increment
94:             */
95:            public int getIncrement() {
96:                return getMajorTickSpacing();
97:            }
98:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.