src/share/classes/javax/swing/plaf/nimbus/SynthPainterImpl.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 47,57 ****
/**
* Paint the provided painter using the provided transform at the specified
* position and size. Handles if g is a non 2D Graphics by painting via a
* BufferedImage.
*/
! private void paint(Painter p, SynthContext ctx, Graphics g, int x, int y,
int w, int h, AffineTransform transform) {
if (p != null) {
if (g instanceof Graphics2D){
Graphics2D gfx = (Graphics2D)g;
if (transform!=null){
--- 47,57 ----
/**
* Paint the provided painter using the provided transform at the specified
* position and size. Handles if g is a non 2D Graphics by painting via a
* BufferedImage.
*/
! private void paint(Painter<Object> p, SynthContext ctx, Graphics g, int x, int y,
int w, int h, AffineTransform transform) {
if (p != null) {
if (g instanceof Graphics2D){
Graphics2D gfx = (Graphics2D)g;
if (transform!=null){
*** 94,121 ****
// for there being no way of turning off Nimbus background painting as
// basic components are all non-opaque by default.
Component c = ctx.getComponent();
Color bg = (c != null) ? c.getBackground() : null;
if (bg == null || bg.getAlpha() > 0){
! Painter backgroundPainter = style.getBackgroundPainter(ctx);
if (backgroundPainter != null) {
paint(backgroundPainter, ctx, g, x, y, w, h,transform);
}
}
}
private void paintForeground(SynthContext ctx, Graphics g, int x, int y,
int w, int h, AffineTransform transform) {
! Painter foregroundPainter = style.getForegroundPainter(ctx);
if (foregroundPainter != null) {
paint(foregroundPainter, ctx, g, x, y, w, h,transform);
}
}
private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w,
int h, AffineTransform transform) {
! Painter borderPainter = style.getBorderPainter(ctx);
if (borderPainter != null) {
paint(borderPainter, ctx, g, x, y, w, h,transform);
}
}
--- 94,122 ----
// for there being no way of turning off Nimbus background painting as
// basic components are all non-opaque by default.
Component c = ctx.getComponent();
Color bg = (c != null) ? c.getBackground() : null;
if (bg == null || bg.getAlpha() > 0){
!
! Painter<Object> backgroundPainter = style.getBackgroundPainter(ctx);
if (backgroundPainter != null) {
paint(backgroundPainter, ctx, g, x, y, w, h,transform);
}
}
}
private void paintForeground(SynthContext ctx, Graphics g, int x, int y,
int w, int h, AffineTransform transform) {
! Painter<Object> foregroundPainter = style.getForegroundPainter(ctx);
if (foregroundPainter != null) {
paint(foregroundPainter, ctx, g, x, y, w, h,transform);
}
}
private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w,
int h, AffineTransform transform) {
! Painter<Object> borderPainter = style.getBorderPainter(ctx);
if (borderPainter != null) {
paint(borderPainter, ctx, g, x, y, w, h,transform);
}
}