Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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/text/GlyphPainter1.java
/* * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.swing.text; import java.awt.*; /** * A class to perform rendering of the glyphs. * This can be implemented to be stateless, or * to hold some information as a cache to * facilitate faster rendering and model/view * translation. At a minimum, the GlyphPainter * allows a View implementation to perform its * duties independent of a particular version * of JVM and selection of capabilities (i.e. * shaping for i18n, etc). * <p> * This implementation is intended for operation * under the JDK1.1 API of the Java Platform. * Since the JDK is backward compatible with * JDK1.1 API, this class will also function on * Java 2. The JDK introduces improved * API for rendering text however, so the GlyphPainter2 * is recommended for the DK. * * @author Timothy Prinzing * @see GlyphView */ class GlyphPainter1 extends GlyphView.GlyphPainter { /** * Determine the span the glyphs given a start location * (for tab expansion). */ public float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x) { sync(v); Segment text = v.getText(p0, p1); int[] justificationData = getJustificationData(v); int width = Utilities.getTabbedTextWidth(v, text, metrics, (int)x, e, p0, justificationData); SegmentCache.releaseSharedSegment(text); return width; } public float getHeight(GlyphView v) { sync(v); return metrics.getHeight(); } /** * Fetches the ascent above the baseline for the glyphs * corresponding to the given range in the model. */ public float getAscent(GlyphView v) { sync(v); return metrics.getAscent(); } /** * Fetches the descent below the baseline for the glyphs * corresponding to the given range in the model. */ public float getDescent(GlyphView v) { sync(v); return metrics.getDescent(); } /** * Paints the glyphs representing the given range. */ public void paint(GlyphView v, Graphics g, Shape a, int p0, int p1) { sync(v); Segment text; TabExpander expander = v.getTabExpander(); Rectangle alloc = (a instanceof Rectangle) ? (Rectangle)a : a.getBounds(); // determine the x coordinate to render the glyphs float x = alloc.x; int p = v.getStartOffset(); int[] justificationData = getJustificationData(v); if (p != p0) { text = v.getText(p, p0); float width = Utilities.getTabbedTextWidth(v, text, metrics, x, expander, p, justificationData); x += width; SegmentCache.releaseSharedSegment(text); } // determine the y coordinate to render the glyphs float y = alloc.y + metrics.getHeight() - metrics.getDescent(); // render the glyphs text = v.getText(p0, p1); g.setFont(metrics.getFont()); Utilities.drawTabbedText(v, text, x, y, g, expander,p0, justificationData, true); SegmentCache.releaseSharedSegment(text); } public Shape modelToView(GlyphView v, int pos, Position.Bias bias, Shape a) throws BadLocationException { sync(v); Rectangle alloc = (a instanceof Rectangle) ? (Rectangle)a : a.getBounds(); int p0 = v.getStartOffset(); int p1 = v.getEndOffset(); TabExpander expander = v.getTabExpander(); Segment text; if(pos == p1) { // The caller of this is left to right and borders a right to // left view, return our end location. return new Rectangle(alloc.x + alloc.width, alloc.y, 0, metrics.getHeight()); } if ((pos >= p0) && (pos <= p1)) { // determine range to the left of the position text = v.getText(p0, pos); int[] justificationData = getJustificationData(v); int width = Utilities.getTabbedTextWidth(v, text, metrics, alloc.x, expander, p0, justificationData); SegmentCache.releaseSharedSegment(text); return new Rectangle(alloc.x + width, alloc.y, 0, metrics.getHeight()); } throw new BadLocationException("modelToView - can't convert", p1); } /** * Provides a mapping from the view coordinate space to the logical * coordinate space of the model. * * @param v the view containing the view coordinates * @param x the X coordinate * @param y the Y coordinate * @param a the allocated region to render into * @param biasReturn always returns <code>Position.Bias.Forward</code> * as the zero-th element of this array * @return the location within the model that best represents the * given point in the view * @see View#viewToModel */ public int viewToModel(GlyphView v, float x, float y, Shape a, Position.Bias[] biasReturn) { sync(v); Rectangle alloc = (a instanceof Rectangle) ? (Rectangle)a : a.getBounds(); int p0 = v.getStartOffset(); int p1 = v.getEndOffset(); TabExpander expander = v.getTabExpander(); Segment text = v.getText(p0, p1); int[] justificationData = getJustificationData(v); int offs = Utilities.getTabbedTextOffset(v, text, metrics, alloc.x, (int) x, expander, p0, justificationData); SegmentCache.releaseSharedSegment(text); int retValue = p0 + offs; if(retValue == p1) { // No need to return backward bias as GlyphPainter1 is used for // ltr text only. retValue--; } biasReturn[0] = Position.Bias.Forward; return retValue; } /** * Determines the best location (in the model) to break * the given view. * This method attempts to break on a whitespace * location. If a whitespace location can't be found, the * nearest character location is returned. * * @param v the view * @param p0 the location in the model where the * fragment should start its representation >= 0 * @param x the graphic location along the axis that the * broken view would occupy >= 0; this may be useful for * things like tab calculations * @param len specifies the distance into the view * where a potential break is desired >= 0 * @return the model location desired for a break * @see View#breakView */ public int getBoundedPosition(GlyphView v, int p0, float x, float len) { sync(v); TabExpander expander = v.getTabExpander(); Segment s = v.getText(p0, v.getEndOffset()); int[] justificationData = getJustificationData(v); int index = Utilities.getTabbedTextOffset(v, s, metrics, x, (x+len), expander, p0, false, justificationData, true); SegmentCache.releaseSharedSegment(s); int p1 = p0 + index; return p1; } @SuppressWarnings("deprecation") void sync(GlyphView v) { Font f = v.getFont(); FontMetrics fm = null; Container c = v.getContainer(); if (c != null) { fm = c.getFontMetrics(f); } if ((metrics == null) || (! f.equals(metrics.getFont())) || (! metrics.equals(fm))) { // fetch a new FontMetrics metrics = (c != null) ? fm : Toolkit.getDefaultToolkit().getFontMetrics(f); } } /** * @return justificationData from the ParagraphRow this GlyphView * is in or {@code null} if no justification is needed */ private int[] getJustificationData(GlyphView v) { View parent = v.getParent(); int [] ret = null; if (parent instanceof ParagraphView.Row) { ParagraphView.Row row = ((ParagraphView.Row) parent); ret = row.justificationData; } return ret; } // --- variables --------------------------------------------- FontMetrics metrics; }
⏎ javax/swing/text/GlyphPainter1.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, 196843👍, 5💬
Popular Posts:
What is jxl.jar 2.6.12? jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java li...
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.1? The if you...
How to download and install ojdbc14.jar for Oracle 10g R2? ojdbc14.jar for Oracle 10g R2 is a Java 1...
How to download and install ojdbc5.jar for Oracle 11g R1? ojdbc5.jar for Oracle 11g R1 is a Java 5 J...
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...