author | fyang |
Mon, 04 Nov 2019 16:10:39 +0800 | |
changeset 59307 | fc216dcef2bb |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
4362
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
1 |
/* |
5506 | 2 |
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
4362
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
4 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
8 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
13 |
* accompanied this code). |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
14 |
* |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
18 |
* |
5506 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
4362
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
22 |
*/ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
23 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
24 |
import java.awt.dnd.DragSource; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
25 |
import java.awt.dnd.DnDConstants; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
26 |
import java.awt.dnd.DragGestureEvent; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
27 |
import java.awt.dnd.DragGestureListener; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
28 |
import java.awt.*; |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
29 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
30 |
public class SourcePanel extends Panel |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
31 |
{ |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
32 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
33 |
private final MyDragGestureListener dragGestureListener = |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
34 |
new MyDragGestureListener(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
35 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
36 |
public SourcePanel () { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
37 |
setPreferredSize(new Dimension(200, 200)); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
38 |
DragSource defaultDragSource = |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
39 |
DragSource.getDefaultDragSource(); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
40 |
defaultDragSource.createDefaultDragGestureRecognizer(this, |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
41 |
DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
42 |
setBackground(Color.RED); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
43 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
44 |
|
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
45 |
private class MyDragGestureListener implements DragGestureListener { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
46 |
public void dragGestureRecognized(DragGestureEvent dge) { |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
47 |
dge.startDrag(null, new FileListTransferable()); |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
48 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
49 |
} |
ad915ad8792f
5098433: REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
denis
parents:
diff
changeset
|
50 |
} |