Source Code Cross Referenced for OccurEvent.java in  » Ajax » zk » org » zkforge » timeline » data » 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 » Ajax » zk » org.zkforge.timeline.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.zkforge.timeline.data;
002:
003:        import java.util.Date;
004:
005:        import org.zkforge.json.simple.JSONObject;
006:        import org.zkforge.timeline.util.TimelineUtil;
007:
008:        public class OccurEvent implements  Comparable {
009:            private static int count = 0;
010:
011:            // @Override
012:            public String toString() {
013:                // TODO Auto-generated method stub
014:                JSONObject json = new JSONObject();
015:                json.put("id", new Integer(_id));
016:                if (_start != null)
017:                    json.put("start", TimelineUtil.formatDateTime(_start));
018:                if (_end != null)
019:                    json.put("end", TimelineUtil.formatDateTime(_end));
020:                if (_latestStart != null)
021:                    json.put("latestStart", TimelineUtil
022:                            .formatDateTime(_latestStart));
023:                if (_earliestEnd != null)
024:                    json.put("earliestEnd", TimelineUtil
025:                            .formatDateTime(_earliestEnd));
026:                json.put("duration", Boolean.valueOf(_duration));
027:                if (_text != null)
028:                    json.put("text", _text);
029:                if (_description != null)
030:                    json.put("description", _description);
031:                if (_imageUrl != null)
032:                    json.put("image", _imageUrl);
033:                if (_linkUrl != null)
034:                    json.put("link", _linkUrl);
035:                if (_iconUrl != null)
036:                    json.put("icon", _iconUrl);
037:                if (_wikiUrl != null)
038:                    json.put("wikiUrl", _wikiUrl);
039:                if (_wikiSection != null)
040:                    json.put("wikiSection", _wikiSection);
041:
042:                if (_color != null)
043:                    json.put("color", _color);
044:                if (_textColor != null)
045:                    json.put("textColor", _textColor);
046:                return json.toString();
047:            }
048:
049:            private Date _start = new Date();
050:
051:            private Date _end = null;
052:
053:            private Date _latestStart = null;
054:
055:            private Date _earliestEnd = null;
056:
057:            private String _text = "";
058:
059:            private String _description = "";
060:
061:            private String _imageUrl = "";
062:
063:            private String _linkUrl = "";
064:
065:            private String _iconUrl = "";
066:
067:            private String _wikiUrl = null;
068:
069:            private String _wikiSection = null;
070:
071:            private boolean _duration = true;
072:
073:            private String _color = null;
074:
075:            private String _textColor = null;
076:
077:            private int _id = count++;
078:
079:            public String getColor() {
080:                return _color;
081:            }
082:
083:            public void setColor(String color) {
084:                this ._color = color;
085:            }
086:
087:            public String getDescription() {
088:                return _description;
089:            }
090:
091:            public void setDescription(String description) {
092:                this ._description = description;
093:            }
094:
095:            public boolean isDuration() {
096:                return _duration;
097:            }
098:
099:            public void setDuration(boolean duration) {
100:                this ._duration = duration;
101:            }
102:
103:            public Date getEarliestEnd() {
104:                return _earliestEnd;
105:            }
106:
107:            public void setEarliestEnd(Date earliestEnd) {
108:                this ._earliestEnd = earliestEnd;
109:            }
110:
111:            public Date getEnd() {
112:                return _end;
113:            }
114:
115:            public void setEnd(Date end) {
116:                this ._end = end;
117:            }
118:
119:            public String getImageUrl() {
120:                return _imageUrl;
121:            }
122:
123:            public void setImageUrl(String imageUrl) {
124:                this ._imageUrl = imageUrl;
125:            }
126:
127:            public Date getLatestStart() {
128:                return _latestStart;
129:            }
130:
131:            public void setLatestStart(Date latestStart) {
132:                this ._latestStart = latestStart;
133:            }
134:
135:            public String getLinkUrl() {
136:                return _linkUrl;
137:            }
138:
139:            public void setLinkUrl(String linkUrl) {
140:                this ._linkUrl = linkUrl;
141:            }
142:
143:            public Date getStart() {
144:                return _start;
145:            }
146:
147:            public void setStart(Date start) {
148:                this ._start = start;
149:            }
150:
151:            public String getText() {
152:                return _text;
153:            }
154:
155:            public void setText(String text) {
156:                this ._text = text;
157:            }
158:
159:            public String getTextColor() {
160:                return _textColor;
161:            }
162:
163:            public void setTextColor(String textColor) {
164:                this ._textColor = textColor;
165:            }
166:
167:            public String getWikiUrl() {
168:                return _wikiUrl;
169:            }
170:
171:            public void setWikiUrl(String wikiUrl) {
172:                this ._wikiUrl = wikiUrl;
173:            }
174:
175:            public String getIconUrl() {
176:                return _iconUrl;
177:            }
178:
179:            public void setIconUrl(String iconUrl) {
180:                this ._iconUrl = iconUrl;
181:            }
182:
183:            public String getId() {
184:                return String.valueOf(_id);
185:            }
186:
187:            public int compareTo(Object target) {
188:                // TODO Auto-generated method stub
189:                // System.out.println(this);
190:                // System.out.println(target);
191:                int ret;
192:                if (target == null)
193:                    ret = 1;
194:                else {
195:                    OccurEvent evt = (OccurEvent) target;
196:                    int sc;// result of start date to compare
197:                    int ec;// result of end date to compare
198:                    if (getStart() == null && evt.getStart() != null)
199:                        sc = -1;
200:                    else if (getStart() != null && evt.getStart() == null)
201:                        sc = 1;
202:                    else if (getStart() == null && evt.getStart() == null)
203:                        sc = 0;
204:                    else
205:                        sc = getStart().compareTo(evt.getStart());
206:
207:                    if (getEnd() == null && evt.getEnd() != null)
208:                        ec = -1;
209:                    else if (getEnd() == null && evt.getEnd() == null)
210:                        ec = 0;
211:                    else if (getEnd() != null && evt.getEnd() == null)
212:                        ec = 1;
213:                    else
214:                        ec = getEnd().compareTo(evt.getEnd());
215:
216:                    if ((sc < 0) || (sc == 0 && ec < 0))
217:                        ret = -1;
218:                    else if ((sc > 0) || (sc == 0 && ec > 0))
219:                        ret = 1;
220:                    else
221:                        ret = 0;
222:                }
223:                // System.out.println(ret);
224:                return ret;
225:            }
226:
227:            /**
228:             * @return the _wikiSection
229:             */
230:            public String getWikiSection() {
231:                return _wikiSection;
232:            }
233:
234:            /**
235:             * @param wikiSection
236:             *            the _wikiSection to set
237:             */
238:            public void setWikiSection(String wikiSection) {
239:                _wikiSection = wikiSection;
240:            }
241:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.