public void draw(Shape s) { if( nativeStroking ) drawNative( new QPainterPath(s) ); else fillNative( new QPainterPath( currentStroke.createStrokedShape( s ) ) ); } public void fill(Shape s) { fillNative( new QPainterPath(s) ); } public void drawLine(int x1, int y1, int x2, int y2) { if( nativeStroking ) drawNative( new QPainterPath((double)x1, (double)y1, (double)x2, (double)y2, true) ); else draw( new Line2D.Double((double)x1, (double)y1, (double)x2, (double)y2) ); } public void drawRect(int x, int y, int width, int height) { if( nativeStroking ) drawNative( new QPainterPath((double)x, (double)y, (double)width, (double)height) ); else fillNative( new QPainterPath ( currentStroke.createStrokedShape (new Rectangle2D.Double ((double)x, (double)y, (double)width, (double)height) ) ) ); } public void fillRect(int x, int y, int width, int height) { fillNative( new QPainterPath( x, y, width, height ) ); } public void clearRect(int x, int y, int width, int height) { Color c = color; setColor( bgcolor ); // FIXME fillRect( x, y, width, height ); setColor( c ); } public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { draw( new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight) ); } public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) { fill( new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight) ); } public void drawOval(int x, int y, int width, int height) { draw( new Ellipse2D.Double((double)x, (double)y, (double)width, (double)height) ); } public void fillOval(int x, int y, int width, int height) { fill( new Ellipse2D.Double(x, y, width, height) ); } public void drawArc(int x, int y, int width, int height, int arcStart, int arcAngle) { draw( new Arc2D.Double(x, y, width, height, arcStart, arcAngle, Arc2D.OPEN) ); } public void fillArc(int x, int y, int width, int height, int arcStart, int arcAngle) { fill( new Arc2D.Double(x, y, width, height, arcStart, arcAngle, Arc2D.CHORD) ); } public void drawPolyline(int xPoints[], int yPoints[], int npoints) { for( int i = 0; i < npoints - 1; i++) drawLine(xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1]); } public void drawPolygon(int xPoints[], int yPoints[], int npoints) { draw( new Polygon(xPoints, yPoints, npoints) ); } public void fillPolygon(int xPoints[], int yPoints[], int npoints) { fill( new Polygon(xPoints, yPoints, npoints) );