430N/A/*
4190N/A * Copyright (c) 2008, 2011 Oracle and/or its affiliates. All rights reserved.
430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
430N/A *
430N/A * This code is free software; you can redistribute it and/or modify it
430N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
430N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
430N/A *
430N/A * This code is distributed in the hope that it will be useful, but WITHOUT
430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
430N/A * version 2 for more details (a copy is included in the LICENSE file that
430N/A * accompanied this code).
430N/A *
430N/A * You should have received a copy of the GNU General Public License version
430N/A * 2 along with this work; if not, write to the Free Software Foundation,
430N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
430N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
430N/A */
430N/A
430N/Apackage sun.java2d.pipe;
430N/A
430N/Aimport sun.java2d.SunGraphics2D;
430N/A
430N/A/**
430N/A * This interface defines the set of calls that pipeline objects
430N/A * can use to pass on responsibility for drawing arbitrary
430N/A * parallelogram shapes.
430N/A * Six floating point numbers are provided and the parallelogram
430N/A * is defined as the quadrilateral with the following vertices:
430N/A * <pre>
430N/A * origin: (x, y)
430N/A * => (x+dx1, y+dy1)
430N/A * => (x+dx1+dx2, y+dy1+dy2)
430N/A * => (x+dx2, y+dy2)
430N/A * => origin
430N/A * </pre>
4190N/A * The four u[xy][12] parameters are the unsorted extreme coordinates
4190N/A * of the primitive in user space. They may have been generated by a
4190N/A * line or a rectangle so they could have u[xy]2 < u[xy]1 in some cases.
4190N/A * They should be sorted before calculating the bounds of the original
4190N/A * primitive (such as for calculating the user space bounds for the
4190N/A * Paint.createContext() method).
430N/A */
430N/Apublic interface ParallelogramPipe {
430N/A public void fillParallelogram(SunGraphics2D sg,
4190N/A double ux1, double uy1,
4190N/A double ux2, double uy2,
430N/A double x, double y,
430N/A double dx1, double dy1,
430N/A double dx2, double dy2);
430N/A
430N/A /**
430N/A * Draw a Parallelogram with the indicated line widths
430N/A * assuming a standard BasicStroke with MITER joins.
430N/A * lw1 specifies the width of the stroke along the dx1,dy1
430N/A * vector and lw2 specifies the width of the stroke along
430N/A * the dx2,dy2 vector.
430N/A * This is equivalent to outsetting the indicated
430N/A * parallelogram by lw/2 pixels, then insetting the
430N/A * same parallelogram by lw/2 pixels and filling the
430N/A * difference between the outer and inner parallelograms.
430N/A */
430N/A public void drawParallelogram(SunGraphics2D sg,
4190N/A double ux1, double uy1,
4190N/A double ux2, double uy2,
430N/A double x, double y,
430N/A double dx1, double dy1,
430N/A double dx2, double dy2,
430N/A double lw1, double lw2);
430N/A}