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/apple/laf/AquaTextFieldBorder.java

/*
 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package com.apple.laf;

import java.awt.*;

import javax.swing.plaf.*;
import javax.swing.text.JTextComponent;

import apple.laf.JRSUIConstants.*;

import com.apple.laf.AquaUtilControlSize.*;
import com.apple.laf.AquaUtils.*;

public class AquaTextFieldBorder extends AquaBorder {
    private static final RecyclableSingleton<AquaTextFieldBorder> instance = new RecyclableSingletonFromDefaultConstructor<AquaTextFieldBorder>(AquaTextFieldBorder.class);
    public static AquaTextFieldBorder getTextFieldBorder() {
        return instance.get();
    }

    public AquaTextFieldBorder() {
        this(new SizeDescriptor(new SizeVariant().alterMargins(6, 7, 6, 7).alterInsets(3, 3, 3, 3)));
        painter.state.set(Widget.FRAME_TEXT_FIELD);
        painter.state.set(FrameOnly.YES);
        painter.state.set(Size.LARGE);
    }

    public AquaTextFieldBorder(final SizeDescriptor sizeDescriptor) {
        super(sizeDescriptor);
    }

    public AquaTextFieldBorder(final AquaTextFieldBorder other) {
        super(other);
    }

    protected void setSize(final Size size) {
        super.setSize(size);
        painter.state.set(Size.LARGE);
    }

    public void paintBorder(final Component c, final Graphics g, int x, int y, int width, int height) {
//        g.setColor(Color.MAGENTA);
//        g.drawRect(x, y, width - 1, height - 1);

        if (!(c instanceof JTextComponent)) {
            painter.state.set(State.ACTIVE);
            painter.state.set(Focused.NO);
            painter.paint(g, c, x, y, width, height);
            return;
        }

        final JTextComponent jc = (JTextComponent)c;
        final State state = getStateFor(jc);
        painter.state.set(state);
        painter.state.set(State.ACTIVE == state && jc.hasFocus() ? Focused.YES : Focused.NO);

        if (jc.isOpaque()) {
            painter.paint(g, c, x, y, width, height);
            return;
        }

        final int shrinkage = getShrinkageFor(jc, height);
        final Insets subInsets = getSubInsets(shrinkage);
        x += subInsets.left;
        y += subInsets.top;
        width -= (subInsets.left + subInsets.right);
        height -= (subInsets.top + subInsets.bottom);

        if (shrinkage > 0) {
            final Rectangle clipBounds = g.getClipBounds();
            clipBounds.x += shrinkage;
            clipBounds.width -= shrinkage * 2;
            g.setClip(clipBounds);
        }

        painter.paint(g, c, x, y, width, height);
//        g.setColor(Color.ORANGE);
//        g.drawRect(x, y, width - 1, height - 1);
    }

    static int getShrinkageFor(final JTextComponent jc, final int height) {
        if (jc == null) return 0;
        final TextUI ui = jc.getUI();
        if (ui == null) return 0;
        final Dimension size = ui.getPreferredSize(jc);
        if (size == null) return 0;
        final int shrinkage = size.height - height;
        return (shrinkage < 0) ? 0 : (shrinkage > 3) ? 3 : shrinkage;
    }

    // this determines the rect that we should draw inset to our existing bounds
    protected Insets getSubInsets(final int shrinkage) {
        final Insets insets = sizeVariant.insets;

        if (shrinkage > 0) {
            return new InsetsUIResource(insets.top - shrinkage, insets.left, insets.bottom - shrinkage, insets.right);
        }

        return insets;
    }

    public Insets getBorderInsets(final Component c) {
        if (!(c instanceof JTextComponent) || c.isOpaque()) return new InsetsUIResource(3, 7, 3, 7);
        return new InsetsUIResource(5, 5, 5, 5);
    }

    protected static State getStateFor(final JTextComponent jc) {
        if (!AquaFocusHandler.isActive(jc)) {
            return State.INACTIVE;
        }

        if (!jc.isEnabled()) {
            return State.DISABLED;
        }

        if (!jc.isEditable()) {
            return State.DISABLED;
        }

        return State.ACTIVE;
    }
}

com/apple/laf/AquaTextFieldBorder.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

JDK 17 java.datatransfer.jmod - Data Transfer Module

JDK 17 JMod/Module Files

⇑⇑ FAQ for JDK (Java Development Kit) 17

2023-09-16, 33356👍, 0💬