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


Java BlockShapeUtil.appendPath方法代码示例

本文整理汇总了Java中edu.mit.blocks.codeblocks.rendering.BlockShapeUtil.appendPath方法的典型用法代码示例。如果您正苦于以下问题:Java BlockShapeUtil.appendPath方法的具体用法?Java BlockShapeUtil.appendPath怎么用?Java BlockShapeUtil.appendPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.mit.blocks.codeblocks.rendering.BlockShapeUtil的用法示例。


在下文中一共展示了BlockShapeUtil.appendPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reformArea

import edu.mit.blocks.codeblocks.rendering.BlockShapeUtil; //导入方法依赖的package包/类
/**
 * Reform the BlockShape area.  This is the major procedure that makes all of the sides
 * combines them in their correct directions, and connects them so they are all one direction.
 * @return reformed Area of the BlockShape
 */
public Area reformArea() {
    //hopefully reseting is less costly than creating new ones
    gpTop.reset();
    gpRight.reset();
    gpBottom.reset();
    gpLeft.reset();

    setupDimensions();

    //make all of the sides
    makeTopSide();
    makeRightSide();
    makeBottomSide();
    makeLeftSide();


    //corrected (clockwise) left and bottom
    gpBottomClockwise = new GeneralPath();
    gpLeftClockwise = new GeneralPath();
    gpBottomClockwise.moveTo((float) gpBottom.getCurrentPoint().getX(),
            (float) gpBottom.getCurrentPoint().getY());
    gpLeftClockwise.moveTo((float) gpLeft.getCurrentPoint().getX(),
            (float) gpLeft.getCurrentPoint().getY());
    BlockShapeUtil.appendPath(gpBottomClockwise, gpBottom, true);
    BlockShapeUtil.appendPath(gpLeftClockwise, gpLeft, true);


    //create direction specific paths
    GeneralPath gpClockwise = new GeneralPath();
    GeneralPath gpCounterClockwise = new GeneralPath();

    //add to the direction specific paths
    gpCounterClockwise.append(gpLeft, true);
    gpCounterClockwise.append(gpBottom, true);
    gpClockwise.append(gpTop, true);
    gpClockwise.append(gpRight, true);

    //connect so gpCounterClockwise is the full path
    //it must be counter-clockwise for the bevel to be able to use it
    BlockShapeUtil.appendPath(gpCounterClockwise, gpClockwise, true);

    //convert it to an area
    blockArea = new Area(gpCounterClockwise);

    return blockArea;
}
 
开发者ID:heqichen,项目名称:openblocks,代码行数:52,代码来源:BlockShape.java


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