Source Code Cross Referenced for XPageScroller.java in  » Swing-Library » wings3 » org » wingx » 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 » Swing Library » wings3 » org.wingx 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.wingx;
002:
003:        import org.wings.*;
004:        import org.wings.border.SLineBorder;
005:        import org.wingx.plaf.css.XPageScrollerCG;
006:
007:        import java.awt.*;
008:        import java.awt.event.AdjustmentListener;
009:
010:        public class XPageScroller extends SContainer implements  Adjustable {
011:
012:            SPageScroller pageScroller = new SPageScroller(Adjustable.VERTICAL);
013:            private GridBagConstraints c = new GridBagConstraints();
014:
015:            public XPageScroller() {
016:                super (new SGridBagLayout());
017:                SLineBorder border = new SLineBorder(new Color(200, 200, 200),
018:                        0);
019:                border.setThickness(1, SConstants.TOP);
020:                setBorder(border);
021:                setPreferredSize(SDimension.FULLWIDTH);
022:
023:                c.anchor = GridBagConstraints.EAST;
024:                add(pageScroller);
025:
026:                pageScroller.setCG(new XPageScrollerCG());
027:                pageScroller.setLayoutMode(Adjustable.HORIZONTAL);
028:                pageScroller.setDirectPages(5);
029:                pageScroller.setShowAsFormComponent(false);
030:            }
031:
032:            public SComponent add(SComponent component) {
033:                c.weightx = 0d;
034:                component.setVerticalAlignment(SConstants.CENTER_ALIGN);
035:                return super .addComponent(component, c);
036:            }
037:
038:            public SComponent add(SComponent component, double weight) {
039:                c.weightx = weight;
040:                return super .addComponent(component, c);
041:            }
042:
043:            public void reset(int total) {
044:                while (getComponentCount() > 1) {
045:                    remove(1);
046:                }
047:                normalize(total);
048:            }
049:
050:            public void normalize(int total) {
051:                int value = pageScroller.getValue();
052:                int visible = pageScroller.getVisibleAmount();
053:                if (value + visible > total) {
054:                    value = Math.max(0, total - visible);
055:                    pageScroller.setValue(value);
056:                }
057:            }
058:
059:            public void setUnitIncrement(int i) {
060:                pageScroller.setUnitIncrement(i);
061:            }
062:
063:            public void setBlockIncrement(int i) {
064:                pageScroller.setBlockIncrement(i);
065:            }
066:
067:            public int getUnitIncrement() {
068:                return pageScroller.getUnitIncrement();
069:            }
070:
071:            public int getBlockIncrement() {
072:                return pageScroller.getBlockIncrement();
073:            }
074:
075:            public int getValue() {
076:                return pageScroller.getValue();
077:            }
078:
079:            public void setExtent(int value) {
080:                pageScroller.setExtent(value);
081:            }
082:
083:            public int getVisibleAmount() {
084:                return pageScroller.getVisibleAmount();
085:            }
086:
087:            public void setVisibleAmount(int i) {
088:                pageScroller.setVisibleAmount(i);
089:            }
090:
091:            public int getMinimum() {
092:                return pageScroller.getMinimum();
093:            }
094:
095:            public void setMinimum(int i) {
096:                pageScroller.setMinimum(i);
097:            }
098:
099:            public int getMaximum() {
100:                return pageScroller.getMaximum();
101:            }
102:
103:            public void setMaximum(int i) {
104:                pageScroller.setMaximum(i);
105:            }
106:
107:            public int getOrientation() {
108:                return pageScroller.getOrientation();
109:            }
110:
111:            public void setValue(int i) {
112:                pageScroller.setValue(i);
113:            }
114:
115:            public void addAdjustmentListener(
116:                    AdjustmentListener adjustmentListener) {
117:                pageScroller.addAdjustmentListener(adjustmentListener);
118:            }
119:
120:            public void removeAdjustmentListener(
121:                    AdjustmentListener adjustmentListener) {
122:                pageScroller.removeAdjustmentListener(adjustmentListener);
123:            }
124:
125:            public SPageScroller getPageScroller() {
126:                return pageScroller;
127:            }
128:
129:            public SBoundedRangeModel getModel() {
130:                return pageScroller.getModel();
131:            }
132:
133:            public void setModel(SBoundedRangeModel newModel) {
134:                pageScroller.setModel(newModel);
135:            }
136:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.