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


001:        package net.xoetrope.swing;
002:
003:        import net.xoetrope.xml.XmlElement;
004:        import net.xoetrope.xui.XMetaContentHolder;
005:        import net.xoetrope.xui.style.XStyleComponent;
006:        import java.awt.Color;
007:        import java.awt.Font;
008:        import javax.swing.JScrollPane;
009:        import net.xoetrope.xui.XAttributedComponent;
010:
011:        /**
012:         * <p>Implements a scrollable holder for a XMetaContent component </p>
013:         * <p>Copyright (c) Xoetrope Ltd., 1998-2004<br>
014:         * License:      see license.txt
015:         * $Revision: 1.12 $
016:         */
017:
018:        public class XScrollableMetaContent extends XScrollPane implements 
019:                XMetaContentHolder, XStyleComponent, XAttributedComponent {
020:            private XMetaContent content;
021:
022:            /**
023:             * Constrcuts a new container for an XMetaContent component
024:             */
025:            public XScrollableMetaContent() {
026:                content = new XMetaContent();
027:                setViewportView(content);
028:                setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
029:            }
030:
031:            /**
032:             * Sets the meta content
033:             * @param source the location from which the xml was obtained
034:             * @param src the new content
035:             */
036:            public void setContent(String source, XmlElement src) {
037:                content.setContent(source, src);
038:                doLayout();
039:            }
040:
041:            /**
042:             * Get the meta content's name .
043:             * @return the model name of the content
044:             */
045:            public String getContent() {
046:                return content.getContent();
047:            }
048:
049:            /**
050:             * Get the source of the current content
051:             * @return
052:             */
053:            public String getFileName() {
054:                if (content != null)
055:                    return content.getFileName();
056:
057:                return null;
058:            }
059:
060:            /**
061:             * Get the source of the current content
062:             * @return
063:             */
064:            public void setFileName(String fileName) {
065:                if (content != null)
066:                    content.setFileName(fileName);
067:            }
068:
069:            /**
070:             * Sets the padding for the content
071:             * @param padding
072:             */
073:            public void setPadding(int padding) {
074:                content.setPadding(padding);
075:                doLayout();
076:            }
077:
078:            /**
079:             * Set the current style
080:             * @param style the new style
081:             */
082:            public void setStyle(String style) {
083:                content.setStyle(style);
084:            }
085:
086:            /**
087:             * Set the background color and that of the content
088:             * @param bkColor
089:             */
090:            public void setBackground(Color bkColor) {
091:                super .setBackground(bkColor);
092:                if (content != null)
093:                    content.setBackground(bkColor);
094:            }
095:
096:            /**
097:             * Set the foreground color and that of the content
098:             * @param bkColor
099:             */
100:            public void setForeground(Color fgColor) {
101:                super .setForeground(fgColor);
102:                if (content != null)
103:                    content.setForeground(fgColor);
104:            }
105:
106:            /**
107:             * Set the font and that of the content
108:             * @param font the new font
109:             */
110:            public void setFont(Font font) {
111:                super .setFont(font);
112:                if (content != null)
113:                    content.setFont(font);
114:            }
115:
116:            /**
117:             * Sets the bounds for this component
118:             * @param x
119:             * @param y
120:             * @param w
121:             * @param h
122:             */
123:            public void setBounds(int x, int y, int w, int h) {
124:                content.setBounds(0, 0, w, h);
125:                super .setBounds(x, y, w, h);
126:                doLayout();
127:                content.calcSize();
128:            }
129:
130:            /**
131:             * Set one or more attributes of the component.
132:             * <LI>horizontal scrollbar, values=as needed|always|never</LI>
133:             * <LI>vertical scrollbar, values=as needed|always|never</LI>
134:             * @param attribName the attribute name
135:             * @param attribValue the attribute value
136:             */
137:            public void setAttribute(String attribName, String attribValue) {
138:                String attribNameLwr = attribName.toLowerCase();
139:                String attribValueLwr = attribValue.toLowerCase();
140:                if (attribNameLwr.compareTo("horizontal scrollbar") == 0)
141:                    setVerticalScrollBarPolicy(attribValueLwr
142:                            .equals("as needed") ? JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED
143:                            : attribValueLwr.equals("always") ? JScrollPane.VERTICAL_SCROLLBAR_ALWAYS
144:                                    : JScrollPane.VERTICAL_SCROLLBAR_NEVER);
145:                else if (attribNameLwr.compareTo("vertical scrollbar") == 0)
146:                    setHorizontalScrollBarPolicy(attribValueLwr
147:                            .equals("as needed") ? JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
148:                            : attribValueLwr.equals("always") ? JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
149:                                    : JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
150:            }
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.