当前位置: 首页>>代码示例>>Java>>正文


Java GeneralPath.setWindingRule方法代码示例

本文整理汇总了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;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:24,代码来源:LivreBase.java

示例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;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:34,代码来源:LivreBase.java

示例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;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:36,代码来源:FluxNota.java

示例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;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:51,代码来源:LivreBase.java

示例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;
}
 
开发者ID:chcandido,项目名称:brModelo,代码行数:51,代码来源:FluxVDocumentos.java


注:本文中的java.awt.geom.GeneralPath.setWindingRule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。