< prev index next >
src/java.desktop/share/classes/sun/java2d/pipe/PixelToShapeConverter.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 96,106 ****
int start, int extent) {
outpipe.fill(sg, new Arc2D.Float(x, y, w, h,
start, extent, Arc2D.PIE));
}
! private Shape makePoly(int xPoints[], int yPoints[],
int nPoints, boolean close) {
GeneralPath gp = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
if (nPoints > 0) {
gp.moveTo(xPoints[0], yPoints[0]);
for (int i = 1; i < nPoints; i++) {
--- 96,106 ----
int start, int extent) {
outpipe.fill(sg, new Arc2D.Float(x, y, w, h,
start, extent, Arc2D.PIE));
}
! private Shape makePoly(int[] xPoints, int[] yPoints,
int nPoints, boolean close) {
GeneralPath gp = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
if (nPoints > 0) {
gp.moveTo(xPoints[0], yPoints[0]);
for (int i = 1; i < nPoints; i++) {
*** 112,133 ****
}
return gp;
}
public void drawPolyline(SunGraphics2D sg,
! int xPoints[], int yPoints[],
int nPoints) {
outpipe.draw(sg, makePoly(xPoints, yPoints, nPoints, false));
}
public void drawPolygon(SunGraphics2D sg,
! int xPoints[], int yPoints[],
int nPoints) {
outpipe.draw(sg, makePoly(xPoints, yPoints, nPoints, true));
}
public void fillPolygon(SunGraphics2D sg,
! int xPoints[], int yPoints[],
int nPoints) {
outpipe.fill(sg, makePoly(xPoints, yPoints, nPoints, true));
}
}
--- 112,133 ----
}
return gp;
}
public void drawPolyline(SunGraphics2D sg,
! int[] xPoints, int[] yPoints,
int nPoints) {
outpipe.draw(sg, makePoly(xPoints, yPoints, nPoints, false));
}
public void drawPolygon(SunGraphics2D sg,
! int[] xPoints, int[] yPoints,
int nPoints) {
outpipe.draw(sg, makePoly(xPoints, yPoints, nPoints, true));
}
public void fillPolygon(SunGraphics2D sg,
! int[] xPoints, int[] yPoints,
int nPoints) {
outpipe.fill(sg, makePoly(xPoints, yPoints, nPoints, true));
}
}
< prev index next >