Source Code Cross Referenced for TextGraphics2D.java in  » IDE-Netbeans » web.core » org » netbeans » test » jsf » el » 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 » IDE Netbeans » web.core » org.netbeans.test.jsf.el 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:
042:        package org.netbeans.test.jsf.el;
043:
044:        import java.awt.Color;
045:        import java.awt.Component;
046:        import java.awt.Composite;
047:        import java.awt.Font;
048:        import java.awt.FontMetrics;
049:        import java.awt.Graphics;
050:        import java.awt.Graphics2D;
051:        import java.awt.GraphicsConfiguration;
052:        import java.awt.Image;
053:        import java.awt.Paint;
054:        import java.awt.Rectangle;
055:        import java.awt.RenderingHints;
056:        import java.awt.Shape;
057:        import java.awt.Stroke;
058:        import java.awt.font.FontRenderContext;
059:        import java.awt.font.GlyphVector;
060:        import java.awt.geom.AffineTransform;
061:        import java.awt.image.BufferedImage;
062:        import java.awt.image.BufferedImageOp;
063:        import java.awt.image.ImageObserver;
064:        import java.awt.image.RenderedImage;
065:        import java.awt.image.renderable.RenderableImage;
066:        import java.text.AttributedCharacterIterator;
067:        import java.util.Map;
068:
069:        /** Renders all drawString(...) into StringBuffer.
070:         *
071:         * @author Martin.Schovanek@sun.com
072:         */
073:        public class TextGraphics2D extends Graphics2D {
074:            StringBuffer buf = new StringBuffer();
075:            Component dummy;
076:            Font font;
077:
078:            /**
079:             * Creates a new instance of TextGraphics2D
080:             */
081:            public TextGraphics2D(Component component) {
082:                dummy = component;
083:            }
084:
085:            public TextGraphics2D() {
086:                this (null);
087:            }
088:
089:            public String getText() {
090:                return buf.toString();
091:            }
092:
093:            public String getTextUni() {
094:                String str;
095:                int start;
096:                StringBuffer buf = new StringBuffer().append(this .buf);
097:                while ((start = buf.indexOf("  ")) > -1) {
098:                    buf.deleteCharAt(start);
099:                }
100:                str = buf.toString();
101:                // remove '...' ussually rendered when the left epression is too long 
102:                str = str.replaceAll("[.]{3} ?", "");
103:                return str;
104:            }
105:
106:            public void clearRect(int param, int param1, int param2, int param3) {
107:            }
108:
109:            public void clipRect(int param, int param1, int param2, int param3) {
110:            }
111:
112:            public void copyArea(int param, int param1, int param2, int param3,
113:                    int param4, int param5) {
114:            }
115:
116:            public Graphics create() {
117:                return new TextGraphics2D(dummy);
118:            }
119:
120:            public void dispose() {
121:            }
122:
123:            public void drawArc(int param, int param1, int param2, int param3,
124:                    int param4, int param5) {
125:            }
126:
127:            public boolean drawImage(Image image, int param, int param2,
128:                    ImageObserver imageObserver) {
129:                return true;
130:            }
131:
132:            public boolean drawImage(Image image, int param, int param2,
133:                    Color color, ImageObserver imageObserver) {
134:                return true;
135:            }
136:
137:            public boolean drawImage(Image image, int param, int param2,
138:                    int param3, int param4, ImageObserver imageObserver) {
139:                return true;
140:            }
141:
142:            public boolean drawImage(Image image, int param, int param2,
143:                    int param3, int param4, Color color,
144:                    ImageObserver imageObserver) {
145:                return true;
146:            }
147:
148:            public boolean drawImage(Image image, int param, int param2,
149:                    int param3, int param4, int param5, int param6, int param7,
150:                    int param8, ImageObserver imageObserver) {
151:                return true;
152:            }
153:
154:            public boolean drawImage(Image image, int param, int param2,
155:                    int param3, int param4, int param5, int param6, int param7,
156:                    int param8, Color color, ImageObserver imageObserver) {
157:                return true;
158:            }
159:
160:            public void drawLine(int param, int param1, int param2, int param3) {
161:            }
162:
163:            public void drawOval(int param, int param1, int param2, int param3) {
164:            }
165:
166:            public void drawPolygon(int[] values, int[] values1, int param) {
167:            }
168:
169:            public void drawPolyline(int[] values, int[] values1, int param) {
170:            }
171:
172:            public void drawRoundRect(int param, int param1, int param2,
173:                    int param3, int param4, int param5) {
174:            }
175:
176:            public void drawString(String str, int x, int y) {
177:                drawString(str, (float) x, (float) y);
178:            }
179:
180:            public void drawString(AttributedCharacterIterator iterator, int x,
181:                    int y) {
182:                drawString(iterator, (float) x, (float) y);
183:            }
184:
185:            public void fillArc(int param, int param1, int param2, int param3,
186:                    int param4, int param5) {
187:            }
188:
189:            public void fillOval(int param, int param1, int param2, int param3) {
190:            }
191:
192:            public void fillPolygon(int[] values, int[] values1, int param) {
193:            }
194:
195:            public void fillRect(int param, int param1, int param2, int param3) {
196:            }
197:
198:            public void fillRoundRect(int param, int param1, int param2,
199:                    int param3, int param4, int param5) {
200:            }
201:
202:            public Shape getClip() {
203:                return null;
204:            }
205:
206:            public Rectangle getClipBounds() {
207:                return null;
208:            }
209:
210:            public Color getColor() {
211:                return null;
212:            }
213:
214:            public Font getFont() {
215:                if (font != null)
216:                    return font;
217:                if (dummy == null)
218:                    return null;
219:                return dummy.getFont();
220:            }
221:
222:            public FontMetrics getFontMetrics(Font font) {
223:                if (dummy == null)
224:                    return null;
225:                return dummy.getFontMetrics(dummy.getFont());
226:            }
227:
228:            public void setClip(Shape shape) {
229:            }
230:
231:            public void setClip(int param, int param1, int param2, int param3) {
232:            }
233:
234:            public void setColor(Color color) {
235:            }
236:
237:            public void setFont(Font font) {
238:                this .font = font;
239:            }
240:
241:            public void setPaintMode() {
242:            }
243:
244:            public void setXORMode(Color color) {
245:            }
246:
247:            public void translate(int param, int param1) {
248:            }
249:
250:            public void addRenderingHints(Map map) {
251:            }
252:
253:            public void clip(Shape shape) {
254:            }
255:
256:            public void draw(Shape shape) {
257:            }
258:
259:            public void drawGlyphVector(GlyphVector glyphVector, float param,
260:                    float param2) {
261:            }
262:
263:            public boolean drawImage(Image image,
264:                    AffineTransform affineTransform, ImageObserver imageObserver) {
265:                return true;
266:            }
267:
268:            public void drawImage(BufferedImage bufferedImage,
269:                    BufferedImageOp bufferedImageOp, int param, int param3) {
270:            }
271:
272:            public void drawRenderableImage(RenderableImage renderableImage,
273:                    AffineTransform affineTransform) {
274:            }
275:
276:            public void drawRenderedImage(RenderedImage renderedImage,
277:                    AffineTransform affineTransform) {
278:            }
279:
280:            public void drawString(String str, float x, float y) {
281:                if (buf.length() > 0 && buf.charAt(buf.length() - 1) != ' ') {
282:                    buf.append(' ');
283:                }
284:                buf.append(str);
285:            }
286:
287:            public void drawString(AttributedCharacterIterator iterator,
288:                    float x, float y) {
289:                if (buf.length() > 0 && buf.charAt(buf.length() - 1) != ' ') {
290:                    buf.append(' ');
291:                }
292:                for (char c = iterator.first(); c != iterator.DONE; c = iterator
293:                        .next()) {
294:                    buf.append(c);
295:                }
296:            }
297:
298:            public void fill(Shape shape) {
299:            }
300:
301:            public Color getBackground() {
302:                if (dummy == null)
303:                    return null;
304:                return dummy.getBackground();
305:            }
306:
307:            public Composite getComposite() {
308:                return null;
309:            }
310:
311:            public GraphicsConfiguration getDeviceConfiguration() {
312:                return null;
313:            }
314:
315:            public FontRenderContext getFontRenderContext() {
316:                if (dummy == null)
317:                    return null;
318:                return ((Graphics2D) dummy.getGraphics())
319:                        .getFontRenderContext();
320:            }
321:
322:            public Paint getPaint() {
323:                return null;
324:            }
325:
326:            public Object getRenderingHint(RenderingHints.Key key) {
327:                return null;
328:            }
329:
330:            public RenderingHints getRenderingHints() {
331:                return null;
332:            }
333:
334:            public Stroke getStroke() {
335:                return null;
336:            }
337:
338:            public AffineTransform getTransform() {
339:                return null;
340:            }
341:
342:            public boolean hit(Rectangle rectangle, Shape shape, boolean param) {
343:                return true;
344:            }
345:
346:            public void rotate(double param) {
347:            }
348:
349:            public void rotate(double param, double param1, double param2) {
350:            }
351:
352:            public void scale(double param, double param1) {
353:            }
354:
355:            public void setBackground(Color color) {
356:            }
357:
358:            public void setComposite(Composite composite) {
359:            }
360:
361:            public void setPaint(Paint paint) {
362:            }
363:
364:            public void setRenderingHint(RenderingHints.Key key, Object obj) {
365:            }
366:
367:            public void setRenderingHints(Map map) {
368:            }
369:
370:            public void setStroke(Stroke stroke) {
371:            }
372:
373:            public void setTransform(AffineTransform affineTransform) {
374:            }
375:
376:            public void shear(double param, double param1) {
377:            }
378:
379:            public void transform(AffineTransform affineTransform) {
380:            }
381:
382:            public void translate(double param, double param1) {
383:            }
384:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.