本文整理汇总了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());
}
}
示例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() );
}
}
示例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 );
}
}
示例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 );
}
}
示例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());
}
}
示例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());
}
示例7: paintAfterChildren
import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paintAfterChildren( PPaintContext paintContext ) {
paintContext.popClip( null );
}
示例8: paintAfterChildren
import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paintAfterChildren( PPaintContext paintContext ) {
if ( clip != null ) {
paintContext.popClip( null );
}
}
示例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 );
}
示例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());
}