Path: blob/master/src/java.desktop/share/classes/sun/java2d/pipe/ParallelogramPipe.java
41159 views
/*1* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.java2d.pipe;2627import sun.java2d.SunGraphics2D;2829/**30* This interface defines the set of calls that pipeline objects31* can use to pass on responsibility for drawing arbitrary32* parallelogram shapes.33* Six floating point numbers are provided and the parallelogram34* is defined as the quadrilateral with the following vertices:35* <pre>36* origin: (x, y)37* => (x+dx1, y+dy1)38* => (x+dx1+dx2, y+dy1+dy2)39* => (x+dx2, y+dy2)40* => origin41* </pre>42* The four u[xy][12] parameters are the unsorted extreme coordinates43* of the primitive in user space. They may have been generated by a44* line or a rectangle so they could have u[xy]2 < u[xy]1 in some cases.45* They should be sorted before calculating the bounds of the original46* primitive (such as for calculating the user space bounds for the47* Paint.createContext() method).48*/49public interface ParallelogramPipe {50public void fillParallelogram(SunGraphics2D sg,51double ux1, double uy1,52double ux2, double uy2,53double x, double y,54double dx1, double dy1,55double dx2, double dy2);5657/**58* Draw a Parallelogram with the indicated line widths59* assuming a standard BasicStroke with MITER joins.60* lw1 specifies the width of the stroke along the dx1,dy161* vector and lw2 specifies the width of the stroke along62* the dx2,dy2 vector.63* This is equivalent to outsetting the indicated64* parallelogram by lw/2 pixels, then insetting the65* same parallelogram by lw/2 pixels and filling the66* difference between the outer and inner parallelograms.67*/68public void drawParallelogram(SunGraphics2D sg,69double ux1, double uy1,70double ux2, double uy2,71double x, double y,72double dx1, double dy1,73double dx2, double dy2,74double lw1, double lw2);75}767778