Source Code Cross Referenced for SLabel.java in  » Swing-Library » Swinglets » com » javelin » swinglets » 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 » Swinglets » com.javelin.swinglets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright Javelin Software, All rights reserved.
003:         */
004:
005:        package com.javelin.swinglets;
006:
007:        import java.awt.*;
008:        import java.util.*;
009:        import java.io.*;
010:
011:        /**
012:         * A Label is piece of text.
013:         * 
014:         * @author Robin Sharp
015:         */
016:
017:        import java.awt.*;
018:        import java.io.*;
019:        import java.util.*;
020:        import java.awt.event.*;
021:
022:        import com.javelin.swinglets.event.*;
023:
024:        public class SLabel extends SComponent {
025:            /**
026:             * Creates a <code>JLabel</code> instance with the specified
027:             * text, image, and horizontal alignment.
028:             */
029:            public SLabel(SIcon icon, String text, SLink link) {
030:                if (text != null)
031:                    setText(text);
032:                if (icon != null)
033:                    setIcon(icon);
034:                if (link != null)
035:                    setLink(link);
036:            }
037:
038:            /**
039:             * Creates a <code>JLabel</code> instance with the specified 
040:             * text and image.
041:             */
042:            public SLabel(SIcon icon, String text) {
043:                this (icon, text, null);
044:            }
045:
046:            /**
047:             * Creates a <code>JLabel</code> instance with the specified text
048:             * and link.
049:             */
050:            public SLabel(String text, SLink link) {
051:                this (null, text, link);
052:            }
053:
054:            /**
055:             * Creates a <code>JLabel</code> instance with the specified text.
056:             */
057:            public SLabel(String text) {
058:                this (null, text, null);
059:
060:            }
061:
062:            /**
063:             * Creates a <code>JLabel</code> instance with the specified image.
064:             */
065:            public SLabel(SIcon icon) {
066:                this (icon, null, null);
067:            }
068:
069:            /**
070:             * Creates a <code>JLabel</code> instance with the specified image
071:             * and link.
072:             */
073:            public SLabel(SIcon icon, SLink link) {
074:                this (icon, null, link);
075:            }
076:
077:            /**
078:             * Creates a <code>JLabel</code> instance with 
079:             * no image and with an empty string for the title.
080:             */
081:            public SLabel() {
082:                this (null, "", null);
083:            }
084:
085:            /**
086:             * Returns the name of the L&F class that renders this component.
087:             */
088:            public Class getUIClass() {
089:                return SLabel.class;
090:            }
091:
092:            /** 
093:             * Returns the text string that the label displays.
094:             */
095:            public String getText() {
096:                return text;
097:            }
098:
099:            /**
100:             * Defines the single line of text this component will display. 
101:             */
102:            public SLabel setText(String text) {
103:                firePropertyChange("text", this .text, this .text = text);
104:                return this ;
105:            }
106:
107:            /** 
108:             * Returns the achor
109:             */
110:            public String getAnchor() {
111:                return anchor;
112:            }
113:
114:            /**
115:             * Defines the single line of text this component will display. 
116:             */
117:            public SLabel setAnchor(String anchor) {
118:                firePropertyChange("anchor", this .anchor, this .anchor = anchor);
119:                return this ;
120:            }
121:
122:            /**
123:             * Returns the icon that this label displays.
124:             */
125:            public SIcon getIcon() {
126:                return icon;
127:            }
128:
129:            /**
130:             * Defines the icon this component will display. 
131:             */
132:            public SLabel setIcon(SIcon icon) {
133:                firePropertyChange("icon", this .icon, this .icon = icon);
134:                return this ;
135:            }
136:
137:            /**
138:             * Set the Hyper Link.
139:             */
140:            public SLabel setLink(SLink link) {
141:                firePropertyChange("link", this .link, this .link = link);
142:                return this ;
143:            }
144:
145:            /**
146:             * Returns the alignment of the text relative to the icon.
147:             */
148:            public int getTextAlignment() {
149:                return textAlignment;
150:            }
151:
152:            /**
153:             * Sets the alignment of the text relative to the icon.  
154:             * One of SConstants LEFT, RIGHT
155:             */
156:            public SComponent setTextAlignment(int textAlignment) {
157:                firePropertyChange("textAlignment", this .textAlignment,
158:                        this .textAlignment = textAlignment);
159:                return this ;
160:            }
161:
162:            /**
163:             * Get the Hyper Link.
164:             */
165:            public SLink getLink() {
166:                return link;
167:            }
168:
169:            /** 
170:             * Processes events occurring on this component. 
171:             */
172:            protected void processEvent(AWTEvent event) {
173:                if (event instanceof  FormEvent) {
174:                    processActionEvent(new ActionEvent(this ,
175:                            ActionEvent.ACTION_PERFORMED, null));
176:                } else {
177:                    super .processEvent(event);
178:                }
179:            }
180:
181:            // PRIVATE ////////////////////////////////////////////////////
182:
183:            protected String text;
184:            protected String anchor;
185:            protected SIcon icon;
186:            protected SLink link;
187:            protected int textAlignment = SConstants.RIGHT;
188:
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.