Source Code Cross Referenced for DrawLine.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) 


001:        /*
002:         * Copyright 1997-2002 Sun Microsystems, Inc.  All Rights Reserved.
003:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004:         *
005:         * This code is free software; you can redistribute it and/or modify it
006:         * under the terms of the GNU General Public License version 2 only, as
007:         * published by the Free Software Foundation.  Sun designates this
008:         * particular file as subject to the "Classpath" exception as provided
009:         * by Sun in the LICENSE file that accompanied this code.
010:         *
011:         * This code is distributed in the hope that it will be useful, but WITHOUT
012:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014:         * version 2 for more details (a copy is included in the LICENSE file that
015:         * accompanied this code).
016:         *
017:         * You should have received a copy of the GNU General Public License version
018:         * 2 along with this work; if not, write to the Free Software Foundation,
019:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020:         *
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022:         * CA 95054 USA or visit www.sun.com if you need additional information or
023:         * have any questions.
024:         */
025:
026:        /*
027:         * @author Charlton Innovations, Inc.
028:         */
029:
030:        package sun.java2d.loops;
031:
032:        import sun.java2d.loops.GraphicsPrimitive;
033:        import java.awt.Color;
034:        import java.awt.image.ColorModel;
035:        import java.awt.image.Raster;
036:        import sun.java2d.SunGraphics2D;
037:        import sun.java2d.SurfaceData;
038:
039:        /**
040:         *   DrawLine
041:         *   1) draw solid color single width line onto destination surface
042:         *   2) must accept output area [x, y, dx, dy]
043:         *      from within the surface description data for clip rect
044:         */
045:        public class DrawLine extends GraphicsPrimitive {
046:            public final static String methodSignature = "DrawLine(...)"
047:                    .toString();
048:
049:            public final static int primTypeID = makePrimTypeID();
050:
051:            public static DrawLine locate(SurfaceType srctype,
052:                    CompositeType comptype, SurfaceType dsttype) {
053:                return (DrawLine) GraphicsPrimitiveMgr.locate(primTypeID,
054:                        srctype, comptype, dsttype);
055:            }
056:
057:            protected DrawLine(SurfaceType srctype, CompositeType comptype,
058:                    SurfaceType dsttype) {
059:                super (methodSignature, primTypeID, srctype, comptype, dsttype);
060:            }
061:
062:            public DrawLine(long pNativePrim, SurfaceType srctype,
063:                    CompositeType comptype, SurfaceType dsttype) {
064:                super (pNativePrim, methodSignature, primTypeID, srctype,
065:                        comptype, dsttype);
066:            }
067:
068:            /**
069:             *   All DrawLine implementors must have this invoker method
070:             */
071:            public native void DrawLine(SunGraphics2D sg2d, SurfaceData dest,
072:                    int x1, int y1, int x2, int y2);
073:
074:            public GraphicsPrimitive makePrimitive(SurfaceType srctype,
075:                    CompositeType comptype, SurfaceType dsttype) {
076:                // REMIND: use FillSpans or converter object?
077:                throw new InternalError("DrawLine not implemented for "
078:                        + srctype + " with " + comptype);
079:            }
080:
081:            public GraphicsPrimitive traceWrap() {
082:                return new TraceDrawLine(this );
083:            }
084:
085:            private static class TraceDrawLine extends DrawLine {
086:                DrawLine target;
087:
088:                public TraceDrawLine(DrawLine target) {
089:                    super (target.getSourceType(), target.getCompositeType(),
090:                            target.getDestType());
091:                    this .target = target;
092:                }
093:
094:                public GraphicsPrimitive traceWrap() {
095:                    return this ;
096:                }
097:
098:                public void DrawLine(SunGraphics2D sg2d, SurfaceData dest,
099:                        int x1, int y1, int x2, int y2) {
100:                    tracePrimitive(target);
101:                    target.DrawLine(sg2d, dest, x1, y1, x2, y2);
102:                }
103:            }
104:        }
w__w__w__._j__a_va___2_s.__c_o__m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.