Source Code Cross Referenced for XMLBasicPanel.java in  » Workflow-Engines » JaWE » org » enhydra » jawe » base » panel » panels » 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 » Workflow Engines » JaWE » org.enhydra.jawe.base.panel.panels 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.enhydra.jawe.base.panel.panels;
002:
003:        import java.awt.Component;
004:        import java.awt.Container;
005:        import java.awt.Window;
006:
007:        import javax.swing.BorderFactory;
008:        import javax.swing.BoxLayout;
009:        import javax.swing.JOptionPane;
010:        import javax.swing.border.Border;
011:        import javax.swing.border.EtchedBorder;
012:
013:        import org.enhydra.jawe.JaWEManager;
014:        import org.enhydra.jawe.ResourceManager;
015:        import org.enhydra.jawe.base.editor.XPDLElementEditor;
016:        import org.enhydra.jawe.base.panel.PanelContainer;
017:        import org.enhydra.shark.xpdl.XMLElement;
018:
019:        /**
020:         * Basic implementation of XMLPanel interface.
021:         * 
022:         *  @author Sasa Bojanic
023:         */
024:        public class XMLBasicPanel extends XMLPanel {
025:
026:            protected XMLElement myOwner;
027:            //   protected XMLElement myOwnerOrginal;
028:            protected String title;
029:
030:            protected XPDLElementEditor editor;
031:            protected PanelContainer pc;
032:
033:            public XMLBasicPanel() {
034:                super ();
035:            }
036:
037:            public XPDLElementEditor getEditor() {
038:                return editor;
039:            }
040:
041:            public XMLBasicPanel(PanelContainer pc, XMLElement myOwnerL,
042:                    String title, boolean isVertical, boolean hasBorder,
043:                    boolean hasEmptyBorder) {
044:
045:                super ();
046:                this .pc = pc;
047:                this .myOwner = myOwnerL;
048:
049:                setBorder(title, hasBorder, hasEmptyBorder);
050:
051:                setLayout(new BoxLayout(this , ((isVertical) ? BoxLayout.Y_AXIS
052:                        : BoxLayout.X_AXIS)));
053:                setAlignmentX(Component.LEFT_ALIGNMENT);
054:                setAlignmentY(Component.TOP_ALIGNMENT);
055:
056:                if (myOwner != null) {
057:                    setEnabled(JaWEManager.getInstance().getJaWEController()
058:                            .canModifyElement(myOwner));
059:                }
060:
061:            }
062:
063:            public void setBorder(String title, boolean hasBorder,
064:                    boolean hasEmptyBorder) {
065:                this .title = title;
066:
067:                //      int emptyBorderHSize=4;
068:                //      int emptyBorderVSize=4;
069:                //
070:                //      Border emptyb=BorderFactory.createEmptyBorder(emptyBorderVSize,emptyBorderHSize,
071:                //         emptyBorderVSize,emptyBorderHSize);
072:                //      Border inb=BorderFactory.createEmptyBorder(0,0,0,0);
073:                //      if (hasBorder) {
074:                //         inb=BorderFactory.createMatteBorder(1,1,1,1,Color.darkGray);
075:                //         inb=BorderFactory.createTitledBorder(inb,title);
076:                //      }
077:                //      else {
078:                //         emptyb=BorderFactory.createTitledBorder(emptyb,title);
079:                //      }
080:                //      setBorder(BorderFactory.createCompoundBorder(emptyb,inb));      
081:
082:                int emptyBT = 0;
083:                int emptyBL = 3;
084:                int emptyBB = 4;
085:                int emptyBR = 3;
086:                try {
087:                    emptyBT = pc.getSettings().getSettingInt("EmptyBorder.TOP");
088:                    emptyBL = pc.getSettings()
089:                            .getSettingInt("EmptyBorder.LEFT");
090:                    emptyBB = pc.getSettings().getSettingInt(
091:                            "EmptyBorder.BOTTOM");
092:                    emptyBR = pc.getSettings().getSettingInt(
093:                            "EmptyBorder.RIGHT");
094:                } catch (Exception e) {
095:                }
096:
097:                Border border = null;
098:                if (hasBorder) {
099:                    //BorderFactory.cre
100:                    border = BorderFactory
101:                            .createEtchedBorder(EtchedBorder.LOWERED);
102:                    //border=BorderFactory.createMatteBorder(1,0,0,0);
103:                    border = BorderFactory.createTitledBorder(border, title);
104:                    //border=BorderFactory.createCompoundBorder(etched,border);
105:                } else {
106:                    if (hasEmptyBorder) {
107:                        border = BorderFactory.createEmptyBorder(emptyBT,
108:                                emptyBL, emptyBB, emptyBR);
109:                    }
110:                }
111:                if (border != null) {
112:                    setBorder(border);
113:                }
114:
115:            }
116:
117:            public static void defaultErrorMessage(Window w, String elementTitle) {
118:                String message = ResourceManager
119:                        .getLanguageDependentString("ErrorValueMustBeDefined");
120:                String dialogTitle = ResourceManager
121:                        .getLanguageDependentString("DialogValueIsNotDefined");
122:                XMLBasicPanel.errorMessage(w, dialogTitle, elementTitle,
123:                        message);
124:            }
125:
126:            public static void errorMessage(Window w, String dialogTitle,
127:                    String elementTitle, String message) {
128:                JOptionPane.showMessageDialog(w, elementTitle + message,
129:                        dialogTitle, JOptionPane.ERROR_MESSAGE);
130:            }
131:
132:            public void setOwner(XMLElement owner) {
133:                this .myOwner = owner;
134:            }
135:
136:            public XMLElement getOwner() {
137:                return myOwner;
138:            }
139:
140:            //   public XMLElement getOrginalOwner () {
141:            //       return myOwnerOrginal;
142:            //    }
143:
144:            public String getTitle() {
145:                return title;
146:            }
147:
148:            /**
149:             * Checks if the element that owns panel
150:             */
151:            public boolean validateEntry() {
152:                return true;
153:            }
154:
155:            // Always returns true, this is set because of panels that are never empty
156:            // but this method is used when checking emptiness of group panel,
157:            // and panels that do not override this method should not be ever considered
158:            public boolean isEmpty() {
159:                return true;
160:            }
161:
162:            public void setElements() {
163:                return;
164:            }
165:
166:            public Object getValue() {
167:                return null;
168:            }
169:
170:            public void updateView() {
171:
172:            }
173:
174:            //public JComponent getMainComponent () {
175:            //   return this;
176:            //}
177:            /**
178:             * Find the hosting window.
179:             */
180:            public Window getWindow() {
181:                for (Container p = getParent(); p != null; p = p.getParent()) {
182:                    if (p instanceof  Window) {
183:                        return (Window) p;
184:                    }
185:                }
186:                return null;
187:            }
188:
189:            public void cleanup() {
190:            }
191:
192:            public PanelContainer getPanelContainer() {
193:                return this .pc;
194:            }
195:
196:            public void canceled() {
197:            }
198:
199:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.