本文整理汇总了Java中edu.umd.cs.piccolo.util.PPaintContext.pushClip方法的典型用法代码示例。如果您正苦于以下问题:Java PPaintContext.pushClip方法的具体用法?Java PPaintContext.pushClip怎么用?Java PPaintContext.pushClip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.piccolo.util.PPaintContext
的用法示例。
在下文中一共展示了PPaintContext.pushClip方法的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: paint
import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paint( PPaintContext paintContext ) {
if ( !clipEnabled ) {
super.paint( paintContext );
return;
}
Paint p = getPaint();
if ( p != null ) {
Graphics2D g2 = paintContext.getGraphics();
g2.setPaint( p );
g2.fill( getPathReference() );
}
paintContext.pushClip( getPathReference() );
}
示例3: paint
import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paint( PPaintContext paintContext ) {
if ( clip != null ) {
Shape origClip = paintContext.getGraphics().getClip();
Area area = new Area( origClip );
area.subtract( new Area( clip ) );
paintContext.pushClip( area );
}
}
示例4: 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 );
}
}
示例5: 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 );
}
}
示例6: paint
import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
/**
* Paint's this node as a solid rectangle if paint is provided, clipping
* appropriately.
*
* @param paintContext context into which this node will be painted
*/
protected void paint(final PPaintContext paintContext) {
final Paint p = getPaint();
if (p != null) {
final Graphics2D g2 = paintContext.getGraphics();
g2.setPaint(p);
g2.fill(getPathReference());
}
paintContext.pushClip(getPathReference());
}
示例7: 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());
}
示例8: paint
import edu.umd.cs.piccolo.util.PPaintContext; //导入方法依赖的package包/类
protected void paint( PPaintContext paintContext ) {
Shape origClip = paintContext.getGraphics().getClip();
Area area = new Area( origClip );
area.subtract( new Area( totalBulbComponentNode.getClipShape( this ) ) );
paintContext.pushClip( area );
}
示例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());
}