Update ooo320-m1
[ooovba.git] / canvas / source / java / BezierPolyPolygon.java
blob288201e7db0e9045e96f82e63ecd8a23198d4f5d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BezierPolyPolygon.java,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // Canvas
32 import com.sun.star.rendering.*;
33 import com.sun.star.geometry.*;
35 public class BezierPolyPolygon
36 extends com.sun.star.lib.uno.helper.ComponentBase
37 implements com.sun.star.lang.XServiceInfo,
38 com.sun.star.rendering.XBezierPolyPolygon2D
40 private java.awt.geom.GeneralPath path;
42 //----------------------------------------------------------------------------------
44 public BezierPolyPolygon( RealBezierSegment2D[][] points )
46 setBezierSegments( points, 0 );
49 public java.awt.geom.GeneralPath getJavaPath()
51 return path;
54 //----------------------------------------------------------------------------------
57 // XPolyPolygon implementation
58 // ===========================
60 public void addPolyPolygon( RealPoint2D position, XPolyPolygon2D polyPolygon )
64 public int getNumberOfPolygons( )
66 return 0;
69 public int getNumberOfPolygonPoints( int polygon )
71 return 0;
74 public FillRule getFillRule( )
76 if( path.getWindingRule() == java.awt.geom.GeneralPath.WIND_EVEN_ODD )
77 return FillRule.EVEN_ODD;
78 else
79 return FillRule.NON_ZERO;
82 public void setFillRule( FillRule fillRule )
84 if( fillRule == FillRule.EVEN_ODD )
85 path.setWindingRule( java.awt.geom.GeneralPath.WIND_EVEN_ODD );
86 else
87 path.setWindingRule( java.awt.geom.GeneralPath.WIND_NON_ZERO );
90 public boolean isClosed( int index )
92 // TODO
93 return false;
96 public void setClosed( int index, boolean closedState )
98 // TODO
101 //----------------------------------------------------------------------------------
104 // XBezierPolyPolygon implementation
105 // =================================
107 public RealBezierSegment2D[][] getBezierSegments( int nPolygonIndex, int nNumberOfPolygons, int nPointIndex, int nNumberOfPoints )
109 return null;
112 public void setBezierSegments( RealBezierSegment2D[][] points, int nPolygonIndex )
114 if( nPolygonIndex != 0 )
115 CanvasUtils.printLog( "LinePolyPolygon.setPoints: subset not yet implemented!" );
117 path = CanvasUtils.makeGenPathFromBezierPoints( points );
120 public RealBezierSegment2D getBezierSegment( int nPolygonIndex, int nPointIndex )
122 return null;
125 public void setBezierSegment( RealBezierSegment2D point, int nPolygonIndex, int nPointIndex )
127 CanvasUtils.printLog( "LinePolyPolygon.setPoint: not yet implemented!" );
130 //----------------------------------------------------------------------------------
133 // XServiceInfo impl
134 // =================
137 private static final String s_implName = "XBezierPolyPolygon2D.java.impl";
138 private static final String s_serviceName = "com.sun.star.rendering.BezierPolyPolygon2D";
140 public String getImplementationName()
142 return s_implName;
145 public String [] getSupportedServiceNames()
147 return new String [] { s_serviceName };
150 public boolean supportsService( String serviceName )
152 return serviceName.equals( s_serviceName );