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/plaf/nimbus/State.java
/* * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.swing.plaf.nimbus; import java.util.HashMap; import java.util.Map; import javax.swing.JComponent; import javax.swing.plaf.synth.SynthConstants; /** * <p>Represents a built in, or custom, state in Nimbus.</p> * * <p>Synth provides several built in states, which are: * <ul> * <li>Enabled</li> * <li>Mouse Over</li> * <li>Pressed</li> * <li>Disabled</li> * <li>Focused</li> * <li>Selected</li> * <li>Default</li> * </ul> * * <p>However, there are many more states that could be described in a LookAndFeel, and it * would be nice to style components differently based on these different states. * For example, a progress bar could be "indeterminate". It would be very convenient * to allow this to be defined as a "state".</p> * * <p>This class, State, is intended to be used for such situations. * Simply implement the abstract #isInState method. It returns true if the given * JComponent is "in this state", false otherwise. This method will be called * <em>many</em> times in <em>performance sensitive loops</em>. It must execute * very quickly.</p> * * <p>For example, the following might be an implementation of a custom * "Indeterminate" state for JProgressBars:</p> * * <pre><code> * public final class IndeterminateState extends State<JProgressBar> { * public IndeterminateState() { * super("Indeterminate"); * } * * @Override * protected boolean isInState(JProgressBar c) { * return c.isIndeterminate(); * } * } * </code></pre> */ public abstract class State<T extends JComponent>{ static final Map<String, StandardState> standardStates = new HashMap<String, StandardState>(7); static final State<JComponent> Enabled = new StandardState(SynthConstants.ENABLED); static final State<JComponent> MouseOver = new StandardState(SynthConstants.MOUSE_OVER); static final State<JComponent> Pressed = new StandardState(SynthConstants.PRESSED); static final State<JComponent> Disabled = new StandardState(SynthConstants.DISABLED); static final State<JComponent> Focused = new StandardState(SynthConstants.FOCUSED); static final State<JComponent> Selected = new StandardState(SynthConstants.SELECTED); static final State<JComponent> Default = new StandardState(SynthConstants.DEFAULT); private String name; /** * <p>Create a new custom State. Specify the name for the state. The name should * be unique within the states set for any one particular component. * The name of the state should coincide with the name used in UIDefaults.</p> * * <p>For example, the following would be correct:</p> * <pre><code> * defaults.put("Button.States", "Enabled, Foo, Disabled"); * defaults.put("Button.Foo", new FooState("Foo")); * </code></pre> * * @param name a simple user friendly name for the state, such as "Indeterminate" * or "EmbeddedPanel" or "Blurred". It is customary to use camel case, * with the first letter capitalized. */ protected State(String name) { this.name = name; } @Override public String toString() { return name; } /** * <p>This is the main entry point, called by NimbusStyle.</p> * * <p>There are both custom states and standard states. Standard states * correlate to the states defined in SynthConstants. When a UI delegate * constructs a SynthContext, it specifies the state that the component is * in according to the states defined in SynthConstants. Our NimbusStyle * will then take this state, and query each State instance in the style * asking whether isInState(c, s).</p> * * <p>Now, only the standard states care about the "s" param. So we have * this odd arrangement:</p> * <ul> * <li>NimbusStyle calls State.isInState(c, s)</li> * <li>State.isInState(c, s) simply delegates to State.isInState(c)</li> * <li><em>EXCEPT</em>, StandardState overrides State.isInState(c, s) and * returns directly from that method after checking its state, and * does not call isInState(c) (since it is not needed for standard states).</li> * </ul> */ boolean isInState(T c, int s) { return isInState(c); } /** * <p>Gets whether the specified JComponent is in the custom state represented * by this class. <em>This is an extremely performance sensitive loop.</em> * Please take proper precautions to ensure that it executes quickly.</p> * * <p>Nimbus uses this method to help determine what state a JComponent is * in. For example, a custom State could exist for JProgressBar such that * it would return <code>true</code> when the progress bar is indeterminate. * Such an implementation of this method would simply be:</p> * * <pre><code> return c.isIndeterminate();</code></pre> * * @param c the JComponent to test. This will never be null. * @return true if <code>c</code> is in the custom state represented by * this <code>State</code> instance */ protected abstract boolean isInState(T c); String getName() { return name; } static boolean isStandardStateName(String name) { return standardStates.containsKey(name); } static StandardState getStandardState(String name) { return standardStates.get(name); } static final class StandardState extends State<JComponent> { private int state; private StandardState(int state) { super(toString(state)); this.state = state; standardStates.put(getName(), this); } public int getState() { return state; } @Override boolean isInState(JComponent c, int s) { return (s & state) == state; } @Override protected boolean isInState(JComponent c) { throw new AssertionError("This method should never be called"); } private static String toString(int state) { StringBuilder sb = new StringBuilder(); if ((state & SynthConstants.DEFAULT) == SynthConstants.DEFAULT) { sb.append("Default"); } if ((state & SynthConstants.DISABLED) == SynthConstants.DISABLED) { if (sb.length() > 0) sb.append("+"); sb.append("Disabled"); } if ((state & SynthConstants.ENABLED) == SynthConstants.ENABLED) { if (sb.length() > 0) sb.append("+"); sb.append("Enabled"); } if ((state & SynthConstants.FOCUSED) == SynthConstants.FOCUSED) { if (sb.length() > 0) sb.append("+"); sb.append("Focused"); } if ((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) { if (sb.length() > 0) sb.append("+"); sb.append("MouseOver"); } if ((state & SynthConstants.PRESSED) == SynthConstants.PRESSED) { if (sb.length() > 0) sb.append("+"); sb.append("Pressed"); } if ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED) { if (sb.length() > 0) sb.append("+"); sb.append("Selected"); } return sb.toString(); } } }
⏎ javax/swing/plaf/nimbus/State.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, 196866👍, 5💬
Popular Posts:
How to read XML document from socket connections with the socket\DelayedInput.java provided in the A...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
What Is poi-ooxml-3.5.jar? poi-ooxml-3.5.jar is one of the JAR files for Apache POI 3.5, which provi...