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/basic/BasicTransferable.java
/* * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.swing.plaf.basic; import sun.datatransfer.DataFlavorUtil; import java.io.*; import java.awt.datatransfer.*; import javax.swing.plaf.UIResource; /** * A transferable implementation for the default data transfer of some Swing * components. * * @author Timothy Prinzing */ class BasicTransferable implements Transferable, UIResource { protected String plainData; protected String htmlData; private static DataFlavor[] htmlFlavors; private static DataFlavor[] stringFlavors; private static DataFlavor[] plainFlavors; static { try { htmlFlavors = new DataFlavor[3]; htmlFlavors[0] = new DataFlavor("text/html;class=java.lang.String"); htmlFlavors[1] = new DataFlavor("text/html;class=java.io.Reader"); htmlFlavors[2] = new DataFlavor("text/html;charset=unicode;class=java.io.InputStream"); plainFlavors = new DataFlavor[3]; plainFlavors[0] = new DataFlavor("text/plain;class=java.lang.String"); plainFlavors[1] = new DataFlavor("text/plain;class=java.io.Reader"); plainFlavors[2] = new DataFlavor("text/plain;charset=unicode;class=java.io.InputStream"); stringFlavors = new DataFlavor[2]; stringFlavors[0] = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType+";class=java.lang.String"); stringFlavors[1] = DataFlavor.stringFlavor; } catch (ClassNotFoundException cle) { System.err.println("error initializing javax.swing.plaf.basic.BasicTranserable"); } } public BasicTransferable(String plainData, String htmlData) { this.plainData = plainData; this.htmlData = htmlData; } /** * Returns an array of DataFlavor objects indicating the flavors the data * can be provided in. The array should be ordered according to preference * for providing the data (from most richly descriptive to least descriptive). * @return an array of data flavors in which this data can be transferred */ public DataFlavor[] getTransferDataFlavors() { DataFlavor[] richerFlavors = getRicherFlavors(); int nRicher = (richerFlavors != null) ? richerFlavors.length : 0; int nHTML = (isHTMLSupported()) ? htmlFlavors.length : 0; int nPlain = (isPlainSupported()) ? plainFlavors.length: 0; int nString = (isPlainSupported()) ? stringFlavors.length : 0; int nFlavors = nRicher + nHTML + nPlain + nString; DataFlavor[] flavors = new DataFlavor[nFlavors]; // fill in the array int nDone = 0; if (nRicher > 0) { System.arraycopy(richerFlavors, 0, flavors, nDone, nRicher); nDone += nRicher; } if (nHTML > 0) { System.arraycopy(htmlFlavors, 0, flavors, nDone, nHTML); nDone += nHTML; } if (nPlain > 0) { System.arraycopy(plainFlavors, 0, flavors, nDone, nPlain); nDone += nPlain; } if (nString > 0) { System.arraycopy(stringFlavors, 0, flavors, nDone, nString); nDone += nString; } return flavors; } /** * Returns whether or not the specified data flavor is supported for * this object. * @param flavor the requested flavor for the data * @return boolean indicating whether or not the data flavor is supported */ public boolean isDataFlavorSupported(DataFlavor flavor) { DataFlavor[] flavors = getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (flavors[i].equals(flavor)) { return true; } } return false; } /** * Returns an object which represents the data to be transferred. The class * of the object returned is defined by the representation class of the flavor. * * @param flavor the requested flavor for the data * @see DataFlavor#getRepresentationClass * @exception IOException if the data is no longer available * in the requested flavor. * @exception UnsupportedFlavorException if the requested data flavor is * not supported. */ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { DataFlavor[] richerFlavors = getRicherFlavors(); if (isRicherFlavor(flavor)) { return getRicherData(flavor); } else if (isHTMLFlavor(flavor)) { String data = getHTMLData(); data = (data == null) ? "" : data; if (String.class.equals(flavor.getRepresentationClass())) { return data; } else if (Reader.class.equals(flavor.getRepresentationClass())) { return new StringReader(data); } else if (InputStream.class.equals(flavor.getRepresentationClass())) { return createInputStream(flavor, data); } // fall through to unsupported } else if (isPlainFlavor(flavor)) { String data = getPlainData(); data = (data == null) ? "" : data; if (String.class.equals(flavor.getRepresentationClass())) { return data; } else if (Reader.class.equals(flavor.getRepresentationClass())) { return new StringReader(data); } else if (InputStream.class.equals(flavor.getRepresentationClass())) { return createInputStream(flavor, data); } // fall through to unsupported } else if (isStringFlavor(flavor)) { String data = getPlainData(); data = (data == null) ? "" : data; return data; } throw new UnsupportedFlavorException(flavor); } private InputStream createInputStream(DataFlavor flavor, String data) throws IOException, UnsupportedFlavorException { String cs = DataFlavorUtil.getTextCharset(flavor); if (cs == null) { throw new UnsupportedFlavorException(flavor); } return new ByteArrayInputStream(data.getBytes(cs)); } // --- richer subclass flavors ---------------------------------------------- protected boolean isRicherFlavor(DataFlavor flavor) { DataFlavor[] richerFlavors = getRicherFlavors(); int nFlavors = (richerFlavors != null) ? richerFlavors.length : 0; for (int i = 0; i < nFlavors; i++) { if (richerFlavors[i].equals(flavor)) { return true; } } return false; } /** * Some subclasses will have flavors that are more descriptive than HTML * or plain text. If this method returns a non-null value, it will be * placed at the start of the array of supported flavors. */ protected DataFlavor[] getRicherFlavors() { return null; } protected Object getRicherData(DataFlavor flavor) throws UnsupportedFlavorException { return null; } // --- html flavors ---------------------------------------------------------- /** * Returns whether or not the specified data flavor is an HTML flavor that * is supported. * @param flavor the requested flavor for the data * @return boolean indicating whether or not the data flavor is supported */ protected boolean isHTMLFlavor(DataFlavor flavor) { DataFlavor[] flavors = htmlFlavors; for (int i = 0; i < flavors.length; i++) { if (flavors[i].equals(flavor)) { return true; } } return false; } /** * Should the HTML flavors be offered? If so, the method * getHTMLData should be implemented to provide something reasonable. */ protected boolean isHTMLSupported() { return htmlData != null; } /** * Fetch the data in a text/html format */ protected String getHTMLData() { return htmlData; } // --- plain text flavors ---------------------------------------------------- /** * Returns whether or not the specified data flavor is an plain flavor that * is supported. * @param flavor the requested flavor for the data * @return boolean indicating whether or not the data flavor is supported */ protected boolean isPlainFlavor(DataFlavor flavor) { DataFlavor[] flavors = plainFlavors; for (int i = 0; i < flavors.length; i++) { if (flavors[i].equals(flavor)) { return true; } } return false; } /** * Should the plain text flavors be offered? If so, the method * getPlainData should be implemented to provide something reasonable. */ protected boolean isPlainSupported() { return plainData != null; } /** * Fetch the data in a text/plain format. */ protected String getPlainData() { return plainData; } // --- string flavorss -------------------------------------------------------- /** * Returns whether or not the specified data flavor is a String flavor that * is supported. * @param flavor the requested flavor for the data * @return boolean indicating whether or not the data flavor is supported */ protected boolean isStringFlavor(DataFlavor flavor) { DataFlavor[] flavors = stringFlavors; for (int i = 0; i < flavors.length; i++) { if (flavors[i].equals(flavor)) { return true; } } return false; } }
⏎ javax/swing/plaf/basic/BasicTransferable.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, 195328👍, 5💬
Popular Posts:
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...
What is ojdbc.jar - JDBC Driver for Oracle? ojdbc.jar is a JDBC driver from Oracle that provides dat...
What Is XMLBeans xbean.jar 2.6.0? XMLBeans xbean.jar 2.6.0 is the JAR file for Apache XMLBeans 2.6.0...
JDK 11 jdk.dynalink.jmod is the JMOD file for JDK 11 Dynamic Linking module. JDK 11 Dynamic Linking ...