/*
* 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.
*/
public class AquaImageFactory {
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
Image createImage() {
}
});
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
final Image lockIcon = AquaUtils.getCImageCreator().createImageFromFile("/System/Library/CoreServices/SecurityAgent.app/Contents/Resources/Security.icns", kAlertIconSize, kAlertIconSize);
return getAppIconCompositedOn(lockIcon);
}
return getAppIconCompositedOn(lockIcon);
}
return getGenericJavaIcon();
}
return getGenericJavaIcon();
}
return getGenericJavaIcon();
}
}
}
});
}
return FileManager.getPathToApplicationBundle();
}
});
}
}
final Icon smallAppIconScaled = new AquaIcon.CachingScalingIcon(kAlertSubIconSize, kAlertSubIconSize) {
Image createImage() {
}
};
final BufferedImage image = new BufferedImage(kAlertIconSize, kAlertIconSize, BufferedImage.TYPE_INT_ARGB);
g.drawImage(background, 0, 0, (int)(kAlertIconSize * scaleFactor), (int)(kAlertIconSize * scaleFactor), null);
if (g instanceof Graphics2D) {
// improves icon rendering quality in Quartz
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
}
g.dispose();
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
}, 20, 20);
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
}, 20, 20);
}
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
}
}, 20, 20);
}
this.namedImage = namedImage;
}
}
}
}
}
}
super(image);
}
return invertedImage = new IconUIResource(new ImageIcon(AquaUtils.generateLightenedImage(getImage(), 100)));
}
}
protected static final IconUIResourceSingleton northArrowIcon = new IconUIResourceSingleton(northArrow);
protected static final NamedImageSingleton southArrow = new NamedImageSingleton("NSMenuScrollDown");
protected static final IconUIResourceSingleton southArrowIcon = new IconUIResourceSingleton(southArrow);
protected static final NamedImageSingleton westArrow = new NamedImageSingleton("NSMenuSubmenuLeft");
protected static final IconUIResourceSingleton westArrowIcon = new IconUIResourceSingleton(westArrow);
protected static final IconUIResourceSingleton eastArrowIcon = new IconUIResourceSingleton(eastArrow);
switch(direction) {
}
return null;
}
switch(direction) {
}
return null;
}
}
return new InvertableImageIcon(AquaUtils.generateLightenedImage(Toolkit.getDefaultToolkit().getImage("NSImage://NSMenuItemSelection"), 25));
}
return new InvertableImageIcon(AquaUtils.generateLightenedImage(Toolkit.getDefaultToolkit().getImage("NSImage://NSMenuMixedState"), 25));
}
public static class NineSliceMetrics {
public NineSliceMetrics(final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut) {
}
public NineSliceMetrics(final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean showMiddle) {
}
public NineSliceMetrics(final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean showMiddle, final boolean stretchHorizontally, final boolean stretchVertically) {
this.showMiddle = showMiddle; this.stretchH = stretchHorizontally; this.stretchV = stretchVertically;
}
}
/*
* A "paintable" which holds nine images, which represent a sliced up initial
* image that can be streched from its middles.
*/
public static class SlicedImageControl {
final BufferedImage W, C, E;
public SlicedImageControl(final Image img, final int westCut, final int eastCut, final int northCut, final int southCut) {
}
public SlicedImageControl(final Image img, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle) {
}
public SlicedImageControl(final Image img, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle, final boolean stretchHorizontally, final boolean stretchVertically) {
this(img, new NineSliceMetrics(img.getWidth(null), img.getHeight(null), westCut, eastCut, northCut, southCut, useMiddle, stretchHorizontally, stretchVertically));
}
throw new IllegalArgumentException("SlicedImageControl: template image and NineSliceMetrics don't agree on minimum dimensions");
}
C = metrics.showMiddle ? createSlice(img, metrics.wCut, metrics.nCut, centerColWidth, centerRowHeight) : null;
SE = createSlice(img, totalWidth - metrics.eCut, totalHeight - metrics.sCut, metrics.eCut, metrics.sCut);
}
static BufferedImage createSlice(final Image img, final int x, final int y, final int w, final int h) {
return slice;
}
g.translate(x, y);
if (w < totalWidth || h < totalHeight) {
paintCompressed(g, w, h);
} else {
paintStretchedMiddles(g, w, h);
}
g.translate(-x, -y);
}
if (N != null) g.drawImage(N, baseX + metrics.wCut, baseY, adjustedWidth - metrics.eCut - metrics.wCut, metrics.nCut, null);
if (W != null) g.drawImage(W, baseX, baseY + metrics.nCut, metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut, null);
if (C != null) g.drawImage(C, baseX + metrics.wCut, baseY + metrics.nCut, adjustedWidth - metrics.eCut - metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut, null);
if (E != null) g.drawImage(E, baseX + adjustedWidth - metrics.eCut, baseY + metrics.nCut, metrics.eCut, adjustedHeight - metrics.nCut - metrics.sCut, null);
if (S != null) g.drawImage(S, baseX + metrics.wCut, baseY + adjustedHeight - metrics.sCut, adjustedWidth - metrics.eCut - metrics.wCut, metrics.sCut, null);
if (SE != null) g.drawImage(SE, baseX + adjustedWidth - metrics.eCut, baseY + adjustedHeight - metrics.sCut, null);
/*
if (NW != null) {g.setColor(Color.GREEN); g.fillRect(baseX, baseY, NW.getWidth(), NW.getHeight());}
if (N != null) {g.setColor(Color.RED); g.fillRect(baseX + metrics.wCut, baseY, adjustedWidth - metrics.eCut - metrics.wCut, metrics.nCut);}
if (NE != null) {g.setColor(Color.BLUE); g.fillRect(baseX + adjustedWidth - metrics.eCut, baseY, NE.getWidth(), NE.getHeight());}
if (W != null) {g.setColor(Color.PINK); g.fillRect(baseX, baseY + metrics.nCut, metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut);}
if (C != null) {g.setColor(Color.ORANGE); g.fillRect(baseX + metrics.wCut, baseY + metrics.nCut, adjustedWidth - metrics.eCut - metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut);}
if (E != null) {g.setColor(Color.CYAN); g.fillRect(baseX + adjustedWidth - metrics.eCut, baseY + metrics.nCut, metrics.eCut, adjustedHeight - metrics.nCut - metrics.sCut);}
if (SW != null) {g.setColor(Color.MAGENTA); g.fillRect(baseX, baseY + adjustedHeight - metrics.sCut, SW.getWidth(), SW.getHeight());}
if (S != null) {g.setColor(Color.DARK_GRAY); g.fillRect(baseX + metrics.wCut, baseY + adjustedHeight - metrics.sCut, adjustedWidth - metrics.eCut - metrics.wCut, metrics.sCut);}
if (SE != null) {g.setColor(Color.YELLOW); g.fillRect(baseX + adjustedWidth - metrics.eCut, baseY + adjustedHeight - metrics.sCut, SE.getWidth(), SE.getHeight());}
*/
}
}
}
public abstract static class RecyclableSlicedImageControl extends RecyclableObject<SlicedImageControl> {
}
}
}
// when we use SystemColors, we need to proxy the color with something that implements UIResource,
// so that it will be uninstalled when the look and feel is changed.
}
public int getRGB() {
}
}
//return AquaNativeResources.getWindowBackgroundColorUIResource();
}
}
}
}
}
}
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_BACKGROUND_COLOR));
}
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR));
}
}