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
⏎ com/sun/java/swing/plaf/windows/WindowsTextUI.java
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.sun.java.swing.plaf.windows;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Shape;
import javax.swing.plaf.basic.*;
import javax.swing.*;
import javax.swing.plaf.TextUI;
import javax.swing.plaf.UIResource;
import javax.swing.text.*;
/**
* Windows text rendering.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is appropriate
* for short term storage or RMI between applications running the same
* version of Swing. A future release of Swing will provide support for
* long term persistence.
*/
public abstract class WindowsTextUI extends BasicTextUI {
/**
* Creates the object to use for a caret. By default an
* instance of WindowsCaret is created. This method
* can be redefined to provide something else that implements
* the InputPosition interface or a subclass of DefaultCaret.
*
* @return the caret object
*/
protected Caret createCaret() {
return new WindowsCaret();
}
/* public */
static LayeredHighlighter.LayerPainter WindowsPainter = new WindowsHighlightPainter(null);
/* public */
@SuppressWarnings("serial") // Superclass is not serializable across versions
static class WindowsCaret extends DefaultCaret
implements UIResource {
/**
* Gets the painter for the Highlighter.
*
* @return the painter
*/
protected Highlighter.HighlightPainter getSelectionPainter() {
return WindowsTextUI.WindowsPainter;
}
}
/* public */
static class WindowsHighlightPainter extends
DefaultHighlighter.DefaultHighlightPainter {
WindowsHighlightPainter(Color c) {
super(c);
}
// --- HighlightPainter methods ---------------------------------------
/**
* Paints a highlight.
*
* @param g the graphics context
* @param offs0 the starting model offset >= 0
* @param offs1 the ending model offset >= offs1
* @param bounds the bounding box for the highlight
* @param c the editor
*/
@SuppressWarnings("deprecation")
public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
Rectangle alloc = bounds.getBounds();
try {
// --- determine locations ---
TextUI mapper = c.getUI();
Rectangle p0 = mapper.modelToView(c, offs0);
Rectangle p1 = mapper.modelToView(c, offs1);
// --- render ---
Color color = getColor();
if (color == null) {
g.setColor(c.getSelectionColor());
}
else {
g.setColor(color);
}
boolean firstIsDot = false;
boolean secondIsDot = false;
if (c.isEditable()) {
int dot = c.getCaretPosition();
firstIsDot = (offs0 == dot);
secondIsDot = (offs1 == dot);
}
if (p0.y == p1.y) {
// same line, render a rectangle
Rectangle r = p0.union(p1);
if (r.width > 0) {
if (firstIsDot) {
r.x++;
r.width--;
}
else if (secondIsDot) {
r.width--;
}
}
g.fillRect(r.x, r.y, r.width, r.height);
} else {
// different lines
int p0ToMarginWidth = alloc.x + alloc.width - p0.x;
if (firstIsDot && p0ToMarginWidth > 0) {
p0.x++;
p0ToMarginWidth--;
}
g.fillRect(p0.x, p0.y, p0ToMarginWidth, p0.height);
if ((p0.y + p0.height) != p1.y) {
g.fillRect(alloc.x, p0.y + p0.height, alloc.width,
p1.y - (p0.y + p0.height));
}
if (secondIsDot && p1.x > alloc.x) {
p1.x--;
}
g.fillRect(alloc.x, p1.y, (p1.x - alloc.x), p1.height);
}
} catch (BadLocationException e) {
// can't render
}
}
// --- LayerPainter methods ----------------------------
/**
* Paints a portion of a highlight.
*
* @param g the graphics context
* @param offs0 the starting model offset >= 0
* @param offs1 the ending model offset >= offs1
* @param bounds the bounding box of the view, which is not
* necessarily the region to paint.
* @param c the editor
* @param view View painting for
* @return region drawing occurred in
*/
public Shape paintLayer(Graphics g, int offs0, int offs1,
Shape bounds, JTextComponent c, View view) {
Color color = getColor();
if (color == null) {
g.setColor(c.getSelectionColor());
}
else {
g.setColor(color);
}
boolean firstIsDot = false;
boolean secondIsDot = false;
if (c.isEditable()) {
int dot = c.getCaretPosition();
firstIsDot = (offs0 == dot);
secondIsDot = (offs1 == dot);
}
if (offs0 == view.getStartOffset() &&
offs1 == view.getEndOffset()) {
// Contained in view, can just use bounds.
Rectangle alloc;
if (bounds instanceof Rectangle) {
alloc = (Rectangle)bounds;
}
else {
alloc = bounds.getBounds();
}
if (firstIsDot && alloc.width > 0) {
g.fillRect(alloc.x + 1, alloc.y, alloc.width - 1,
alloc.height);
}
else if (secondIsDot && alloc.width > 0) {
g.fillRect(alloc.x, alloc.y, alloc.width - 1,
alloc.height);
}
else {
g.fillRect(alloc.x, alloc.y, alloc.width, alloc.height);
}
return alloc;
}
else {
// Should only render part of View.
try {
// --- determine locations ---
Shape shape = view.modelToView(offs0, Position.Bias.Forward,
offs1,Position.Bias.Backward,
bounds);
Rectangle r = (shape instanceof Rectangle) ?
(Rectangle)shape : shape.getBounds();
if (firstIsDot && r.width > 0) {
g.fillRect(r.x + 1, r.y, r.width - 1, r.height);
}
else if (secondIsDot && r.width > 0) {
g.fillRect(r.x, r.y, r.width - 1, r.height);
}
else {
g.fillRect(r.x, r.y, r.width, r.height);
}
return r;
} catch (BadLocationException e) {
// can't render
}
}
// Only if exception
return null;
}
}
}
⏎ com/sun/java/swing/plaf/windows/WindowsTextUI.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, ≈453🔥, 5💬
Popular Posts:
What is the jaxp\SourceValidator.jav aprovided in the Apache Xerces package? I have Apache Xerces 2....
What Is log4j-1.2.13.jar? I got the JAR file from logging-log4j-1.2.13.zip .log4j-1.2.13.jar is the ...
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module. JDK 11 Hotspot Agent...
How to download and install JDK (Java Development Kit) 8? If you want to write Java applications, yo...