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


Java PPaintContext.popClip方法代码示例

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


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

示例1: paint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paint(PPaintContext paintContext) {
    Graphics2D g2 = paintContext.getGraphics();

    g2.setPaint(getPaint());
    g2.draw(getBoundsReference());
    g2.setFont(CalendarNode.DEFAULT_FONT);

    float y = (float) getY() + CalendarNode.TEXT_Y_OFFSET;
    paintContext.getGraphics().drawString(dayOfMonthString,
            (float) getX() + CalendarNode.TEXT_X_OFFSET, y);

    if (hasWidthFocus && hasHeightFocus) {
        paintContext.pushClip(getBoundsReference());
        for (int i = 0; i < lines.size(); i++) {
            y += 10;
            g2.drawString((String) lines.get(i),
                    (float) getX() + CalendarNode.TEXT_X_OFFSET, y);
        }
        paintContext.popClip(getBoundsReference());
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:DayNode.java

示例2: paintAfterChildren

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paintAfterChildren( PPaintContext paintContext ) {
    if ( !clipEnabled ) {
        super.paintAfterChildren( paintContext );
        return;
    }
    paintContext.popClip( getPathReference() );
    if ( getStroke() != null && getStrokePaint() != null ) {
        Graphics2D g2 = paintContext.getGraphics();
        g2.setPaint( getStrokePaint() );
        g2.setStroke( getStroke() );
        g2.draw( getPathReference() );
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:TogglePClip.java

示例3: fullPaint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
public void fullPaint( PPaintContext paintContext ) {
    Shape origClip = paintContext.getLocalClip();
    //todo: works under a variety of conditions, not fully tested
    Rectangle rect = new Rectangle( 0, 0, (int) getFullBounds().getWidth(), (int) ( getFullBounds().getHeight() / 2 - getOffset().getY() + getDistanceFromParentOriginToOscillatorY() - image.getFullBounds().getHeight() / 2 ) );
    localToParent( rect );
    if ( clip ) {
        paintContext.pushClip( rect );
    }
    super.fullPaint( paintContext );
    if ( clip ) {
        paintContext.popClip( origClip );
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:FaucetGraphic.java

示例4: paint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paint( PPaintContext paintContext ) {

        Graphics2D g2 = paintContext.getGraphics();

        if ( _renderingHints != null ) {
            g2.setRenderingHints( _renderingHints );
        }

        // Clip to the data area.
        // Do NOT call g2.setClip, or really bad things happen
        // with drawing order on Macintosh (and possibly other platforms).
        paintContext.pushClip( _dataArea );

        // Render each of the plot's datasets, in the proper order...
        int numberOfDatasets = _plot.getDatasetCount();
        DatasetRenderingOrder renderingOrder = _plot.getDatasetRenderingOrder();
        if ( renderingOrder == DatasetRenderingOrder.FORWARD ) {
            for ( int i = 0; i < numberOfDatasets; i++ ) {
                _plot.render( g2, _dataArea, i, null, null );
            }
        }
        else { /* DatasetRenderingOrder.REVERSE */
            for ( int i = numberOfDatasets - 1; i >= 0; i-- ) {
                _plot.render( g2, _dataArea, i, null, null );
            }
        }

        // restore the clip
        paintContext.popClip( null );

        // optionally stroke the data area -- do this after restoring the clip
        if ( _dataAreaStroked ) {
            g2.setStroke( _plot.getOutlineStroke() );
            g2.setPaint( _plot.getOutlinePaint() );
            g2.draw( _dataArea );
        }
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:38,代码来源:XYPlotNode.java

示例5: paintAfterChildren

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
/**
 * Paints a border around this node if it has a stroke and stroke paint
 * provided.
 * 
 * @param paintContext context into which the border will be drawn
 */
protected void paintAfterChildren(final PPaintContext paintContext) {
    paintContext.popClip(getPathReference());
    if (getStroke() != null && getStrokePaint() != null) {
        final Graphics2D g2 = paintContext.getGraphics();
        g2.setPaint(getStrokePaint());
        g2.setStroke(getStroke());
        g2.draw(getPathReference());
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:PClip.java

示例6: paint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
/**
 * Paint this camera and then paint this camera's view through its view
 * transform.
 * 
 * @param paintContext context in which painting occurs
 */
protected void paint(final PPaintContext paintContext) {
    super.paint(paintContext);

    paintContext.pushClip(getBoundsReference());
    paintContext.pushTransform(viewTransform);

    paintCameraView(paintContext);
    paintDebugInfo(paintContext);

    paintContext.popTransform(viewTransform);
    paintContext.popClip(getBoundsReference());
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:19,代码来源:PCamera.java

示例7: paintAfterChildren

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paintAfterChildren( PPaintContext paintContext ) {
    paintContext.popClip( null );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:4,代码来源:FilamentNode.java

示例8: paintAfterChildren

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paintAfterChildren( PPaintContext paintContext ) {
    if ( clip != null ) {
        paintContext.popClip( null );
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:6,代码来源:ElectronNode.java

示例9: paint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paint( PPaintContext paintContext ) {
    GeneralPath lensPath = _lensNode.getPathReference();
    paintContext.pushClip( lensPath );
    super.paint( paintContext );
    paintContext.popClip( lensPath );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:7,代码来源:BSMagnifyingGlass.java

示例10: paint

import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * 
 * <p>
 * The HTML text is painted last, so it will appear on top of any child
 * nodes.
 * </p>
 */
protected void paint(final PPaintContext paintContext) {
    super.paint(paintContext);
    paintContext.pushClip(getBounds());
    final Graphics2D g2 = paintContext.getGraphics();
    htmlView.paint(g2, getBounds().getBounds());
    paintContext.popClip(getBounds());
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:PHtmlView.java


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