Source Code Cross Referenced for HtmlSpinnerRenderer.java in  » J2EE » WiSerFramework » de » ug2t » channel » markup » html » renderer » 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 » J2EE » WiSerFramework » de.ug2t.channel.markup.html.renderer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // @@
002:        // @@
003:        /*
004:         * Wi.Ser Framework
005:         *
006:         * Version: 1.8.1, 20-September-2007  
007:         * Copyright (C) 2005 Dirk von der Weiden <dvdw@imail.de>
008:         *
009:         * This library is free software; you can redistribute it and/or
010:         * modify it under the terms of the GNU Lesser General Public
011:         * License as published by the Free Software Foundation; either
012:         * version 2 of the License, or (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
017:         * Lesser General Public License for more details.
018:         *
019:         * You should have received a copy of the GNU Lesser General Public
020:         * License along with this library located in LGPL.txt in the 
021:         * license directory; if not, write to the 
022:         * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023:         * Boston, MA  02111-1307, USA.
024:         * 
025:         * If this agreement does not cover your requirements, please contact us
026:         * via email to get detailed information about the commercial license 
027:         * or our service offerings!
028:         *
029:         */
030:        // @@
031:        package de.ug2t.channel.markup.html.renderer;
032:
033:        import java.awt.*;
034:
035:        import de.ug2t.channel.markup.generic.*;
036:        import de.ug2t.kernel.*;
037:        import de.ug2t.unifiedGui.*;
038:        import de.ug2t.unifiedGui.interfaces.*;
039:        import de.ug2t.unifiedGui.views.*;
040:
041:        public class HtmlSpinnerRenderer extends AMuGenericComponentRenderer {
042:            private KeStringTemplate pcmf_insertFont(UnFontDescriptor xFont,
043:                    IUnComponent xComp) {
044:                KeStringTemplate l_ret = null;
045:                UnFontDescriptor l_font = xFont;
046:
047:                MuGenericApplication l_appl = (MuGenericApplication) xComp
048:                        .pcmf_getAppl();
049:                if (l_font == null)
050:                    l_font = l_appl.pcmf_getFont();
051:
052:                if (l_font != null) {
053:                    l_ret = l_appl.pcmf_getTemplateKit().getFONT();
054:
055:                    KeTools.pcmf_stringSubst(l_ret, "$FNAME", l_font
056:                            .pcmf_getFontName());
057:                    KeTools.pcmf_stringSubst(l_ret, "$FSIZE", Integer
058:                            .toString(l_font.pcmf_getFontSize()));
059:
060:                    switch (l_font.pcmf_getFontStyle()) {
061:                    case Font.ITALIC:
062:                        KeTools.pcmf_stringSubst(l_ret, "$FSTYLE", "italic");
063:                        KeTools.pcmf_stringSubst(l_ret, "$BOLD", "normal");
064:                        break;
065:                    case Font.BOLD:
066:                        KeTools.pcmf_stringSubst(l_ret, "$BOLD", "bold");
067:                        KeTools.pcmf_stringSubst(l_ret, "$FSTYLE", "normal");
068:                        break;
069:                    default:
070:                        KeTools.pcmf_stringSubst(l_ret, "$BOLD", "normal");
071:                        KeTools.pcmf_stringSubst(l_ret, "$FSTYLE", "normal");
072:                    }
073:                }
074:                return l_ret;
075:            }
076:
077:            public String pcmf_render(MuGenericComponent xWidget) {
078:                KeStringTemplate l_main = null;
079:
080:                MuGenericSpinner l_spinner = (MuGenericSpinner) xWidget;
081:
082:                l_main = l_spinner.pcmf_getMarkupString("MAIN");
083:
084:                l_main = l_spinner.pcmf_insertToolTip(l_main);
085:                l_main = l_spinner.pcmf_insertColorandFontandBorder(l_main);
086:                l_main = l_spinner.pcmf_insertPosition(l_main);
087:                l_main = l_spinner.pcmf_insertChannelandMenu(l_main);
088:
089:                l_main.pcmf_beginTR();
090:
091:                int l_talign = l_spinner.pcmf_getTextAlign();
092:                if (l_talign == IUnInputField.TEXT_ALIGN_EAST)
093:                    KeTools.pcmf_stringSubst(l_main, "$TALIGN", "right");
094:                else if (l_talign == IUnInputField.TEXT_ALIGN_CENTER)
095:                    KeTools.pcmf_stringSubst(l_main, "$TALIGN", "center");
096:                else
097:                    KeTools.pcmf_stringSubst(l_main, "$TALIGN", "left");
098:
099:                l_main = KeTools.pcmf_stringSubst(l_main, "$OID", l_spinner
100:                        .pcmf_getObjName());
101:                l_main = KeTools.pcmf_stringSubst(l_main, "$UP", l_spinner
102:                        .pcmf_getUpKey().pcmf_execView().toString());
103:                l_main = KeTools.pcmf_stringSubst(l_main, "$DOWN", l_spinner
104:                        .pcmf_getDownKey().pcmf_execView().toString());
105:
106:                Object l_selection = l_spinner.pcmf_getValues().get(
107:                        l_spinner.pcmf_getValue());
108:                if (l_selection != null) {
109:                    if (l_selection instanceof  String)
110:                        l_selection = KeTools.pcmf_deRefObj(l_selection
111:                                .toString());
112:
113:                    if (l_selection instanceof  MuGenericComponent) {
114:                        l_selection = ((MuGenericComponent) l_selection)
115:                                .pcmf_execView();
116:                        KeTools.pcmf_stringSubst(l_main, "$SEL_VAL",
117:                                l_selection.toString());
118:                        KeTools.pcmf_stringSubst(l_main, "$STRING", l_selection
119:                                .toString());
120:                        KeTools.pcmf_stringSubst(l_main, "$CFGCOL", l_spinner
121:                                .pcmf_getFgColor());
122:                        KeTools.pcmf_stringSubst(l_main, "$CBGCOL", l_spinner
123:                                .pcmf_getBgColor());
124:                    } else if (l_selection instanceof  IKeViewable) {
125:                        IKeView l_view = ((IKeViewable) l_selection)
126:                                .pcmf_getView();
127:
128:                        if (l_view instanceof  UnIconValueView) {
129:                            UnIconValueView l_iv = (UnIconValueView) l_view;
130:
131:                            if (l_iv.pcmf_getFg() != null)
132:                                KeTools.pcmf_stringSubst(l_main, "$CFGCOL",
133:                                        l_iv.pcmf_getFg());
134:                            else
135:                                KeTools.pcmf_stringSubst(l_main, "$CFGCOL",
136:                                        l_spinner.pcmf_getFgColor());
137:
138:                            if (l_iv.pcmf_getBg() != null)
139:                                KeTools.pcmf_stringSubst(l_main, "$CBGCOL",
140:                                        l_iv.pcmf_getBg());
141:                            else
142:                                KeTools.pcmf_stringSubst(l_main, "$CBGCOL",
143:                                        l_spinner.pcmf_getBgColor());
144:
145:                            KeStringTemplate l_fstring = this .pcmf_insertFont(
146:                                    l_iv.pcmf_getFontDesc(), l_spinner);
147:                            if (l_fstring != null)
148:                                KeTools.pcmf_stringSubst(l_main, "$ITEM_FONT",
149:                                        l_fstring.toString());
150:
151:                            if (l_iv.pcmf_getStdIcon() != null) {
152:                                l_selection = l_iv.pcmf_getStdIcon()
153:                                        .pcmf_getUnComponent().pcmf_execView()
154:                                        + l_selection.toString();
155:                                KeTools.pcmf_stringSubst(l_main, "$SEL_VAL",
156:                                        l_selection.toString());
157:                            } else
158:                                KeTools.pcmf_stringSubst(l_main, "$SEL_VAL",
159:                                        l_selection.toString());
160:                        } else {
161:                            KeTools.pcmf_stringSubst(l_main, "$SEL_VAL",
162:                                    l_selection.toString());
163:                            KeTools.pcmf_stringSubst(l_main, "$CFGCOL",
164:                                    l_spinner.pcmf_getFgColor());
165:                            KeTools.pcmf_stringSubst(l_main, "$CBGCOL",
166:                                    l_spinner.pcmf_getBgColor());
167:                            KeTools.pcmf_stringSubst(l_main, "$ITEM_FONT", "");
168:                        }
169:                    } else {
170:                        KeTools.pcmf_stringSubst(l_main, "$SEL_VAL",
171:                                l_selection.toString());
172:                        KeTools.pcmf_stringSubst(l_main, "$CFGCOL", l_spinner
173:                                .pcmf_getFgColor());
174:                        KeTools.pcmf_stringSubst(l_main, "$CBGCOL", l_spinner
175:                                .pcmf_getBgColor());
176:                        KeTools.pcmf_stringSubst(l_main, "$ITEM_FONT", "");
177:                    }
178:                } else {
179:                    l_main = KeTools.pcmf_stringSubst(l_main, "$SEL_VAL", "");
180:                    KeTools.pcmf_stringSubst(l_main, "$CFGCOL", l_spinner
181:                            .pcmf_getFgColor());
182:                    KeTools.pcmf_stringSubst(l_main, "$CBGCOL", l_spinner
183:                            .pcmf_getBgColor());
184:                }
185:
186:                l_main.pcmf_endTR(true);
187:
188:                return (l_main.toString());
189:            }
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.