Source Code Cross Referenced for DrawPath.java in  » JDK-Modules-sun » java2d » sun » java2d » loops » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. JDK Core
2. JDK Modules
3. JDK Modules com.sun
4. JDK Modules com.sun.java
5. JDK Modules Platform
6. JDK Modules sun
7. Open Source Build
8. Open Source Graphic Library
9. Open Source IDE Eclipse
10. Open Source J2EE
11. Open Source JDBC Driver
12. Open Source Library
13. Open Source Library Database
14. Open Source Net
15. Open Source Script
16. Science
17. Security
18. Sevlet Container
19. SUN GlassFish
20. Swing Library
21. Web Services apache cxf 2.0.1
22. Web Services AXIS2
23. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java Source Code / Java Documentation » JDK Modules sun » java2d » sun.java2d.loops 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
03:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04:         *
05:         * This code is free software; you can redistribute it and/or modify it
06:         * under the terms of the GNU General Public License version 2 only, as
07:         * published by the Free Software Foundation.  Sun designates this
08:         * particular file as subject to the "Classpath" exception as provided
09:         * by Sun in the LICENSE file that accompanied this code.
10:         *
11:         * This code is distributed in the hope that it will be useful, but WITHOUT
12:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14:         * version 2 for more details (a copy is included in the LICENSE file that
15:         * accompanied this code).
16:         *
17:         * You should have received a copy of the GNU General Public License version
18:         * 2 along with this work; if not, write to the Free Software Foundation,
19:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20:         *
21:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22:         * CA 95054 USA or visit www.sun.com if you need additional information or
23:         * have any questions.
24:         */
25:
26:        package sun.java2d.loops;
27:
28:        import sun.java2d.loops.GraphicsPrimitive;
29:        import sun.java2d.SunGraphics2D;
30:        import sun.java2d.SurfaceData;
31:        import java.awt.geom.Path2D;
32:
33:        /**
34:         *   DrawPath
35:         *   1. draw single-width line path onto destination surface
36:         *   2. must accept output area [x, y, dx, dy]
37:         *      from within the surface description data for clip rect
38:         */
39:        public class DrawPath extends GraphicsPrimitive {
40:
41:            public final static String methodSignature = "DrawPath(...)"
42:                    .toString();
43:
44:            public final static int primTypeID = makePrimTypeID();
45:
46:            public static DrawPath locate(SurfaceType srctype,
47:                    CompositeType comptype, SurfaceType dsttype) {
48:                return (DrawPath) GraphicsPrimitiveMgr.locate(primTypeID,
49:                        srctype, comptype, dsttype);
50:            }
51:
52:            protected DrawPath(SurfaceType srctype, CompositeType comptype,
53:                    SurfaceType dsttype) {
54:                super (methodSignature, primTypeID, srctype, comptype, dsttype);
55:            }
56:
57:            public DrawPath(long pNativePrim, SurfaceType srctype,
58:                    CompositeType comptype, SurfaceType dsttype) {
59:                super (pNativePrim, methodSignature, primTypeID, srctype,
60:                        comptype, dsttype);
61:            }
62:
63:            /**
64:             *   All DrawPath implementors must have this invoker method
65:             */
66:            public native void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
67:                    int transX, int transY, Path2D.Float p2df);
68:
69:            public GraphicsPrimitive makePrimitive(SurfaceType srctype,
70:                    CompositeType comptype, SurfaceType dsttype) {
71:                throw new InternalError("DrawPath not implemented for "
72:                        + srctype + " with " + comptype);
73:            }
74:
75:            public GraphicsPrimitive traceWrap() {
76:                return new TraceDrawPath(this );
77:            }
78:
79:            private static class TraceDrawPath extends DrawPath {
80:                DrawPath target;
81:
82:                public TraceDrawPath(DrawPath target) {
83:                    super (target.getSourceType(), target.getCompositeType(),
84:                            target.getDestType());
85:                    this .target = target;
86:                }
87:
88:                public GraphicsPrimitive traceWrap() {
89:                    return this ;
90:                }
91:
92:                public void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
93:                        int transX, int transY, Path2D.Float p2df) {
94:                    tracePrimitive(target);
95:                    target.DrawPath(sg2d, sData, transX, transY, p2df);
96:                }
97:            }
98:        }
w_w___w_.__j_a__va___2s__.__c__om_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.