本文整理匯總了Java中java.awt.geom.GeneralPath.setWindingRule方法的典型用法代碼示例。如果您正苦於以下問題:Java GeneralPath.setWindingRule方法的具體用法?Java GeneralPath.setWindingRule怎麽用?Java GeneralPath.setWindingRule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.geom.GeneralPath
的用法示例。
在下文中一共展示了GeneralPath.setWindingRule方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRegiaoComentario
import java.awt.geom.GeneralPath; //導入方法依賴的package包/類
public Shape getRegiaoComentario() {
if (Regiao == null) {
GeneralPath pa = new GeneralPath();
pa.setWindingRule(GeneralPath.WIND_NON_ZERO);
Rectangle rec = getBounds();
int tam = Math.min(rec.width / 6, rec.height / 6);
int curv = tam / 4;
int lw = rec.x + rec.width;
int[] px = new int[]{rec.x, lw - tam, lw, lw, rec.x};
int[] py = new int[]{rec.y, rec.y, rec.y + tam, rec.y + rec.height, rec.y + rec.height};
Polygon po = new Polygon(px, py, 5);
pa.append(po, true);
pa.moveTo(lw - tam, rec.y);
pa.curveTo(lw - tam, rec.y, lw - tam + curv, rec.y + curv, lw - tam, rec.y + tam - (1));
pa.moveTo(lw - tam, rec.y + tam - (1));
pa.lineTo(lw, rec.y + tam);
pa.closePath();
Regiao = pa;
}
return Regiao;
}
示例2: getRegiaoNota
import java.awt.geom.GeneralPath; //導入方法依賴的package包/類
public Shape getRegiaoNota() {
if (Regiao == null) {
final int v1 = getHeight() / 3;
final int h1 = getWidth() / 2;
final int repo = v1 / 3;
final int L = getLeft();
final int T = getTop();
final int TH = T + getHeight() - repo;
final int LW = L + getWidth();
CubicCurve2D c = new CubicCurve2D.Double();
c.setCurve(LW, TH, LW - h1, TH - v1, L + h1, TH + v1, L, TH);
CubicCurve2D c2 = new CubicCurve2D.Double();
int v2 = v1 / 3;
c2.setCurve(L, T + v2, L + h1, T + v1 + v2, LW - h1, T - v1 + v2, LW, T + v2);
GeneralPath pa = new GeneralPath();
pa.setWindingRule(GeneralPath.WIND_EVEN_ODD);
pa.append(c2, true);
pa.lineTo(LW, TH);
pa.append(c, true);
pa.lineTo(L, T + v2);
pa.closePath();
Regiao = pa;
int ptToMove = 3;
this.reposicionePonto[ptToMove] = new Point(0, -repo);
ptsToMove[ptToMove] = 1;
ptToMove = 1;
this.reposicionePonto[ptToMove] = new Point(0, repo);
ptsToMove[ptToMove] = 1;
}
return Regiao;
}
示例3: getRegiao
import java.awt.geom.GeneralPath; //導入方法依賴的package包/類
@Override
public Shape getRegiao() {
if (Regiao == null) {
final int v1 = getHeight() / 3;
final int h1 = getWidth() / 2;
final int repo = v1 / 3;
final int L = getLeft();
final int T = getTop();
final int TH = T + getHeight() - repo;
final int LW = L + getWidth();
CubicCurve2D c = new CubicCurve2D.Double();
c.setCurve(LW, TH, LW - h1, TH - v1, L + h1, TH + v1, L, TH);
CubicCurve2D c2 = new CubicCurve2D.Double();
int v2 = v1 / 3;
c2.setCurve(L, T + v2, L + h1, T + v1 + v2, LW - h1, T - v1 + v2, LW, T + v2);
GeneralPath pa = new GeneralPath();
pa.setWindingRule(GeneralPath.WIND_EVEN_ODD);
pa.append(c2, true);
pa.lineTo(LW, TH);
pa.append(c, true);
pa.lineTo(L, T + v2);
pa.closePath();
Regiao = pa;
int ptToMove = 3;
this.reposicionePonto[ptToMove] = new Point(0, -repo);
ptsToMove[ptToMove] = 1;
ptToMove = 1;
this.reposicionePonto[ptToMove] = new Point(0, repo);
ptsToMove[ptToMove] = 1;
}
return Regiao;
}
示例4: getRegiaoVDocumentos
import java.awt.geom.GeneralPath; //導入方法依賴的package包/類
public Shape getRegiaoVDocumentos() {
if (Regiao == null) {
final int v1 = getHeight() / 3;
final int h1 = getWidth() / 2;
final int repo = v1 / 3;
final int L = getLeft();
int recuo = h1 / 8;
final int T = getTop() + recuo;
final int TH = T + getHeight() - repo - recuo;
final int LW = L + getWidth() - recuo;
CubicCurve2D c = new CubicCurve2D.Double();
c.setCurve(L, TH, L + h1, TH + v1, LW - h1, TH - v1, LW, TH);
GeneralPath pa = new GeneralPath();
pa.setWindingRule(GeneralPath.WIND_EVEN_ODD);
pa.moveTo(LW, TH);
pa.lineTo(LW, T);
pa.lineTo(L, T);
pa.lineTo(L, TH);
pa.append(c, false);
int tam = recuo / 2;
pa.moveTo(L + tam, T);
pa.lineTo(L + tam, T - tam);
pa.lineTo(LW + tam, T - tam);
pa.lineTo(LW + tam, TH - tam);
pa.lineTo(LW, TH - tam);
pa.lineTo(LW, T);
pa.lineTo(L + tam, T);
tam = recuo;
pa.moveTo(L + tam, T - (tam / 2));
pa.lineTo(L + tam, T - tam);
pa.lineTo(LW + tam, T - tam);
pa.lineTo(LW + tam, TH - tam);
pa.lineTo(LW + (tam / 2), TH - tam);
pa.lineTo(LW + (tam / 2), T - (tam / 2));
pa.lineTo(L + tam, T - (tam / 2));
pa.closePath();
Regiao = pa;
final int ptToMove = 3;
this.reposicionePonto[ptToMove] = new Point(-tam / 2, -repo);
ptsToMove[ptToMove] = 1;
}
return Regiao;
}
示例5: getRegiao
import java.awt.geom.GeneralPath; //導入方法依賴的package包/類
@Override
public Shape getRegiao() {
if (Regiao == null) {
final int v1 = getHeight() / 3;
final int h1 = getWidth() / 2;
final int repo = v1 / 3;
final int L = getLeft();
int recuo = h1/8;
final int T = getTop() + recuo;
final int TH = T + getHeight() - repo -recuo;
final int LW = L + getWidth() -recuo;
CubicCurve2D c = new CubicCurve2D.Double();
c.setCurve(L, TH, L + h1, TH + v1, LW - h1, TH - v1, LW, TH);
GeneralPath pa = new GeneralPath();
pa.setWindingRule(GeneralPath.WIND_EVEN_ODD);
pa.moveTo(LW, TH);
pa.lineTo(LW, T);
pa.lineTo(L, T);
pa.lineTo(L, TH);
pa.append(c, false);
int tam = recuo /2;
pa.moveTo(L + tam, T);
pa.lineTo(L + tam, T - tam);
pa.lineTo(LW + tam, T - tam);
pa.lineTo(LW + tam, TH - tam);
pa.lineTo(LW, TH -tam);
pa.lineTo(LW, T);
pa.lineTo(L + tam, T);
tam = recuo;
pa.moveTo(L + tam, T - (tam/2));
pa.lineTo(L + tam, T - tam);
pa.lineTo(LW + tam, T - tam);
pa.lineTo(LW + tam, TH - tam);
pa.lineTo(LW + (tam/2), TH -tam);
pa.lineTo(LW + (tam/2), T -(tam/2));
pa.lineTo(L + tam, T - (tam/2));
pa.closePath();
Regiao = pa;
this.reposicionePonto[ptToMove] = new Point(-tam/2, -repo);
ptsToMove[ptToMove] = 1;
}
return Regiao;
}