protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; Paint oldPaint = g2d.getPaint(); Object oldAAHint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING); if (modelChart.isAntiAlias()) g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setPaint(getLinePaint()); paintComponent(g2d); g2d.setPaint(oldPaint); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldAAHint); }
@Override public Paint getPaint() { return groupG2D.getPaint(); }
public Paint getPaint() { return delegate.getPaint(); }
int height = getHeight(); Graphics2D g2 = (Graphics2D) g; Paint oldPaint = g2.getPaint(); g2.setPaint(new GradientPaint(0, 0, background, width, 0, controlColor)); g2.fillRect(0, 0, width, height);
int height = getHeight(); Graphics2D g2 = (Graphics2D) g; Paint oldPaint = g2.getPaint(); g2.setPaint(new GradientPaint(0, 0, background, width, 0, controlColor)); g2.fillRect(0, 0, width, height);
if (!(graphics.getPaint() instanceof Color))
@Override public Paint getPaint() { return groupG2D.getPaint(); }
/** * Returns the current <code>Paint</code> of the <code>Graphics2D</code> context. * * @return the current <code>Graphics2D</code> <code>Paint</code>, which defines a color or pattern. * @see #setPaint * @see Graphics#setColor */ public Paint getPaint() { return parent.getPaint(); }
/** * Get the current paint object. */ public Paint getPaint() { return g2d.getPaint(); }
private static void drawHighlight(Graphics2D g, float x, float y, Color highlightColor) { Paint oldPaint = g.getPaint(); g.setPaint(highlightColor); g.fill(new Ellipse2D.Double(x - HIGHLIGHT_RADIUS / 2f, y - HIGHLIGHT_RADIUS / 2f, HIGHLIGHT_RADIUS, HIGHLIGHT_RADIUS)); g.setPaint(oldPaint); }
public void drawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted) { Paint originalPaint = g.getPaint(); if (highLighted) g.setPaint(HIGHLIGHT_COLOR); Line2D.Double line = new Line2D.Double(srcX, srcY, targetX, targetY); g.draw(line); if (conditional) { drawConditionalSequenceFlowIndicator(line); } if (highLighted) g.setPaint(originalPaint); }
protected void paintComponent(Graphics g) { final int width = getWidth(); final int height = getHeight(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); g2d.setPaint(new GradientPaint(0, 0, this.colour, width, height, toColour)); g2d.fillRect(0, 0, width, height); g2d.setPaint(oldPaint); super.paintComponent(g); }
protected void paintBoundOutline(Graphics2D g2d, AffineTransform transform) { Rectangle2D boundingRect = getTransformedBounds(transform); Paint oldPaint = g2d.getPaint(); g2d.setPaint(Color.BLACK); g2d.draw(boundingRect); GeomUtil.growRectangle(boundingRect, -1); g2d.setPaint(Color.WHITE); g2d.draw(boundingRect); g2d.setPaint(oldPaint); }
public void save(Graphics g) { Graphics2D g2 = (Graphics2D) g; paint = g2.getPaint(); font = g2.getFont(); stroke = g2.getStroke(); transform = g2.getTransform(); composite = g2.getComposite(); clip = g2.getClip(); renderingHints = g2.getRenderingHints(); color = g2.getColor(); background = g2.getBackground(); }
protected void paintComponent(Graphics g) { final int width = getWidth(); final int height = getHeight(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); g2d.setPaint(new GradientPaint(0, 0, col, width, 0, col2)); g2d.fillRect(0, 0, width, height); g2d.setPaint(oldPaint); super.paintComponent(g); } /**
@Override public void paintComponent( Graphics g ) { if( isRoot && isAqua && node.isExpandable() ) { Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); g2d.setPaint( new GradientPaint(0,0, Color.white, 0, getHeight()/2, getBackground()) ); g2d.fillRect(0, 0, getWidth(), getHeight()); g2d.setPaint(oldPaint); } else { super.paintComponent(g); } }
public void paint (Graphics g, JComponent c) { Rectangle r = c.getBounds(scratch); AbstractButton b = (AbstractButton) c; r.x = 0; r.y = 0; Paint temp = ((Graphics2D) g).getPaint(); paintBackground ((Graphics2D)g, b, r); paintIcon (g, b, r); ((Graphics2D) g).setPaint(temp); }
@Override public void paintComponent(Graphics g) { if (ColorManager.getDefault().isAqua()) { Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); g2d.setPaint(new GradientPaint(0, 0, Color.white, 0, getHeight() / 2, getBackground())); g2d.fillRect(0, 0, getWidth(), getHeight()); g2d.setPaint(oldPaint); } else { super.paintComponent(g); } }