Source Code Cross Referenced for JXObject.java in  » Swing-Library » OpenJX » org » openjx » core » 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 » OpenJX » org.openjx.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2007 Jared Alexander Spigner
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2.1 of the License, or any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
017:         *
018:         * jspigner@openjx.org
019:         *
020:         * JXObject.java
021:         *
022:         * Created June 8, 2007, 11:39 PM
023:         *
024:         */
025:
026:        package org.openjx.core;
027:
028:        import java.util.HashMap;
029:
030:        import java.beans.PropertyChangeEvent;
031:        import java.beans.PropertyChangeSupport;
032:        import java.beans.PropertyChangeListener;
033:
034:        /**
035:         * This class represents a JXObject.  JXObjects themselves represent an OpenJX
036:         * control or GUI element on the stack in the Virtual Machine.
037:         *
038:         * @author Jared Spigner
039:         */
040:        public class JXObject extends JXStack {
041:            /** This is the objects tag. */
042:            private String objectTAG;
043:
044:            /** This is the objects name. */
045:            private String objectName;
046:
047:            private JXObject objectLast;
048:
049:            /** This is the object state (true/open) (false/closed). */
050:            private boolean objectState;
051:
052:            /** This is the object link. */
053:            private Object objectLink;
054:
055:            /** 
056:             * This is the PropertyChangeSupport class used to support bound 
057:             * properties. 
058:             */
059:            private PropertyChangeSupport propertySupporter;
060:
061:            /** This is the list of properties for this object. */
062:            private HashMap<String, String> propertyList = new HashMap<String, String>();
063:
064:            /** This is a reference to the Virtual Machine. */
065:            private VirtualMachine virtualMachine;
066:
067:            /** 
068:             * This is the constructor for the JXObject class.  It creates a new 
069:             * instance of JXObject.
070:             *
071:             * @param vm points to an instance of the VirtualMachine class.
072:             * @param tag is the element type of this object.
073:             */
074:            public JXObject(VirtualMachine vm, String tag) {
075:                super ();
076:
077:                this .virtualMachine = vm;
078:                this .setObjectLink(null);
079:                this .setTAG(tag.toLowerCase());
080:                this .setLast(null);
081:                this .setState(true);
082:
083:                propertySupporter = new PropertyChangeSupport(this );
084:            }
085:
086:            /**
087:             * This method pushes a JXObject onto this object's stack and sets the
088:             * frame pointer to it.
089:             *
090:             * @param obj is the JXObject we want to add to the stack.
091:             */
092:            public void appendNode(JXObject obj) {
093:                this .Push(obj);
094:                obj.setLast(this );
095:            }
096:
097:            /**
098:             * This method checks if the object has children.
099:             *
100:             * @return true if the object has children, else false.
101:             */
102:            public boolean hasNodes() {
103:                if (this .getLength() > 0)
104:                    return true;
105:                else
106:                    return false;
107:            }
108:
109:            /**
110:             * This method returns the last child on this object's stack.
111:             *
112:             * @return the last child JXObject on this object's stack.
113:             */
114:            public JXObject getLast() {
115:                return this .objectLast;
116:            }
117:
118:            /**
119:             * This method gets this object's name.
120:             *
121:             * @return the name of the object.
122:             */
123:            public String getName() {
124:                return this .objectName;
125:            }
126:
127:            /**
128:             * This method returns the object link object.
129:             *
130:             * @return the object link object.
131:             */
132:            public Object getObjectLink() {
133:                return this .objectLink;
134:            }
135:
136:            /**
137:             * This method gets the value of a property.
138:             *
139:             * @param property is the name of the property.
140:             *
141:             * @return the value of the proprty.
142:             */
143:            public String getProperty(String property) {
144:                return this .propertyList.get(property);
145:            }
146:
147:            /**
148:             * This method gets the property list hash map.
149:             *
150:             * @return the property list hash map.
151:             */
152:            public HashMap<String, String> getPropertyList() {
153:                return this .propertyList;
154:            }
155:
156:            /**
157:             * This method gets this object's stack state (true/open,false/closed).
158:             *
159:             * @return the state of the object.
160:             */
161:            public boolean getState() {
162:                return this .objectState;
163:            }
164:
165:            /**
166:             * This method gets this object's TAG / Type.
167:             *
168:             * @return this object's tag.
169:             */
170:            public String getTAG() {
171:                return this .objectTAG;
172:            }
173:
174:            /**
175:             * This method sets this object's frame pointer to point to the given
176:             * object.
177:             *
178:             * @param last is the object we want to set the frame pointer to.
179:             */
180:            public void setLast(JXObject last) {
181:                this .objectLast = last;
182:            }
183:
184:            /**
185:             * This method sets this object's name.
186:             *
187:             * @param name is the name of the object.
188:             */
189:            public void setName(String name) {
190:                this .objectName = name;
191:            }
192:
193:            /**
194:             * This method sets the object link object.
195:             *
196:             * @param obj is the object we want to set the object link to.
197:             */
198:            public void setObjectLink(Object obj) {
199:                this .objectLink = obj;
200:            }
201:
202:            /**
203:             * This method sets the value of a property.
204:             *
205:             * @param property is the property we want to set.
206:             * @param newValue is the value we want to set.
207:             */
208:            public void setProperty(String property, String newValue) {
209:                String oldValue = this .propertyList.get(property);
210:
211:                this .propertyList.put(property, newValue);
212:
213:                this .propertySupporter.firePropertyChange(property, oldValue,
214:                        newValue);
215:            }
216:
217:            /**
218:             * This method sets the state of this object (true/open, false/closed).
219:             *
220:             * @param state is the state of this object.
221:             */
222:            public void setState(boolean state) {
223:                this .objectState = state;
224:            }
225:
226:            /**
227:             * This method sets this object's tag or type.
228:             *
229:             * @param tag is the tags we want to set.
230:             */
231:            public void setTAG(String tag) {
232:                this .objectTAG = tag;
233:            }
234:
235:            /**
236:             * This is a support method for the property change listener.
237:             *
238:             * @param listener is the listener we want to add.
239:             */
240:            public void addPropertyChangeListener(
241:                    PropertyChangeListener listener) {
242:                this .propertySupporter.addPropertyChangeListener(listener);
243:            }
244:
245:            /**
246:             * This is a support method for the property change listener.
247:             *
248:             * @param listener is the listener we want to remove.
249:             */
250:            public void removePropertyChangeListener(
251:                    PropertyChangeListener listener) {
252:                this.propertySupporter.removePropertyChangeListener(listener);
253:            }
254:
255:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.