本文整理了Java中java.awt.Graphics2D.clip()
方法的一些代码示例,展示了Graphics2D.clip()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graphics2D.clip()
方法的具体详情如下:
包路径:java.awt.Graphics2D
类名称:Graphics2D
方法名:clip
暂无
代码示例来源:origin: jphp-group/jphp
@Signature
public void clipRect(double x, double y, double width, double height) {
gc.clip(new Rectangle2D.Double(x, y, width, height));
}
代码示例来源:origin: jphp-group/jphp
@Signature
public void clipEllipse(double x, double y, double width, double height) {
gc.clip(new Ellipse2D.Double(x, y, width, height));
}
代码示例来源:origin: org.apache.poi/poi
if (isClipped) graphics.clip(anchor.getBounds2D());
graphics.drawRenderedImage(img, at);
graphics.setClip(clipOld);
代码示例来源:origin: plantuml/plantuml
/**
* Starts rendering of the specified composite. Does nothing except if
* <tt>composite</tt> has a {@link ClippingShape}. In this case the Clip
* of the <tt>Graphics2D</tt> context becomes the clipping rectangle
* determined by the bounding box of the <tt>ClippingShape</tt>.
*/
public void startRendering(GraphicalComposite composite) {
ClippingShape shape = composite.getClippingShape();
if (shape != null) {
ClippingRectangle rect = shape.getBoundingBox();
_graphics.clip(new Rectangle2D.Double(rect.getMinX(), rect.getMinY(), rect.getMaxX() - rect.getMinX(), rect
.getMaxY()
- rect.getMinY()));
}
}
代码示例来源:origin: apache/pdfbox
@Override
public void clip(Shape s)
{
groupG2D.clip(s);
alphaG2D.clip(s);
}
代码示例来源:origin: geotools/geotools
public void clip(Shape s) {
delegate.clip(s);
}
代码示例来源:origin: nodebox/nodebox
public void draw(Graphics2D g) {
if (background != null) {
g.setColor(background.getAwtColor());
g.fill(getBounds().getRectangle2D());
}
g.clip(getBounds().getRectangle2D());
for (Grob grob : items) {
grob.draw(g);
}
}
代码示例来源:origin: geotools/geotools
Graphics2D clippedGraphics = (Graphics2D) graphics.create();
clippedGraphics.clip(shape);
LineStyle2D lineStyle = new LineStyle2D();
lineStyle.setStroke(ms2d.getStroke());
g.clip(shape);
代码示例来源:origin: org.apache.pdfbox/pdfbox
@Override
public void clip(Shape s)
{
groupG2D.clip(s);
alphaG2D.clip(s);
}
代码示例来源:origin: JetBrains/jediterm
@Override
public void clip(Shape s) {
myPeer.clip(s);
}
代码示例来源:origin: net.java.dev/pdf-renderer
/**
* add the path to the current clip. The new clip will be the intersection
* of the old clip and given path.
*/
public void clip(GeneralPath s) {
g.clip(s);
}
代码示例来源:origin: com.atlassian.confluence.officeconnector/pdf-renderer
/**
* add the path to the current clip. The new clip will be the intersection
* of the old clip and given path.
*/
public void clip(GeneralPath s) {
g.clip(s);
}
代码示例来源:origin: com.samskivert/samskivert
@Override
public void clip (Shape s)
{
_copy.clip(s);
_primary.clip(s);
}
代码示例来源:origin: net.java.dev/pdf-renderer
/**
* set the clip to be the given shape. The current clip is not taken
* into account.
*/
private void setClip(Shape s) {
state.cliprgn = s;
g.setClip(null);
g.clip(s);
}
代码示例来源:origin: com.github.rjolly/pdf-renderer
/**
* set the clip to be the given shape. The current clip is not taken
* into account.
*/
private void setClip(Shape s) {
state.cliprgn = s;
g.setClip(null);
g.clip(s);
}
代码示例来源:origin: com.haulmont.thirdparty/poi
public void clip(Shape s)
{
System.out.println( "clip(Shape):" );
System.out.println( " s = " + s );
g2D.clip( s );
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public void clip(Shape s)
{
System.out.println( "clip(Shape):" );
System.out.println( " s = " + s );
g2D.clip( s );
}
代码示例来源:origin: org.apache.xmlgraphics/batik-awt-util
public static Graphics2D createGraphics(BufferedImage bi) {
Graphics2D g2d = bi.createGraphics();
g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
new WeakReference(bi));
g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
return g2d;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-screen
public void paint (Graphics g) {
Graphics2D gr = (Graphics2D) g;
Shape previousClip = gr.getClip ();
gr.clip (new RoundRectangle2D.Float (0, 0, getWidth (), getHeight (), 8, 8));
super.paint (g);
gr.setClip (previousClip);
}
代码示例来源:origin: pentaho/pentaho-reporting
public void clip( final StrictBounds bounds ) {
final Graphics2D g = getGraphics();
graphicsContexts.push( g );
graphics = (Graphics2D) g.create();
graphics.clip( StrictGeomUtility.createAWTRectangle( bounds ) );
}
内容来源于网络,如有侵权,请联系作者删除!