KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > ext > awt > geom > Segment


1 /*
2
3    Copyright 2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.ext.awt.geom;
19
20 import java.awt.geom.Point2D JavaDoc;
21 import java.awt.geom.Rectangle2D JavaDoc;
22
23 /**
24  * An interface that path segments must implement.
25  *
26  * @version $Id: Segment.java,v 1.2 2005/03/27 08:58:32 cam Exp $
27  */

28 public interface Segment extends Cloneable JavaDoc {
29     public double minX();
30     public double maxX();
31     public double minY();
32     public double maxY();
33     public Rectangle2D JavaDoc getBounds2D();
34
35     public Point2D.Double JavaDoc evalDt(double t);
36     public Point2D.Double JavaDoc eval(double t);
37
38     public Segment getSegment(double t0, double t1);
39     public Segment splitBefore(double t);
40     public Segment splitAfter(double t);
41     public void subdivide(Segment s0, Segment s1);
42     public void subdivide(double t, Segment s0, Segment s1);
43     public double getLength();
44     public double getLength(double maxErr);
45
46     public SplitResults split(double y);
47
48     public static class SplitResults {
49         Segment [] above;
50         Segment [] below;
51         SplitResults(Segment []below, Segment []above) {
52             this.below = below;
53             this.above = above;
54         }
55
56         Segment [] getBelow() {
57             return below;
58         }
59         Segment [] getAbove() {
60             return above;
61         }
62     }
63 }
64
Popular Tags