Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java
41154 views
1
/*
2
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package com.apple.laf;
27
28
import java.awt.*;
29
import java.awt.image.BufferedImage;
30
import java.security.PrivilegedAction;
31
32
import javax.swing.*;
33
import javax.swing.plaf.*;
34
35
import sun.lwawt.macosx.LWCToolkit;
36
import apple.laf.JRSUIConstants.AlignmentHorizontal;
37
import apple.laf.JRSUIConstants.AlignmentVertical;
38
import apple.laf.JRSUIConstants.Direction;
39
import apple.laf.JRSUIConstants.State;
40
import apple.laf.JRSUIConstants.Widget;
41
import apple.laf.*;
42
43
import com.apple.eio.FileManager;
44
import com.apple.laf.AquaIcon.InvertableIcon;
45
import com.apple.laf.AquaIcon.JRSUIControlSpec;
46
import com.apple.laf.AquaIcon.SystemIcon;
47
import com.apple.laf.AquaUtils.RecyclableObject;
48
import com.apple.laf.AquaUtils.RecyclableSingleton;
49
import sun.awt.image.MultiResolutionCachedImage;
50
import sun.lwawt.macosx.CImage;
51
52
public class AquaImageFactory {
53
public static IconUIResource getConfirmImageIcon() {
54
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
55
56
return new IconUIResource(new AquaIcon.CachingScalingIcon(kAlertIconSize, kAlertIconSize) {
57
Image createImage() {
58
return getGenericJavaIcon();
59
}
60
});
61
}
62
63
public static IconUIResource getCautionImageIcon() {
64
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
65
return getAppIconCompositedOn(AquaIcon.SystemIcon.getCautionIcon());
66
}
67
68
public static IconUIResource getStopImageIcon() {
69
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
70
return getAppIconCompositedOn(AquaIcon.SystemIcon.getStopIcon());
71
}
72
73
public static IconUIResource getLockImageIcon() {
74
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
75
if (JRSUIUtils.Images.shouldUseLegacySecurityUIPath()) {
76
final Image lockIcon = CImage.createImageFromFile("/System/Library/CoreServices/SecurityAgent.app/Contents/Resources/Security.icns", kAlertIconSize, kAlertIconSize);
77
return getAppIconCompositedOn(lockIcon);
78
}
79
80
final Image lockIcon = Toolkit.getDefaultToolkit().getImage("NSImage://NSSecurity");
81
return getAppIconCompositedOn(lockIcon);
82
}
83
84
@SuppressWarnings("removal")
85
static Image getGenericJavaIcon() {
86
return java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
87
public Image run() {
88
return com.apple.eawt.Application.getApplication().getDockIconImage();
89
}
90
});
91
}
92
93
@SuppressWarnings("removal")
94
static String getPathToThisApplication() {
95
return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
96
public String run() {
97
return FileManager.getPathToApplicationBundle();
98
}
99
});
100
}
101
102
static IconUIResource getAppIconCompositedOn(final SystemIcon systemIcon) {
103
systemIcon.setSize(kAlertIconSize, kAlertIconSize);
104
return getAppIconCompositedOn(systemIcon.createImage());
105
}
106
107
private static final int kAlertIconSize = 64;
108
static IconUIResource getAppIconCompositedOn(final Image background) {
109
110
if (background instanceof MultiResolutionCachedImage) {
111
int width = background.getWidth(null);
112
Image mrIconImage = ((MultiResolutionCachedImage) background).map(
113
rv -> getAppIconImageCompositedOn(rv, rv.getWidth(null) / width));
114
return new IconUIResource(new ImageIcon(mrIconImage));
115
}
116
117
BufferedImage iconImage = getAppIconImageCompositedOn(background, 1);
118
return new IconUIResource(new ImageIcon(iconImage));
119
}
120
121
static BufferedImage getAppIconImageCompositedOn(final Image background, int scaleFactor) {
122
123
final int scaledAlertIconSize = kAlertIconSize * scaleFactor;
124
final int kAlertSubIconSize = (int) (scaledAlertIconSize * 0.5);
125
final int kAlertSubIconInset = scaledAlertIconSize - kAlertSubIconSize;
126
final Icon smallAppIconScaled = new AquaIcon.CachingScalingIcon(
127
kAlertSubIconSize, kAlertSubIconSize) {
128
Image createImage() {
129
return getGenericJavaIcon();
130
}
131
};
132
133
final BufferedImage image = new BufferedImage(scaledAlertIconSize,
134
scaledAlertIconSize, BufferedImage.TYPE_INT_ARGB_PRE);
135
final Graphics g = image.getGraphics();
136
g.drawImage(background, 0, 0,
137
scaledAlertIconSize, scaledAlertIconSize, null);
138
if (g instanceof Graphics2D) {
139
// improves icon rendering quality in Quartz
140
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING,
141
RenderingHints.VALUE_RENDER_QUALITY);
142
}
143
144
smallAppIconScaled.paintIcon(null, g,
145
kAlertSubIconInset, kAlertSubIconInset);
146
g.dispose();
147
148
return image;
149
}
150
151
public static IconUIResource getTreeFolderIcon() {
152
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
153
return AquaIcon.SystemIcon.getFolderIconUIResource();
154
}
155
156
public static IconUIResource getTreeOpenFolderIcon() {
157
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
158
return AquaIcon.SystemIcon.getOpenFolderIconUIResource();
159
}
160
161
public static IconUIResource getTreeDocumentIcon() {
162
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
163
return AquaIcon.SystemIcon.getDocumentIconUIResource();
164
}
165
166
public static UIResource getTreeExpandedIcon() {
167
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
168
return AquaIcon.getIconFor(new JRSUIControlSpec() {
169
public void initIconPainter(final AquaPainter<? extends JRSUIState> painter) {
170
painter.state.set(Widget.DISCLOSURE_TRIANGLE);
171
painter.state.set(State.ACTIVE);
172
painter.state.set(Direction.DOWN);
173
painter.state.set(AlignmentHorizontal.CENTER);
174
painter.state.set(AlignmentVertical.CENTER);
175
}
176
}, 20, 20);
177
}
178
179
public static UIResource getTreeCollapsedIcon() {
180
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
181
return AquaIcon.getIconFor(new JRSUIControlSpec() {
182
public void initIconPainter(final AquaPainter<? extends JRSUIState> painter) {
183
painter.state.set(Widget.DISCLOSURE_TRIANGLE);
184
painter.state.set(State.ACTIVE);
185
painter.state.set(Direction.RIGHT);
186
painter.state.set(AlignmentHorizontal.CENTER);
187
painter.state.set(AlignmentVertical.CENTER);
188
}
189
}, 20, 20);
190
}
191
192
public static UIResource getTreeRightToLeftCollapsedIcon() {
193
// public, because UIDefaults.ProxyLazyValue uses reflection to get this value
194
return AquaIcon.getIconFor(new JRSUIControlSpec() {
195
public void initIconPainter(final AquaPainter<? extends JRSUIState> painter) {
196
painter.state.set(Widget.DISCLOSURE_TRIANGLE);
197
painter.state.set(State.ACTIVE);
198
painter.state.set(Direction.LEFT);
199
painter.state.set(AlignmentHorizontal.CENTER);
200
painter.state.set(AlignmentVertical.CENTER);
201
}
202
}, 20, 20);
203
}
204
205
static class NamedImageSingleton extends RecyclableSingleton<Image> {
206
final String namedImage;
207
208
NamedImageSingleton(final String namedImage) {
209
this.namedImage = namedImage;
210
}
211
212
@Override
213
protected Image getInstance() {
214
return getNSIcon(namedImage);
215
}
216
}
217
218
static class IconUIResourceSingleton extends RecyclableSingleton<IconUIResource> {
219
final NamedImageSingleton holder;
220
221
public IconUIResourceSingleton(final NamedImageSingleton holder) {
222
this.holder = holder;
223
}
224
225
@Override
226
protected IconUIResource getInstance() {
227
return new IconUIResource(new ImageIcon(holder.get()));
228
}
229
}
230
231
@SuppressWarnings("serial") // Superclass is not serializable across versions
232
static class InvertableImageIcon extends ImageIcon implements InvertableIcon, UIResource {
233
Icon invertedImage;
234
public InvertableImageIcon(final Image image) {
235
super(image);
236
}
237
238
@Override
239
public Icon getInvertedIcon() {
240
if (invertedImage != null) return invertedImage;
241
return invertedImage = new IconUIResource(new ImageIcon(AquaUtils.generateLightenedImage(getImage(), 100)));
242
}
243
}
244
245
private static final NamedImageSingleton northArrow = new NamedImageSingleton("NSMenuScrollUp");
246
private static final IconUIResourceSingleton northArrowIcon = new IconUIResourceSingleton(northArrow);
247
private static final NamedImageSingleton southArrow = new NamedImageSingleton("NSMenuScrollDown");
248
private static final IconUIResourceSingleton southArrowIcon = new IconUIResourceSingleton(southArrow);
249
private static final NamedImageSingleton westArrow = new NamedImageSingleton("NSMenuSubmenuLeft");
250
private static final IconUIResourceSingleton westArrowIcon = new IconUIResourceSingleton(westArrow);
251
private static final NamedImageSingleton eastArrow = new NamedImageSingleton("NSMenuSubmenu");
252
private static final IconUIResourceSingleton eastArrowIcon = new IconUIResourceSingleton(eastArrow);
253
254
static Image getArrowImageForDirection(final int direction) {
255
switch(direction) {
256
case SwingConstants.NORTH: return northArrow.get();
257
case SwingConstants.SOUTH: return southArrow.get();
258
case SwingConstants.EAST: return eastArrow.get();
259
case SwingConstants.WEST: return westArrow.get();
260
}
261
return null;
262
}
263
264
static Icon getArrowIconForDirection(int direction) {
265
switch(direction) {
266
case SwingConstants.NORTH: return northArrowIcon.get();
267
case SwingConstants.SOUTH: return southArrowIcon.get();
268
case SwingConstants.EAST: return eastArrowIcon.get();
269
case SwingConstants.WEST: return westArrowIcon.get();
270
}
271
return null;
272
}
273
274
public static Icon getMenuArrowIcon() {
275
return new InvertableImageIcon(AquaUtils.generateLightenedImage(eastArrow.get(), 25));
276
}
277
278
public static Icon getMenuItemCheckIcon() {
279
return new InvertableImageIcon(AquaUtils.generateLightenedImage(
280
getNSIcon("NSMenuItemSelection"), 25));
281
}
282
283
public static Icon getMenuItemDashIcon() {
284
return new InvertableImageIcon(AquaUtils.generateLightenedImage(
285
getNSIcon("NSMenuMixedState"), 25));
286
}
287
288
private static Image getNSIcon(String imageName) {
289
Image icon = Toolkit.getDefaultToolkit()
290
.getImage("NSImage://" + imageName);
291
return icon;
292
}
293
294
public static class NineSliceMetrics {
295
public final int wCut, eCut, nCut, sCut;
296
public final int minW, minH;
297
public final boolean showMiddle, stretchH, stretchV;
298
299
public NineSliceMetrics(final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut) {
300
this(minWidth, minHeight, westCut, eastCut, northCut, southCut, true);
301
}
302
303
public NineSliceMetrics(final int minWidth, final int minHeight, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean showMiddle) {
304
this(minWidth, minHeight, westCut, eastCut, northCut, southCut, showMiddle, true, true);
305
}
306
307
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) {
308
this.wCut = westCut; this.eCut = eastCut; this.nCut = northCut; this.sCut = southCut;
309
this.minW = minWidth; this.minH = minHeight;
310
this.showMiddle = showMiddle; this.stretchH = stretchHorizontally; this.stretchV = stretchVertically;
311
}
312
}
313
314
/*
315
* A "paintable" which holds nine images, which represent a sliced up initial
316
* image that can be streched from its middles.
317
*/
318
public static class SlicedImageControl {
319
final BufferedImage NW, N, NE;
320
final BufferedImage W, C, E;
321
final BufferedImage SW, S, SE;
322
323
final NineSliceMetrics metrics;
324
325
final int totalWidth, totalHeight;
326
final int centerColWidth, centerRowHeight;
327
328
public SlicedImageControl(final Image img, final int westCut, final int eastCut, final int northCut, final int southCut) {
329
this(img, westCut, eastCut, northCut, southCut, true);
330
}
331
332
public SlicedImageControl(final Image img, final int westCut, final int eastCut, final int northCut, final int southCut, final boolean useMiddle) {
333
this(img, westCut, eastCut, northCut, southCut, useMiddle, true, true);
334
}
335
336
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) {
337
this(img, new NineSliceMetrics(img.getWidth(null), img.getHeight(null), westCut, eastCut, northCut, southCut, useMiddle, stretchHorizontally, stretchVertically));
338
}
339
340
public SlicedImageControl(final Image img, final NineSliceMetrics metrics) {
341
this.metrics = metrics;
342
343
if (img.getWidth(null) != metrics.minW || img.getHeight(null) != metrics.minH) {
344
throw new IllegalArgumentException("SlicedImageControl: template image and NineSliceMetrics don't agree on minimum dimensions");
345
}
346
347
totalWidth = metrics.minW;
348
totalHeight = metrics.minH;
349
centerColWidth = totalWidth - metrics.wCut - metrics.eCut;
350
centerRowHeight = totalHeight - metrics.nCut - metrics.sCut;
351
352
NW = createSlice(img, 0, 0, metrics.wCut, metrics.nCut);
353
N = createSlice(img, metrics.wCut, 0, centerColWidth, metrics.nCut);
354
NE = createSlice(img, totalWidth - metrics.eCut, 0, metrics.eCut, metrics.nCut);
355
W = createSlice(img, 0, metrics.nCut, metrics.wCut, centerRowHeight);
356
C = metrics.showMiddle ? createSlice(img, metrics.wCut, metrics.nCut, centerColWidth, centerRowHeight) : null;
357
E = createSlice(img, totalWidth - metrics.eCut, metrics.nCut, metrics.eCut, centerRowHeight);
358
SW = createSlice(img, 0, totalHeight - metrics.sCut, metrics.wCut, metrics.sCut);
359
S = createSlice(img, metrics.wCut, totalHeight - metrics.sCut, centerColWidth, metrics.sCut);
360
SE = createSlice(img, totalWidth - metrics.eCut, totalHeight - metrics.sCut, metrics.eCut, metrics.sCut);
361
}
362
363
static BufferedImage createSlice(final Image img, final int x, final int y, final int w, final int h) {
364
if (w == 0 || h == 0) return null;
365
366
final BufferedImage slice = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
367
final Graphics2D g2d = slice.createGraphics();
368
g2d.drawImage(img, 0, 0, w, h, x, y, x + w, y + h, null);
369
g2d.dispose();
370
371
return slice;
372
}
373
374
public void paint(final Graphics g, final int x, final int y, final int w, final int h) {
375
g.translate(x, y);
376
377
if (w < totalWidth || h < totalHeight) {
378
paintCompressed(g, w, h);
379
} else {
380
paintStretchedMiddles(g, w, h);
381
}
382
383
g.translate(-x, -y);
384
}
385
386
void paintStretchedMiddles(final Graphics g, final int w, final int h) {
387
int baseX = metrics.stretchH ? 0 : ((w / 2) - (totalWidth / 2));
388
int baseY = metrics.stretchV ? 0 : ((h / 2) - (totalHeight / 2));
389
int adjustedWidth = metrics.stretchH ? w : totalWidth;
390
int adjustedHeight = metrics.stretchV ? h : totalHeight;
391
392
if (NW != null) g.drawImage(NW, baseX, baseY, null);
393
if (N != null) g.drawImage(N, baseX + metrics.wCut, baseY, adjustedWidth - metrics.eCut - metrics.wCut, metrics.nCut, null);
394
if (NE != null) g.drawImage(NE, baseX + adjustedWidth - metrics.eCut, baseY, null);
395
if (W != null) g.drawImage(W, baseX, baseY + metrics.nCut, metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut, null);
396
if (C != null) g.drawImage(C, baseX + metrics.wCut, baseY + metrics.nCut, adjustedWidth - metrics.eCut - metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut, null);
397
if (E != null) g.drawImage(E, baseX + adjustedWidth - metrics.eCut, baseY + metrics.nCut, metrics.eCut, adjustedHeight - metrics.nCut - metrics.sCut, null);
398
if (SW != null) g.drawImage(SW, baseX, baseY + adjustedHeight - metrics.sCut, null);
399
if (S != null) g.drawImage(S, baseX + metrics.wCut, baseY + adjustedHeight - metrics.sCut, adjustedWidth - metrics.eCut - metrics.wCut, metrics.sCut, null);
400
if (SE != null) g.drawImage(SE, baseX + adjustedWidth - metrics.eCut, baseY + adjustedHeight - metrics.sCut, null);
401
402
/*
403
if (NW != null) {g.setColor(Color.GREEN); g.fillRect(baseX, baseY, NW.getWidth(), NW.getHeight());}
404
if (N != null) {g.setColor(Color.RED); g.fillRect(baseX + metrics.wCut, baseY, adjustedWidth - metrics.eCut - metrics.wCut, metrics.nCut);}
405
if (NE != null) {g.setColor(Color.BLUE); g.fillRect(baseX + adjustedWidth - metrics.eCut, baseY, NE.getWidth(), NE.getHeight());}
406
if (W != null) {g.setColor(Color.PINK); g.fillRect(baseX, baseY + metrics.nCut, metrics.wCut, adjustedHeight - metrics.nCut - metrics.sCut);}
407
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);}
408
if (E != null) {g.setColor(Color.CYAN); g.fillRect(baseX + adjustedWidth - metrics.eCut, baseY + metrics.nCut, metrics.eCut, adjustedHeight - metrics.nCut - metrics.sCut);}
409
if (SW != null) {g.setColor(Color.MAGENTA); g.fillRect(baseX, baseY + adjustedHeight - metrics.sCut, SW.getWidth(), SW.getHeight());}
410
if (S != null) {g.setColor(Color.DARK_GRAY); g.fillRect(baseX + metrics.wCut, baseY + adjustedHeight - metrics.sCut, adjustedWidth - metrics.eCut - metrics.wCut, metrics.sCut);}
411
if (SE != null) {g.setColor(Color.YELLOW); g.fillRect(baseX + adjustedWidth - metrics.eCut, baseY + adjustedHeight - metrics.sCut, SE.getWidth(), SE.getHeight());}
412
*/
413
}
414
415
void paintCompressed(final Graphics g, final int w, final int h) {
416
final double heightRatio = h > totalHeight ? 1.0 : (double)h / (double)totalHeight;
417
final double widthRatio = w > totalWidth ? 1.0 : (double)w / (double)totalWidth;
418
419
final int northHeight = (int)(metrics.nCut * heightRatio);
420
final int southHeight = (int)(metrics.sCut * heightRatio);
421
final int centerHeight = h - northHeight - southHeight;
422
423
final int westWidth = (int)(metrics.wCut * widthRatio);
424
final int eastWidth = (int)(metrics.eCut * widthRatio);
425
final int centerWidth = w - westWidth - eastWidth;
426
427
if (NW != null) g.drawImage(NW, 0, 0, westWidth, northHeight, null);
428
if (N != null) g.drawImage(N, westWidth, 0, centerWidth, northHeight, null);
429
if (NE != null) g.drawImage(NE, w - eastWidth, 0, eastWidth, northHeight, null);
430
if (W != null) g.drawImage(W, 0, northHeight, westWidth, centerHeight, null);
431
if (C != null) g.drawImage(C, westWidth, northHeight, centerWidth, centerHeight, null);
432
if (E != null) g.drawImage(E, w - eastWidth, northHeight, eastWidth, centerHeight, null);
433
if (SW != null) g.drawImage(SW, 0, h - southHeight, westWidth, southHeight, null);
434
if (S != null) g.drawImage(S, westWidth, h - southHeight, centerWidth, southHeight, null);
435
if (SE != null) g.drawImage(SE, w - eastWidth, h - southHeight, eastWidth, southHeight, null);
436
}
437
}
438
439
public abstract static class RecyclableSlicedImageControl extends RecyclableObject<SlicedImageControl> {
440
final NineSliceMetrics metrics;
441
442
public RecyclableSlicedImageControl(final NineSliceMetrics metrics) {
443
this.metrics = metrics;
444
}
445
446
@Override
447
protected SlicedImageControl create() {
448
return new SlicedImageControl(createTemplateImage(metrics.minW, metrics.minH), metrics);
449
}
450
451
protected abstract Image createTemplateImage(final int width, final int height);
452
}
453
454
// when we use SystemColors, we need to proxy the color with something that implements UIResource,
455
// so that it will be uninstalled when the look and feel is changed.
456
@SuppressWarnings("serial") // JDK implementation class
457
private static class SystemColorProxy extends Color implements UIResource {
458
final Color color;
459
public SystemColorProxy(final Color color) {
460
super(color.getRGB());
461
this.color = color;
462
}
463
464
public int getRGB() {
465
return color.getRGB();
466
}
467
}
468
469
public static Color getWindowBackgroundColorUIResource() {
470
//return AquaNativeResources.getWindowBackgroundColorUIResource();
471
return new SystemColorProxy(SystemColor.window);
472
}
473
474
public static Color getTextSelectionBackgroundColorUIResource() {
475
return new SystemColorProxy(SystemColor.textHighlight);
476
}
477
478
public static Color getTextSelectionForegroundColorUIResource() {
479
return new SystemColorProxy(SystemColor.textHighlightText);
480
}
481
482
public static Color getSelectionBackgroundColorUIResource() {
483
return new SystemColorProxy(SystemColor.controlHighlight);
484
}
485
486
public static Color getSelectionForegroundColorUIResource() {
487
return new SystemColorProxy(SystemColor.controlLtHighlight);
488
}
489
490
public static Color getFocusRingColorUIResource() {
491
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.KEYBOARD_FOCUS_COLOR));
492
}
493
494
public static Color getSelectionInactiveBackgroundColorUIResource() {
495
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_BACKGROUND_COLOR));
496
}
497
498
public static Color getSelectionInactiveForegroundColorUIResource() {
499
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR));
500
}
501
502
public static Color getSelectedControlColorUIResource() {
503
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.SELECTED_CONTROL_TEXT_COLOR));
504
}
505
}
506
507