Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/solaris/classes/sun/awt/X11/XDnDConstants.java
32288 views
/*1* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.awt.X11;2627import java.awt.dnd.DnDConstants;2829/**30* XDnD protocol global constants.31*32* @since 1.533*/34class XDnDConstants {35static final XAtom XA_XdndActionCopy = XAtom.get("XdndActionCopy");36static final XAtom XA_XdndActionMove = XAtom.get("XdndActionMove");37static final XAtom XA_XdndActionLink = XAtom.get("XdndActionLink");38static final XAtom XA_XdndActionList = XAtom.get("XdndActionList");39static final XAtom XA_XdndTypeList = XAtom.get("XdndTypeList");40static final XAtom XA_XdndAware = XAtom.get("XdndAware");41static final XAtom XA_XdndProxy = XAtom.get("XdndProxy");42static final XAtom XA_XdndSelection = XAtom.get("XdndSelection");43static final XAtom XA_XdndEnter = XAtom.get("XdndEnter");44static final XAtom XA_XdndPosition = XAtom.get("XdndPosition");45static final XAtom XA_XdndLeave = XAtom.get("XdndLeave");46static final XAtom XA_XdndDrop = XAtom.get("XdndDrop");47static final XAtom XA_XdndStatus = XAtom.get("XdndStatus");48static final XAtom XA_XdndFinished = XAtom.get("XdndFinished");4950static final XSelection XDnDSelection = new XSelection(XA_XdndSelection);5152public static final int XDND_MIN_PROTOCOL_VERSION = 3;53public static final int XDND_PROTOCOL_VERSION = 5;5455public static final int XDND_PROTOCOL_MASK = 0xFF000000;56public static final int XDND_PROTOCOL_SHIFT = 24;57public static final int XDND_DATA_TYPES_BIT = 0x1;58public static final int XDND_ACCEPT_DROP_FLAG = 0x1;5960private XDnDConstants() {}6162static long getXDnDActionForJavaAction(int javaAction) {63switch (javaAction) {64case DnDConstants.ACTION_COPY : return XA_XdndActionCopy.getAtom();65case DnDConstants.ACTION_MOVE : return XA_XdndActionMove.getAtom();66case DnDConstants.ACTION_LINK : return XA_XdndActionLink.getAtom();67default : return 0;68}69}7071static int getJavaActionForXDnDAction(long xdndAction) {72if (xdndAction == XA_XdndActionCopy.getAtom()) {73return DnDConstants.ACTION_COPY;74} else if (xdndAction == XA_XdndActionMove.getAtom()) {75return DnDConstants.ACTION_MOVE;76} else if (xdndAction == XA_XdndActionLink.getAtom()) {77return DnDConstants.ACTION_LINK;78} else {79return DnDConstants.ACTION_NONE;80}81}82}838485