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/sun/java/swing/plaf/motif/MotifScrollBarButton.java
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.java.swing.plaf.motif;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicArrowButton;
/**
* Motif scroll bar button.
*/
@SuppressWarnings("serial") // Superclass is not serializable across versions
public class MotifScrollBarButton extends BasicArrowButton
{
private Color darkShadow = UIManager.getColor("controlShadow");
private Color lightShadow = UIManager.getColor("controlLtHighlight");
public MotifScrollBarButton(int direction)
{
super(direction);
switch (direction) {
case NORTH:
case SOUTH:
case EAST:
case WEST:
this.direction = direction;
break;
default:
throw new IllegalArgumentException("invalid direction");
}
setRequestFocusEnabled(false);
setOpaque(true);
setBackground(UIManager.getColor("ScrollBar.background"));
setForeground(UIManager.getColor("ScrollBar.foreground"));
}
public Dimension getPreferredSize() {
switch (direction) {
case NORTH:
case SOUTH:
return new Dimension(11, 12);
case EAST:
case WEST:
default:
return new Dimension(12, 11);
}
}
public Dimension getMinimumSize() {
return getPreferredSize();
}
public Dimension getMaximumSize() {
return getPreferredSize();
}
public boolean isFocusTraversable() {
return false;
}
public void paint(Graphics g)
{
int w = getWidth();
int h = getHeight();
if (isOpaque()) {
g.setColor(getBackground());
g.fillRect(0, 0, w, h);
}
boolean isPressed = getModel().isPressed();
Color lead = (isPressed) ? darkShadow : lightShadow;
Color trail = (isPressed) ? lightShadow : darkShadow;
Color fill = getBackground();
int cx = w / 2;
int cy = h / 2;
int s = Math.min(w, h);
switch (direction) {
case NORTH:
g.setColor(fill);
g.fillPolygon(new int[]{cx, 0, s - 1}, new int[]{0, s - 1, s - 1}, 3);
g.setColor(trail);
g.drawLine(cx, 0, s - 1, s - 2);
g.drawLine(0, s - 1, s - 1, s - 1);
g.drawLine(s - 1, s - 2, s - 1, s - 1); // corner
g.setColor(lead);
g.drawLine(cx, 0, 0, s - 2);
g.drawLine(cx, 0, cx, 0); // corner
g.drawLine(0, s - 1, 0, s - 1); // corner
break;
case SOUTH:
g.setColor(fill);
g.fillPolygon(new int[]{0, s - 1, cx}, new int[]{1, 1, s}, 3);
g.setColor(trail);
g.drawLine(s - 1, 2, cx, s);
g.drawLine(s - 1, 2, s - 1, 2); // corner
g.setColor(lead);
g.drawLine(0, 2, cx, s);
g.drawLine(0, 1, s - 1, 1);
g.drawLine(0, 1, 0, 2);
g.setColor(trail);
g.drawLine(cx, s, cx, s); // corner
break;
case EAST:
g.setColor(fill);
g.fillPolygon(new int[]{1, s, 1}, new int[]{0, cy, s}, 3);
g.setColor(trail);
g.drawLine(1, s, s, cy);
g.drawLine(2, s, 2, s); // corner
g.setColor(lead);
g.drawLine(1, 0, 1, s);
g.drawLine(2, 0, s, cy);
g.drawLine(2, 0, 2, 0); // corner
g.drawLine(s, cy, s, cy);
break;
case WEST:
g.setColor(fill);
g.fillPolygon(new int[]{0, s - 1, s - 1}, new int[]{cy, 0, s}, 3);
g.drawLine(s - 1, 0, s - 1, s);
g.setColor(trail);
g.drawLine(0, cy, s - 1, s);
g.drawLine(s - 1, 0, s - 1, s);
g.setColor(lead);
g.drawLine(0, cy, s - 2, 0);
g.drawLine(s - 2, 0, s - 1, 0); // corner
g.setColor(trail);
g.drawLine(0, cy, 0, cy); // corner
break;
}
}
}
⏎ com/sun/java/swing/plaf/motif/MotifScrollBarButton.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, ≈421🔥, 0💬
Popular Posts:
Where to get the Java source code for Connector/J 8.0 User Impl module? Java source code files for C...
Where to get the Java source code for Connector/J 8.0 Protocol Impl module? Java source code files f...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar .You can b...
Rhino JavaScript Java Library is an open-source implementation of JavaScript written entirely in Jav...