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
⏎ sun/awt/X11/XLabelPeer.java
/*
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.awt.X11;
import java.awt.*;
import java.awt.peer.*;
class XLabelPeer extends XComponentPeer implements LabelPeer {
/**
* Create the label
*/
static final int TEXT_XPAD = 8;
static final int TEXT_YPAD = 6;
String label;
int alignment;
FontMetrics cachedFontMetrics;
Font oldfont;
FontMetrics getFontMetrics()
{
if (cachedFontMetrics != null)
return cachedFontMetrics;
else return getFontMetrics(getPeerFont());
}
void preInit(XCreateWindowParams params) {
super.preInit(params);
Label target = (Label) this.target;
label = target.getText();
if (label == null) {
label = "";
}
alignment = target.getAlignment();
}
XLabelPeer(Label target) {
super(target);
}
/**
* Minimum size.
*/
public Dimension getMinimumSize() {
FontMetrics fm = getFontMetrics();
int w;
try {
w = fm.stringWidth(label);
}
catch (NullPointerException e) {
w = 0;
}
return new Dimension(w + TEXT_XPAD,
fm.getAscent() + fm.getMaxDescent() + TEXT_YPAD);
}
/**
* Paint the label
*/
// NOTE: This method is called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
@Override
void paintPeer(final Graphics g) {
int textX = 0;
int textY = 0;
g.setColor(getPeerBackground());
g.fillRect(0, 0, width, height);
Font f = getPeerFont();
g.setFont(f);
FontMetrics fm = g.getFontMetrics();
if (cachedFontMetrics == null)
{
cachedFontMetrics = fm;
}
else
{
if (oldfont != f)
cachedFontMetrics = fm;
}
switch (alignment) {
case Label.LEFT:
textX = 2;
textY = (height + fm.getMaxAscent() - fm.getMaxDescent()) / 2;
break;
case Label.RIGHT:
textX = width - (fm.stringWidth(label) + 2);
textY = (height + fm.getMaxAscent() - fm.getMaxDescent()) / 2;
break;
case Label.CENTER:
textX = (width - fm.stringWidth(label)) / 2;
textY = (height + fm.getMaxAscent() - fm.getMaxDescent()) / 2;
break;
}
if (isEnabled()) {
g.setColor(getPeerForeground());
g.drawString(label, textX, textY);
}
else {
g.setColor(getPeerBackground().brighter());
g.drawString(label, textX, textY);
g.setColor(getPeerBackground().darker());
g.drawString(label, textX - 1, textY - 1);
}
}
@Override
public void setText(String label) {
if (label == null) {
label = "";
}
if (!label.equals(this.label)) {
this.label = label;
repaint();
}
}
@Override
public void setAlignment(final int alignment) {
if (this.alignment != alignment) {
this.alignment = alignment;
repaint();
}
}
}
⏎ sun/awt/X11/XLabelPeer.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, ≈463🔥, 0💬
Popular Posts:
How to download and install JDK (Java Development Kit) 1.3? If you want to write Java applications, ...
JDK 11 java.sql.jmod is the JMOD file for JDK 11 SQL (Structured Query Language) module. JDK 11 SQL ...
What Is jsse.jar (JDK 6) Java Secure Socket Extension? jsse.jar, Java Secure Socket Extension, is Ja...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...
HttpComponents Client Source Code Files are provided in the source package file, httpcomponents-clie...