本文整理汇总了Java中com.apple.laf.AquaImageFactory.SlicedImageControl类的典型用法代码示例。如果您正苦于以下问题:Java SlicedImageControl类的具体用法?Java SlicedImageControl怎么用?Java SlicedImageControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SlicedImageControl类属于com.apple.laf.AquaImageFactory包,在下文中一共展示了SlicedImageControl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paint
import com.apple.laf.AquaImageFactory.SlicedImageControl; //导入依赖的package包/类
@Override
void paint(final Graphics2D g, final T stateToPaint) {
if (metricsProvider == null) {
AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, boundsRect);
return;
}
RecyclableJRSUISlicedImageControl slicesRef = slicedControlImages.get(stateToPaint);
if (slicesRef == null) {
final NineSliceMetrics metrics = metricsProvider.getNineSliceMetricsForState(stateToPaint);
if (metrics == null) {
AquaSingleImagePainter.paintFromSingleCachedImage(g, control, stateToPaint, boundsRect);
return;
}
slicesRef = new RecyclableJRSUISlicedImageControl(control, stateToPaint, metrics);
slicedControlImages.put(stateToPaint, slicesRef);
}
final SlicedImageControl slices = slicesRef.get();
slices.paint(g, boundsRect.x, boundsRect.y, boundsRect.width, boundsRect.height);
}
示例2: SlicedShadowBorder
import com.apple.laf.AquaImageFactory.SlicedImageControl; //导入依赖的package包/类
SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) {
super(prePainter, postPainter, offsetX, offsetY, distance, intensity, blur);
final BufferedImage i = new BufferedImage(templateWidth, templateHeight, BufferedImage.TYPE_INT_ARGB_PRE);
super.paintBorder(null, i.getGraphics(), 0, 0, templateWidth, templateHeight);
// debugFrame("slices", i);
slices = new SlicedImageControl(i, leftCut, topCut, rightCut, bottomCut, false);
}