887
|
1 |
/*
|
5506
|
2 |
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
|
887
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
5506
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
887
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
887
|
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 |
*
|
5506
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
887
|
24 |
*/
|
|
25 |
|
|
26 |
package sun.java2d.pipe;
|
|
27 |
|
|
28 |
import sun.java2d.SunGraphics2D;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* This interface defines the set of calls that pipeline objects
|
|
32 |
* can use to pass on responsibility for drawing arbitrary
|
|
33 |
* parallelogram shapes.
|
|
34 |
* Six floating point numbers are provided and the parallelogram
|
|
35 |
* is defined as the quadrilateral with the following vertices:
|
|
36 |
* <pre>
|
|
37 |
* origin: (x, y)
|
|
38 |
* => (x+dx1, y+dy1)
|
|
39 |
* => (x+dx1+dx2, y+dy1+dy2)
|
|
40 |
* => (x+dx2, y+dy2)
|
|
41 |
* => origin
|
|
42 |
* </pre>
|
|
43 |
*/
|
|
44 |
public interface ParallelogramPipe {
|
|
45 |
public void fillParallelogram(SunGraphics2D sg,
|
|
46 |
double x, double y,
|
|
47 |
double dx1, double dy1,
|
|
48 |
double dx2, double dy2);
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Draw a Parallelogram with the indicated line widths
|
|
52 |
* assuming a standard BasicStroke with MITER joins.
|
|
53 |
* lw1 specifies the width of the stroke along the dx1,dy1
|
|
54 |
* vector and lw2 specifies the width of the stroke along
|
|
55 |
* the dx2,dy2 vector.
|
|
56 |
* This is equivalent to outsetting the indicated
|
|
57 |
* parallelogram by lw/2 pixels, then insetting the
|
|
58 |
* same parallelogram by lw/2 pixels and filling the
|
|
59 |
* difference between the outer and inner parallelograms.
|
|
60 |
*/
|
|
61 |
public void drawParallelogram(SunGraphics2D sg,
|
|
62 |
double x, double y,
|
|
63 |
double dx1, double dy1,
|
|
64 |
double dx2, double dy2,
|
|
65 |
double lw1, double lw2);
|
|
66 |
}
|