g.clipRect(insets.left, insets.top, getWidth(), getHeight() - insets.top - insets.bottom); super.paintChildren(g);
g.clipRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height); g.drawImage(buffImg, 0, 0, getWidth(), getHeight(), this);
public AwtCanvas(final Graphics bufferGraphic, final int x, final int y, final int width, final int height) { graphics = bufferGraphic; graphics.clipRect(x, y, width, height); }
public AwtCanvas(final Graphics bufferGraphic, final int x, final int y, final int width, final int height) { graphics = bufferGraphic; graphics.clipRect(x, y, width, height); }
protected void paintComponent(Graphics gc) { super.paintComponent(gc); Dimension cs=getSize(); // component size gc=gc.create(); gc.clipRect(insets.left,insets.top,(cs.width-insets.left-insets.right),(cs.height-insets.top-insets.bottom)); if(mmImage!=null) { gc.drawImage(mmImage,(((cs.width-mmSize.width)/2) +mmHrzShift),(((cs.height-mmSize.height)/2) +mmVrtShift),null); } if(tlImage!=null) { gc.drawImage(tlImage,(insets.left +tlHrzShift),(insets.top +tlVrtShift),null); } if(trImage!=null) { gc.drawImage(trImage,(cs.width-insets.right-trSize.width+trHrzShift),(insets.top +trVrtShift),null); } if(blImage!=null) { gc.drawImage(blImage,(insets.left +blHrzShift),(cs.height-insets.bottom-blSize.height+blVrtShift),null); } if(brImage!=null) { gc.drawImage(brImage,(cs.width-insets.right-brSize.width+brHrzShift),(cs.height-insets.bottom-brSize.height+brVrtShift),null); } }
/** * Returns an EpsGraphics2D object based on this * Graphics object, but with a new translation and clip * area. */ public Graphics create(int x, int y, int width, int height) { Graphics g = create(); g.translate(x, y); g.clipRect(0, 0, width, height); return g; }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paint(Graphics g, JComponent c) { // yet another dirty mac hack to prevent painting background outside of // border. if (hasMacTextFieldBorder(c)) { Insets borderInsets = layoutAndBorder.getRealBorderInsets(); borderInsets.left -= MAC_MARGIN.left; int height = c.getHeight() - borderInsets.bottom - borderInsets.top + MAC_MARGIN.bottom + MAC_MARGIN.top; int width = c.getWidth() - borderInsets.left - borderInsets.right + MAC_MARGIN.right; g.clipRect(borderInsets.left, borderInsets.top, width, height); } super.paint(g, c); }
@Override public void paintLayeredHighlights( Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view ) { Shape saveClip = g.getClip(); Rectangle rc = viewBounds.getBounds(); g.clipRect( 0, rc.y, getWidth(), rc.height ); paintBreakpoints( g, rc ); g.setClip( saveClip ); // Paint these last so that selection highlights paint over breakpoint highlights _highlighter.paintLayeredHighlights( g, p0, p1, viewBounds, editor, view ); }
public void paintIcon(Component _c, Graphics _g, int _x, int _y) { Shape old=_g.getClip(); _g.clipRect(_x,_y,getIconWidth(),getIconHeight()); int x=_x+dx_; int y=_y+dy_; icon_.paintIcon(_c,_g,x,y); _g.setClip(old); } }
public void paintIcon(Component _c, Graphics _g, int _x, int _y) { Icon icon=getIcon(); if(icon!=null) { int w=getIconWidth(); int h=getIconHeight(); Shape old=_g.getClip(); _g.clipRect(_x,_y,w,h); int x=_x+(w-icon.getIconWidth ())/2; int y=_y+(h-icon.getIconHeight())/2; icon.paintIcon(_c,_g,x,y); _g.setClip(old); } } }
protected void peerRepaint(int x, int y, int width, int height) { if (EventQueue.isDispatchThread()) { Graphics g = awtComponent.getGraphics(); try { g.clipRect(x, y, width, height); peerPaint(g, false); } finally { g.dispose(); } } else { PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher().createPaintEvent((Component) awtComponent, 0,0, awtComponent.getWidth(), awtComponent.getHeight()); awtComponent.getToolkit().getSystemEventQueue().postEvent(event); } }
public void paintChildren(Graphics g){ Insets insets = getInsets(); g.clipRect(insets.left, insets.top, getWidth(), getHeight() - insets.top - insets.bottom); super.paintChildren(g); }
@Override public void paintChildren(Graphics g) { Insets insets = getInsets(); g.clipRect(insets.left, insets.top, getWidth(), getHeight() - insets.top - insets.bottom); super.paintChildren(g); }
public void paintChildren(Graphics g) { Insets insets = getInsets(); g.clipRect(insets.left, insets.top, getWidth(), getHeight() - insets.top - insets.bottom); super.paintChildren(g); }
public void paintBorder(Component _c, Graphics _g, int _x, int _y, int _w, int _h) { Shape old=_g.getClip(); Insets r =border_.getBorderInsets(_c); _g.clipRect(_x,_y,_w,_h); int dx=left_ ? 0 : -r.left; int dy=top_ ? 0 : -r.top; int dw=right_ ? -dx : -dx+r.right; int dh=bottom_ ? -dy : -dy+r.bottom; border_.paintBorder(_c,_g,_x+dx,_y+dy,_w+dw,_h+dh); _g.setClip(old); }
/** The iframe box should be clipped */ @Override public void paint(Graphics g, int px, int py) { if (clipOverflow) { g.getClipBounds(sharedClipRect); int cx = sharedClipRect.x; int cy = sharedClipRect.y; int cw = sharedClipRect.width; int ch = sharedClipRect.height; g.clipRect(px + leftMargin + getX(), py + effectiveTopMargin + getY(), width, height); super.paint(g, px, py); g.setClip(cx, cy, cw, ch); } else { super.paint(g, px, py); } }
private void paintDragDivider(Graphics g, int x, int y, int w, int h) { SeaGlassContext context = getContext(splitPane, Region.SPLIT_PANE_DIVIDER); context.setComponentState(((context.getComponentState() | MOUSE_OVER) ^ MOUSE_OVER) | PRESSED); Shape oldClip = g.getClip(); g.clipRect(x, y, w, h); context.getPainter().paintSplitPaneDragDivider(context, g, x, y, w, h, splitPane.getOrientation()); g.setClip(oldClip); context.dispose(); }