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 jdk.hotspot.agent.jmod - Hotspot Agent Module
JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module.
JDK 11 Hotspot Agent module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.hotspot.agent.jmod.
JDK 11 Hotspot Agent module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Hotspot Agent module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.hotspot.agent.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/jvm/hotspot/ui/GraphicsUtilities.java
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.jvm.hotspot.ui;
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.util.Random;
import javax.swing.*;
import javax.swing.border.*;
/** Useful utilities for drawing graphics */
public class GraphicsUtilities {
/** Returns a plain-styled 12-point version of the given font, or
null if the font could not be found */
public static Font lookupFont(String fontName) {
Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
Font font = null;
for (int i = 0; i < allFonts.length; i++) {
if (allFonts[i].getFontName().indexOf(fontName) != -1) {
font = allFonts[i];
break;
}
}
if (font == null) {
return null;
}
return font.deriveFont(Font.PLAIN, 12);
}
/** Compute the width and height of given string given the current
font context in the Graphics object */
public static Rectangle2D getStringBounds(String s, Graphics g) {
FontMetrics fm = g.getFontMetrics();
return fm.getStringBounds(s, 0, s.length(), g);
}
/** Compute just the width of the given string with the given
FontMetrics. This is less accurate then getStringBounds(),
above, since the graphics context is not taken into account. */
public static int getStringWidth(String s, FontMetrics fm) {
return fm.stringWidth(s);
}
public static void reshapeToAspectRatio(Component component,
float aspectRatio,
float fillRatio,
Dimension containerDimension) {
int x = containerDimension.width;
int y = containerDimension.height;
int desiredX;
int desiredY;
if (((float) x / (float) y) > aspectRatio) {
desiredY = (int) (fillRatio * y);
desiredX = (int) (desiredY * aspectRatio);
} else {
desiredX = (int) (fillRatio * x);
desiredY = (int) (desiredX / aspectRatio);
}
component.setSize(desiredX, desiredY);
}
public static void constrainToSize(Component component, Dimension containerDimension) {
Dimension d = component.getSize();
int x = d.width;
int y = d.height;
boolean changed = false;
if (x > containerDimension.width) {
x = containerDimension.width;
changed = true;
}
if (y > containerDimension.height) {
y = containerDimension.height;
changed = true;
}
if (changed) {
component.setSize(x, y);
}
}
public static void centerInContainer(Component c) {
centerInContainer(c, c.getParent().getSize());
}
public static void centerInContainer(Component component,
Dimension containerDimension) {
Dimension sz = component.getSize();
int x = ((containerDimension.width - sz.width) / 2);
int y = ((containerDimension.height - sz.height) / 2);
component.setLocation(x, y);
}
public static void moveToInContainer(Component component,
float relativeX,
float relativeY,
int minX,
int minY) {
Dimension d = component.getParent().getSize();
// Move the center of this component to the relative position in
// the parent. Don't clip this component, however.
Dimension sz = component.getSize();
int xPos = Math.min(d.width - sz.width,
(int) ((d.width * relativeX) - (sz.width / 2)));
int yPos = Math.min(d.height - sz.height,
(int) ((d.height * relativeY) - (sz.height / 2)));
xPos = Math.max(xPos, minX);
yPos = Math.max(yPos, minY);
component.setLocation(xPos, yPos);
}
static Random random = new Random();
public static void randomLocation(Component c) {
randomLocation(c, c.getParent().getSize());
}
public static void randomLocation(Component component,
Dimension containerDimension) {
Dimension sz = component.getSize();
int x = (int)((containerDimension.width - sz.width) * random.nextFloat());
int y = (int)((containerDimension.height - sz.height) * random.nextFloat());
component.setLocation(x, y);
}
public static Border newBorder(int size) {
return BorderFactory.createEmptyBorder(size, size, size, size);
}
}
⏎ sun/jvm/hotspot/ui/GraphicsUtilities.java
Or download all of them as a single archive file:
File name: jdk.hotspot.agent-11.0.1-src.zip File size: 1243786 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.httpserver.jmod - HTTP Server Module
2020-02-29, ≈406🔥, 0💬
Popular Posts:
What Is poi-examples-5.2.3.jar? poi-examples-5.2.3.jar is one of the JAR files for Apache POI 5.2.3,...
JDK 11 jdk.scripting.nashorn.jm odis the JMOD file for JDK 11 Scripting Nashorn module. JDK 11 Scrip...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
How to read XML document with DTD validation from socket connections with the socket\DelayedInput.ja.. .
JDK 11 java.smartcardio.jmod is the JMOD file for JDK 11 Smartcardio module. JDK 11 Smart Card IO mo...