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

apple/laf/JRSUIState.java

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

package apple.laf;

import apple.laf.JRSUIConstants.*;

@SuppressWarnings("unchecked")
public class JRSUIState {
//    static HashSet<JRSUIState> states = new HashSet<JRSUIState>();

    final long encodedState;
    long derivedEncodedState;

    static JRSUIState prototype = new JRSUIState(0);
    public static JRSUIState getInstance() {
        return prototype.derive();
    }

    JRSUIState(final Widget widget) {
        this(widget.apply(0));
    }

    JRSUIState(final long encodedState) {
        this.encodedState = derivedEncodedState = encodedState;
    }

    boolean isDerivationSame() {
        return encodedState == derivedEncodedState;
    }

    public <T extends JRSUIState> T derive() {
        if (isDerivationSame()) return (T)this;
        final T derivation = (T)createDerivation();

//        if (!states.add(derivation)) {
//            System.out.println("dupe: " + states.size());
//        }

        return derivation;
    }

    public <T extends JRSUIState> T createDerivation() {
        return (T)new JRSUIState(derivedEncodedState);
    }

    public void reset() {
        derivedEncodedState = encodedState;
    }

    public void set(final Property property) {
        derivedEncodedState = property.apply(derivedEncodedState);
    }

    public void apply(final JRSUIControl control) {
        control.setEncodedState(encodedState);
    }

    @Override
    public boolean equals(final Object obj) {
        if (!(obj instanceof JRSUIState)) return false;
        return encodedState == ((JRSUIState)obj).encodedState && getClass().equals(obj.getClass());
    }

    public boolean is(Property property) {
        return (byte)((derivedEncodedState & property.encoding.mask) >> property.encoding.shift) == property.ordinal;
    }

    @Override
    public int hashCode() {
        return (int)(encodedState ^ (encodedState >>> 32)) ^ getClass().hashCode();
    }

    public static class AnimationFrameState extends JRSUIState {
        final int animationFrame;
        int derivedAnimationFrame;

        AnimationFrameState(final long encodedState, final int animationFrame) {
            super(encodedState);
            this.animationFrame = derivedAnimationFrame = animationFrame;
        }

        @Override
        boolean isDerivationSame() {
            return super.isDerivationSame() && (animationFrame == derivedAnimationFrame);
        }

        @Override
        public <T extends JRSUIState> T createDerivation() {
            return (T)new AnimationFrameState(derivedEncodedState, derivedAnimationFrame);
        }

        @Override
        public void reset() {
            super.reset();
            derivedAnimationFrame = animationFrame;
        }

        public void setAnimationFrame(final int frame) {
            this.derivedAnimationFrame = frame;
        }

        @Override
        public void apply(final JRSUIControl control) {
            super.apply(control);
            control.set(Key.ANIMATION_FRAME, animationFrame);
        }

        @Override
        public boolean equals(final Object obj) {
            if (!(obj instanceof AnimationFrameState)) return false;
            return animationFrame == ((AnimationFrameState)obj).animationFrame && super.equals(obj);
        }

        @Override
        public int hashCode() {
            return super.hashCode() ^ animationFrame;
        }
    }

    public static class ValueState extends JRSUIState {
        final double value;
        double derivedValue;

        ValueState(final long encodedState, final double value) {
            super(encodedState);
            this.value = derivedValue = value;
        }

        @Override
        boolean isDerivationSame() {
            return super.isDerivationSame() && (value == derivedValue);
        }

        @Override
        public <T extends JRSUIState> T createDerivation() {
            return (T)new ValueState(derivedEncodedState, derivedValue);
        }

        @Override
        public void reset() {
            super.reset();
            derivedValue = value;
        }

        public void setValue(final double value) {
            derivedValue = value;
        }

        @Override
        public void apply(final JRSUIControl control) {
            super.apply(control);
            control.set(Key.VALUE, value);
        }

        @Override
        public boolean equals(final Object obj) {
            if (!(obj instanceof ValueState)) return false;
            return value == ((ValueState)obj).value && super.equals(obj);
        }

        @Override
        public int hashCode() {
            final long bits = Double.doubleToRawLongBits(value);
            return super.hashCode() ^ (int)bits ^ (int)(bits >>> 32);
        }
    }

    public static class TitleBarHeightState extends ValueState {
        TitleBarHeightState(final long encodedState, final double value) {
            super(encodedState, value);
        }

        @Override
        public <T extends JRSUIState> T createDerivation() {
            return (T)new TitleBarHeightState(derivedEncodedState, derivedValue);
        }

        @Override
        public void apply(final JRSUIControl control) {
            super.apply(control);
            control.set(Key.WINDOW_TITLE_BAR_HEIGHT, value);
        }
    }

    public static class ScrollBarState extends ValueState {
        final double thumbProportion;
        double derivedThumbProportion;
        final double thumbStart;
        double derivedThumbStart;

        ScrollBarState(final long encodedState, final double value, final double thumbProportion, final double thumbStart) {
            super(encodedState, value);
            this.thumbProportion = derivedThumbProportion = thumbProportion;
            this.thumbStart = derivedThumbStart = thumbStart;
        }

        @Override
        boolean isDerivationSame() {
            return super.isDerivationSame() && (thumbProportion == derivedThumbProportion) && (thumbStart == derivedThumbStart);
        }

        @Override
        public <T extends JRSUIState> T createDerivation() {
            return (T)new ScrollBarState(derivedEncodedState, derivedValue, derivedThumbProportion, derivedThumbStart);
        }

        @Override
        public void reset() {
            super.reset();
            derivedThumbProportion = thumbProportion;
            derivedThumbStart = thumbStart;
        }

        public void setThumbPercent(final double thumbPercent) {
            derivedThumbProportion = thumbPercent;
        }

        public void setThumbStart(final double thumbStart) {
            derivedThumbStart = thumbStart;
        }

        @Override
        public void apply(final JRSUIControl control) {
            super.apply(control);
            control.set(Key.THUMB_PROPORTION, thumbProportion);
            control.set(Key.THUMB_START, thumbStart);
        }

        @Override
        public boolean equals(final Object obj) {
            if (!(obj instanceof ScrollBarState)) return false;
            return (thumbProportion == ((ScrollBarState)obj).thumbProportion) && (thumbStart == ((ScrollBarState)obj).thumbStart) && super.equals(obj);
        }

        @Override
        public int hashCode() {
            final long bits = Double.doubleToRawLongBits(thumbProportion) ^ Double.doubleToRawLongBits(thumbStart);
            return super.hashCode() ^ (int)bits ^ (int)(bits >>> 32);
        }
    }
}

apple/laf/JRSUIState.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, 30971👍, 0💬