Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 java.desktop.jmod - Desktop Module
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.
JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.
JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/apple/laf/AquaComboBoxRendererInternal.java
/*
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.apple.laf;
import sun.swing.SwingUtilities2;
import javax.swing.*;
import java.awt.*;
@SuppressWarnings("serial") // Superclass is not serializable across versions
class AquaComboBoxRendererInternal<E> extends JLabel implements ListCellRenderer<E> {
final JComboBox<?> fComboBox;
boolean fSelected;
boolean fChecked;
boolean fInList;
boolean fEditable;
boolean fDrawCheckedItem = true;
// Provides space for a checkbox, and is translucent
public AquaComboBoxRendererInternal(final JComboBox<?> comboBox) {
super();
fComboBox = comboBox;
}
// Don't include checkIcon space, because this is also used for button size calculations
// - the popup-size calc will get checkIcon space from getInsets
public Dimension getPreferredSize() {
// From BasicComboBoxRenderer - trick to avoid zero-height items
final Dimension size;
final String text = getText();
if (text == null || text.isEmpty()) {
setText(" ");
size = super.getPreferredSize();
setText("");
} else {
size = super.getPreferredSize();
}
return size;
}
// Don't paint the border here, it gets painted by the UI
protected void paintBorder(final Graphics g) {
}
public int getBaseline(int width, int height) {
return super.getBaseline(width, height) - 1;
}
// Really means is the one with the mouse over it
public Component getListCellRendererComponent(final JList<? extends E> list,
final E value, int index,
final boolean isSelected,
final boolean cellHasFocus) {
fInList = (index >= 0); // When the button wants the item painted, it passes in -1
fSelected = isSelected;
if (index < 0) {
index = fComboBox.getSelectedIndex();
}
// changed this to not ask for selected index but directly compare the current item and selected item
// different from basic because basic has no concept of checked, just has the last one selected,
// and the user changes selection. We have selection and a check mark.
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
// See Radar #3141307
// Fix for Radar # 3204287 where we ask for an item at a negative index!
if (index >= 0) {
final Object item = fComboBox.getItemAt(index);
fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem());
} else {
fChecked = false;
}
fEditable = fComboBox.isEditable();
if (isSelected) {
if (fEditable) {
setBackground(UIManager.getColor("List.selectionBackground"));
setForeground(UIManager.getColor("List.selectionForeground"));
} else {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
} else {
if (fEditable) {
setBackground(UIManager.getColor("List.background"));
setForeground(UIManager.getColor("List.foreground"));
} else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
}
setFont(list.getFont());
if (value instanceof Icon) {
setIcon((Icon)value);
} else {
setText((value == null) ? " " : value.toString());
}
return this;
}
public Insets getInsets(Insets insets) {
if (insets == null) insets = new Insets(0, 0, 0, 0);
insets.top = 1;
insets.bottom = 1;
insets.right = 5;
insets.left = (fInList && !fEditable ? 16 + 7 : 5);
return insets;
}
protected void setDrawCheckedItem(final boolean drawCheckedItem) {
this.fDrawCheckedItem = drawCheckedItem;
}
// Paint this component, and a checkbox if it's the selected item and not in the button
protected void paintComponent(final Graphics g) {
if (fInList) {
if (fSelected && !fEditable) {
AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight());
} else {
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
}
if (fChecked && !fEditable && fDrawCheckedItem) {
final int y = getHeight() - 4;
g.setColor(getForeground());
SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y);
}
}
super.paintComponent(g);
}
}
⏎ com/apple/laf/AquaComboBoxRendererInternal.java
Or download all of them as a single archive file:
File name: java.desktop-17.0.5-src.zip File size: 9152233 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.instrument.jmod - Instrument Module
2023-09-16, ≈554🔥, 0💬
Popular Posts:
The JMX technology provides the tools for building distributed, Web-based, modular and dynamic solut...
What Is commons-net-ftp-2.0.jar? commons-net-ftp-2.0.jar is the JAR file for Apache Commons Net FTP ...
HttpComponents Core Source Code Files are provided in the source package file, httpcomponents-core-5...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...