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 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ javax/swing/plaf/basic/BasicToggleButtonUI.java
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.swing.plaf.basic;
import sun.awt.AppContext;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.plaf.*;
import javax.swing.text.View;
/**
* BasicToggleButton implementation
*
* @author Jeff Dinkins
*/
public class BasicToggleButtonUI extends BasicButtonUI {
private static final Object BASIC_TOGGLE_BUTTON_UI_KEY = new Object();
private static final String propertyPrefix = "ToggleButton" + ".";
// ********************************
// Create PLAF
// ********************************
/**
* Returns an instance of {@code BasicToggleButtonUI}.
*
* @param b a component
* @return an instance of {@code BasicToggleButtonUI}
*/
public static ComponentUI createUI(JComponent b) {
AppContext appContext = AppContext.getAppContext();
BasicToggleButtonUI toggleButtonUI =
(BasicToggleButtonUI) appContext.get(BASIC_TOGGLE_BUTTON_UI_KEY);
if (toggleButtonUI == null) {
toggleButtonUI = new BasicToggleButtonUI();
appContext.put(BASIC_TOGGLE_BUTTON_UI_KEY, toggleButtonUI);
}
return toggleButtonUI;
}
protected String getPropertyPrefix() {
return propertyPrefix;
}
// ********************************
// Paint Methods
// ********************************
public void paint(Graphics g, JComponent c) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
Dimension size = b.getSize();
FontMetrics fm = g.getFontMetrics();
Insets i = c.getInsets();
Rectangle viewRect = new Rectangle(size);
viewRect.x += i.left;
viewRect.y += i.top;
viewRect.width -= (i.right + viewRect.x);
viewRect.height -= (i.bottom + viewRect.y);
Rectangle iconRect = new Rectangle();
Rectangle textRect = new Rectangle();
Font f = c.getFont();
g.setFont(f);
// layout the text and icon
String text = SwingUtilities.layoutCompoundLabel(
c, fm, b.getText(), b.getIcon(),
b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
viewRect, iconRect, textRect,
b.getText() == null ? 0 : b.getIconTextGap());
g.setColor(b.getBackground());
if (model.isArmed() && model.isPressed() || model.isSelected()) {
paintButtonPressed(g,b);
}
// Paint the Icon
if(b.getIcon() != null) {
paintIcon(g, b, iconRect);
}
// Draw the Text
if(text != null && !text.equals("")) {
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, textRect);
} else {
paintText(g, b, textRect, text);
}
}
// draw the dashed focus line.
if (b.isFocusPainted() && b.hasFocus()) {
paintFocus(g, b, viewRect, textRect, iconRect);
}
}
/**
* Paints an icon in the specified location.
*
* @param g an instance of {@code Graphics}
* @param b an instance of {@code Button}
* @param iconRect bounds of an icon
*/
protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect) {
ButtonModel model = b.getModel();
Icon icon = null;
if(!model.isEnabled()) {
if(model.isSelected()) {
icon = b.getDisabledSelectedIcon();
} else {
icon = b.getDisabledIcon();
}
} else if(model.isPressed() && model.isArmed()) {
icon = b.getPressedIcon();
if(icon == null) {
// Use selected icon
icon = b.getSelectedIcon();
}
} else if(model.isSelected()) {
if(b.isRolloverEnabled() && model.isRollover()) {
icon = b.getRolloverSelectedIcon();
if (icon == null) {
icon = b.getSelectedIcon();
}
} else {
icon = b.getSelectedIcon();
}
} else if(b.isRolloverEnabled() && model.isRollover()) {
icon = b.getRolloverIcon();
}
if(icon == null) {
icon = b.getIcon();
}
icon.paintIcon(b, g, iconRect.x, iconRect.y);
}
/**
* Overriden so that the text will not be rendered as shifted for
* Toggle buttons and subclasses.
*/
protected int getTextShiftOffset() {
return 0;
}
}
⏎ javax/swing/plaf/basic/BasicToggleButtonUI.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, ≈888🔥, 5💬
Popular Posts:
JDK 17 java.xml.jmod is the JMOD file for JDK 17 XML (eXtensible Markup Language) module. JDK 17 XML...
JDK 17 jdk.charsets.jmod is the JMOD file for JDK 17 Charsets module. JDK 17 Charsets module compile...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...
JEuclid Source Code Files are provided the JEuclid GitHub Website . You can browse JEuclid Source Co...
What Is poi-scratchpad-5.2.3.jar ?poi-scratchpad-5.2.3.jar is one of the JAR files for Apache POI 5....