/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
return new AquaSingleImagePainter<>(state);
}
static <T extends JRSUIState> AquaPainter<T> create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut) {
}
static <T extends JRSUIState> AquaPainter<T> create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle) {
return create(state, minWidth, minHeight, westCut, eastCut, northCut, southCut, useMiddle, true, true);
}
static <T extends JRSUIState> AquaPainter<T> create(final T state, final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle, final boolean stretchHorizontally, final boolean stretchVertically) {
return new NineSliceMetrics(minWidth, minHeight, westCut, eastCut, northCut, southCut, useMiddle, stretchHorizontally, stretchVertically);
}
});
}
static <T extends JRSUIState> AquaPainter<T> create(final T state, final NineSliceMetricsProvider metricsProvider) {
}
T state;
}
return control;
}
final int y, final int w, final int h) {
boundsRect.setBounds(x, y, w, h);
}
extends AquaPainter<T> {
}
super(new JRSUIControl(false), state);
this.metricsProvider = metricsProvider;
slicedControlImages = new HashMap<>();
}
if (metricsProvider == null) {
return;
}
return;
}
}
}
}
extends AquaPainter<T> {
super(new JRSUIControl(false), state);
}
}
return;
}
int scale = 1;
if (g instanceof SunGraphics2D) {
}
}
}
}
private static class RecyclableJRSUISlicedImageControl
extends RecyclableSlicedImageControl {
RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) {
super(metrics);
}
BufferedImage image = new BufferedImage(metrics.minW, metrics.minH, BufferedImage.TYPE_INT_ARGB_PRE);
control.paint(SunWritableRaster.stealData(buffer, 0), metrics.minW, metrics.minH, 0, 0, metrics.minW, metrics.minH);
return image;
}
}
try {
return (SunGraphics2D)g; // doing a blind try is faster than checking instanceof
if (g instanceof PeekGraphics) {
// if it is a peek just dirty the region
} else if (g instanceof ProxyGraphics2D) {
if (g2d instanceof SunGraphics2D) {
return g2d;
}
} else if (g instanceof Graphics2D) {
return (Graphics2D) g;
}
}
return null;
}
}