Source Code Cross Referenced for HtmlInlineFrame.java in  » J2EE » Sofia » com » salmonllc » html » 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 » Sofia » com.salmonllc.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //** Copyright Statement ***************************************************
002:        //The Salmon Open Framework for Internet Applications (SOFIA)
003:        // Copyright (C) 1999 - 2002, Salmon LLC
004:        //
005:        // This program is free software; you can redistribute it and/or
006:        // modify it under the terms of the GNU General Public License version 2
007:        // as published by the Free Software Foundation;
008:        // 
009:        // This program 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
012:        // GNU General Public License for more details.
013:        // 
014:        // You should have received a copy of the GNU General Public License
015:        // along with this program; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:        // 
018:        // For more information please visit http://www.salmonllc.com
019:        //** End Copyright Statement ***************************************************
020:        package com.salmonllc.html;
021:
022:        /////////////////////////
023:        //$Archive: /SOFIA/SourceCode/com/salmonllc/html/HtmlInlineFrame.java $
024:        //$Author: Dan $
025:        //$Revision: 14 $
026:        //$Modtime: 12/19/03 11:33a $
027:        /////////////////////////
028:
029:        import java.io.PrintWriter;
030:        import java.util.Hashtable;
031:        import java.util.Vector;
032:
033:        /**
034:         * This class will generate the html an InLine Frame.
035:         */
036:        public class HtmlInlineFrame extends HtmlContainer {
037:            public static final int SIZE_PERCENT = 0;
038:            public static final int SIZE_PIXELS = 1;
039:
040:            int _width = -1;
041:            int _height = -1;
042:            int _border = 0;
043:            int _heightSizeOption = SIZE_PIXELS;
044:            int _widthSizeOption = SIZE_PIXELS;
045:
046:            String _src = "";
047:
048:            /**
049:             *Constructs a new InLine Frame
050:             * @param name java.lang.String
051:             * @param p com.salmonllc.html.HtmlPage
052:             */
053:            public HtmlInlineFrame(String name, com.salmonllc.html.HtmlPage p) {
054:                super (name, p);
055:            }
056:
057:            /**
058:             * This method should not be used. Use setFrameComponent instead.
059:             */
060:            public void add(HtmlComponent comp) {
061:                return;
062:            }
063:
064:            public void generateHTML(PrintWriter p, int rowNo) throws Exception {
065:                generateHTML(p, -999, rowNo);
066:            }
067:
068:            public void generateHTML(PrintWriter p, int rowStart, int rowEnd)
069:                    throws Exception {
070:                if (_componentsVec == null)
071:                    return;
072:                if (!_visible)
073:                    return;
074:                if (_center)
075:                    p.print("<CENTER>");
076:                if (getPage().getUseIFrames()) {
077:                    String name = getPage().getClass().getName();
078:                    int pos = name.lastIndexOf(".");
079:                    if (pos > -1)
080:                        name = name.substring(pos + 1);
081:                    name += "-" + getName() + "FrameComponent";
082:                    if (_src != null && !_src.equals(""))
083:                        name = _src;
084:                    p.print("<IFRAME NAME=\"" + getFullName()
085:                            + "\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\" SRC=\""
086:                            + name + "\"");
087:                    p.print(" FRAMEBORDER=\"" + _border + "\"");
088:                    String heading = "";
089:                    if (_width > -1) {
090:                        heading += " WIDTH=\"" + _width;
091:                        if (_widthSizeOption == SIZE_PERCENT)
092:                            heading += "%";
093:                        heading += "\"";
094:                    }
095:                    if (_height > -1) {
096:                        heading += " HEIGHT=\"" + _height;
097:                        if (_heightSizeOption == SIZE_PERCENT)
098:                            heading += "%";
099:                        heading += "\"";
100:                    }
101:                    p.print(heading);
102:                    p.println("></IFRAME>");
103:                } else {
104:                    HtmlComponent h = null;
105:                    int componentsSize = _componentsVec.size();
106:                    for (int i = 0; i < componentsSize; i++) {
107:                        h = (HtmlComponent) _componentsVec.elementAt(i);
108:                        if (h != null) {
109:                            if (rowStart == -999)
110:                                h.generateHTML(p, rowEnd);
111:                            else
112:                                h.generateHTML(p, rowStart, rowEnd);
113:                        }
114:                    }
115:                }
116:                if (_center)
117:                    p.print("</CENTER>");
118:            }
119:
120:            public void generateInitialHTML(PrintWriter p) throws Exception {
121:                if (!_visible || _componentsVec == null)
122:                    return;
123:                if (!getPage().getUseIFrames()) {
124:                    HtmlComponent h = null;
125:                    int componentsSize = _componentsVec.size();
126:                    for (int i = 0; i < componentsSize; i++) {
127:                        h = (HtmlComponent) _componentsVec.elementAt(i);
128:                        if (h != null)
129:                            h.generateInitialHTML(p);
130:                    }
131:                }
132:            }
133:
134:            /**
135:             * Gets the border thickness for the frame.
136:             */
137:            public int getBorder() {
138:                return _border;
139:            }
140:
141:            /**
142:             * This method returns the component in the Inline Frame.
143:             */
144:            public HtmlComponent getFrameComponent() {
145:                if (_componentsVec == null)
146:                    return null;
147:                else {
148:                    if (_componentsVec.size() == 0)
149:                        return null;
150:
151:                    Object o = _componentsVec.elementAt(0);
152:                    if (o == null)
153:                        return null;
154:                    else
155:                        return (HtmlComponent) o;
156:
157:                }
158:
159:            }
160:
161:            /**
162:             * This method gets the minimum height of the frame.
163:             */
164:            public int getHeight() {
165:                return _height;
166:            }
167:
168:            /**
169:             * This method returns the size option for the height of the iframe. Valid return values are SIZE_PIXELS or SIZE_PERCENT.
170:             */
171:            public int getHeightSizeOption() {
172:                return _heightSizeOption;
173:            }
174:
175:            /**
176:             * This method returns the width of the frame.
177:             */
178:            public int getWidth() {
179:                return _width;
180:            }
181:
182:            /**
183:             * This method returns the size option for the width of the iframe. Valid return values are SIZE_PIXELS or SIZE_PERCENT.
184:             */
185:            public int getWidthSizeOption() {
186:                return _widthSizeOption;
187:            }
188:
189:            public boolean processParms(Hashtable parms, int rowNo)
190:                    throws Exception {
191:
192:                if (getPage().getUseIFrames()
193:                        && getPage().getSubPageName() != getFullName())
194:                    return false;
195:
196:                return super .processParms(parms, rowNo);
197:            }
198:
199:            /**
200:             * Sets the border width for the table.
201:             */
202:            public void setBorder(int border) {
203:                _border = border;
204:            }
205:
206:            /**
207:             * This method sets the component that will appear within the frame.
208:             */
209:            public void setFrameComponent(HtmlComponent comp) {
210:                if (_componentsVec == null) {
211:                    _componentsVec = new Vector();
212:                } else {
213:                    _componentsVec.removeAllElements();
214:                }
215:
216:                getPage().registerSubPage(getName() + "FrameComponent", comp);
217:                _componentsVec.addElement(comp);
218:                comp.setParent(this );
219:            }
220:
221:            /**
222:             * This method sets the minimum height of the frame.
223:             */
224:            public void setHeight(int height) {
225:                _height = height;
226:            }
227:
228:            /**
229:             * This method sets the size option for the height of the iframe. Valid values are SIZE_PIXELS or SIZE_PERCENT.
230:             */
231:            public void setHeightSizeOption(int option) {
232:                _heightSizeOption = option;
233:            }
234:
235:            /**
236:             * This method sets the width of the frame in either pixels or percent depending on size option.
237:             */
238:            public void setWidth(int width) {
239:                _width = width;
240:            }
241:
242:            /**
243:             * This method sets the size option for the width of the iframe. Valid values are SIZE_PIXELS or SIZE_PERCENT.
244:             */
245:            public void setWidthSizeOption(int option) {
246:                _widthSizeOption = option;
247:            }
248:
249:            /**
250:             * @returns the source of the content of the inline frame
251:             */
252:            public String getSrc() {
253:                return _src;
254:            }
255:
256:            /**
257:             * Sets the source URL for the inline frame
258:             */
259:            public void setSrc(String string) {
260:                _src = string;
261:            }
262:
263:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.