Lines 695-700
Link Here
|
695 |
return false; |
695 |
return false; |
696 |
} |
696 |
} |
697 |
|
697 |
|
|
|
698 |
/** Indicates whether document and non-document top components are about to be mixed |
699 |
* when transfer drops into droppable. |
700 |
*/ |
701 |
static boolean isMixedTCDragDrop(TopComponentDraggable transfer, TopComponentDroppable droppable) { |
702 |
if (transfer != null && droppable != null) { |
703 |
if ((droppable.getKind() == Constants.MODE_KIND_EDITOR |
704 |
&& transfer.getKind() != Constants.MODE_KIND_EDITOR) |
705 |
|| (droppable.getKind() != Constants.MODE_KIND_EDITOR |
706 |
&& transfer.getKind() == Constants.MODE_KIND_EDITOR)) { |
707 |
return true; |
708 |
} |
709 |
} |
710 |
return false; |
711 |
} |
712 |
|
698 |
/** Indicates whether the cursor is around the editor area of the main window. |
713 |
/** Indicates whether the cursor is around the editor area of the main window. |
699 |
* In that case is needed also to provide a drop. */ |
714 |
* In that case is needed also to provide a drop. */ |
700 |
static boolean isNearEditorEdge(Point location, ViewAccessor viewAccessor, int kind) { |
715 |
static boolean isNearEditorEdge(Point location, ViewAccessor viewAccessor, int kind) { |
Lines 1018-1024
Link Here
|
1018 |
&& windowDnDManager.startingTransfer.isUndockingEnabled(); |
1033 |
&& windowDnDManager.startingTransfer.isUndockingEnabled(); |
1019 |
boolean isAroundCenterPanel |
1034 |
boolean isAroundCenterPanel |
1020 |
= isAroundCenterPanel(location); |
1035 |
= isAroundCenterPanel(location); |
1021 |
|
1036 |
boolean isMixedTCDragDrop = isMixedTCDragDrop(windowDnDManager.startingTransfer, windowDnDManager.findDroppableFromScreen(windowDnDManager.getFloatingFrames(), location, windowDnDManager.startingTransfer)); |
|
|
1037 |
|
1022 |
if(isInMainDroppable || isInFrameDroppable || isAroundCenterPanel) { |
1038 |
if(isInMainDroppable || isInFrameDroppable || isAroundCenterPanel) { |
1023 |
TopComponentDroppable droppable |
1039 |
TopComponentDroppable droppable |
1024 |
= windowDnDManager.findDroppableFromScreen(windowDnDManager.getFloatingFrames(), location, windowDnDManager.startingTransfer); |
1040 |
= windowDnDManager.findDroppableFromScreen(windowDnDManager.getFloatingFrames(), location, windowDnDManager.startingTransfer); |
Lines 1027-1035
Link Here
|
1027 |
if (droppable instanceof FreeAreaDroppable) { |
1043 |
if (droppable instanceof FreeAreaDroppable) { |
1028 |
if(WindowManagerImpl.getInstance().getEditorAreaState() == Constants.EDITOR_AREA_SEPARATED |
1044 |
if(WindowManagerImpl.getInstance().getEditorAreaState() == Constants.EDITOR_AREA_SEPARATED |
1029 |
&& droppable.canDrop(windowDnDManager.startingTransfer, location)) { |
1045 |
&& droppable.canDrop(windowDnDManager.startingTransfer, location)) { |
1030 |
topComponentDragSupport.setSuccessCursor(true); |
1046 |
topComponentDragSupport.setSuccessCursor(true, isMixedTCDragDrop); |
1031 |
} else { |
1047 |
} else { |
1032 |
topComponentDragSupport.setUnsuccessCursor(); |
1048 |
topComponentDragSupport.setUnsuccessCursor(isMixedTCDragDrop); |
1033 |
} |
1049 |
} |
1034 |
// for the status bar it's null somehow, workarounding by checking for null.. should go away.. |
1050 |
// for the status bar it's null somehow, workarounding by checking for null.. should go away.. |
1035 |
} else if (droppable != null) { |
1051 |
} else if (droppable != null) { |
Lines 1043-1064
Link Here
|
1043 |
Point p = new Point(location); |
1059 |
Point p = new Point(location); |
1044 |
SwingUtilities.convertPointFromScreen(p, droppable.getDropComponent()); |
1060 |
SwingUtilities.convertPointFromScreen(p, droppable.getDropComponent()); |
1045 |
if(droppable.canDrop(windowDnDManager.startingTransfer, p)) { |
1061 |
if(droppable.canDrop(windowDnDManager.startingTransfer, p)) { |
1046 |
topComponentDragSupport.setSuccessCursor(false); |
1062 |
topComponentDragSupport.setSuccessCursor(false, isMixedTCDragDrop); |
1047 |
} else { |
1063 |
} else { |
1048 |
topComponentDragSupport.setUnsuccessCursor(); |
1064 |
topComponentDragSupport.setUnsuccessCursor(isMixedTCDragDrop); |
1049 |
} |
1065 |
} |
1050 |
dragOverDropTarget(location, droppable); |
1066 |
dragOverDropTarget(location, droppable); |
1051 |
} |
1067 |
} |
1052 |
} else if(!isInMainWindow(location) |
1068 |
} else if(!isInMainWindow(location) |
1053 |
&& windowDnDManager.isInFloatingFrame(location)) { |
1069 |
&& windowDnDManager.isInFloatingFrame(location)) { |
1054 |
// Simulates success drop in free area. |
1070 |
// Simulates success drop in free area. |
1055 |
topComponentDragSupport.setSuccessCursor(false); |
1071 |
topComponentDragSupport.setSuccessCursor(false, isMixedTCDragDrop); |
1056 |
} else if(isInFreeArea(location, fakeWindow) |
1072 |
} else if(isInFreeArea(location, fakeWindow) |
1057 |
&& getFreeAreaDroppable(location).canDrop(windowDnDManager.startingTransfer, location) |
1073 |
&& getFreeAreaDroppable(location).canDrop(windowDnDManager.startingTransfer, location) |
1058 |
&& windowDnDManager.startingTransfer.isUndockingEnabled()) { |
1074 |
&& windowDnDManager.startingTransfer.isUndockingEnabled()) { |
1059 |
topComponentDragSupport.setSuccessCursor(true); |
1075 |
topComponentDragSupport.setSuccessCursor(true, isMixedTCDragDrop); |
1060 |
} else { |
1076 |
} else { |
1061 |
topComponentDragSupport.setUnsuccessCursor(); |
1077 |
topComponentDragSupport.setUnsuccessCursor(isMixedTCDragDrop); |
1062 |
} |
1078 |
} |
1063 |
|
1079 |
|
1064 |
if(!isInMainDroppable && !isInFrameDroppable && !isAroundCenterPanel) { |
1080 |
if(!isInMainDroppable && !isInFrameDroppable && !isAroundCenterPanel) { |
Lines 1193-1198
Link Here
|
1193 |
return transfer.getKind() == Constants.MODE_KIND_VIEW || transfer.getKind() == Constants.MODE_KIND_SLIDING; |
1209 |
return transfer.getKind() == Constants.MODE_KIND_VIEW || transfer.getKind() == Constants.MODE_KIND_SLIDING; |
1194 |
} |
1210 |
} |
1195 |
|
1211 |
|
|
|
1212 |
@Override |
1213 |
public int getKind() { |
1214 |
return Constants.MODE_KIND_VIEW; |
1215 |
} |
1196 |
|
1216 |
|
1197 |
} // End of class CenterPanelDroppable. |
1217 |
} // End of class CenterPanelDroppable. |
1198 |
|
1218 |
|
Lines 1276-1281
Link Here
|
1276 |
return transfer.getKind() == Constants.MODE_KIND_EDITOR; |
1296 |
return transfer.getKind() == Constants.MODE_KIND_EDITOR; |
1277 |
} |
1297 |
} |
1278 |
|
1298 |
|
|
|
1299 |
@Override |
1300 |
public int getKind() { |
1301 |
return Constants.MODE_KIND_EDITOR; |
1302 |
} |
1279 |
|
1303 |
|
1280 |
} // End of class EditorAreaDroppable. |
1304 |
} // End of class EditorAreaDroppable. |
1281 |
|
1305 |
|
Lines 1337-1342
Link Here
|
1337 |
return true; |
1361 |
return true; |
1338 |
} |
1362 |
} |
1339 |
|
1363 |
|
|
|
1364 |
@Override |
1365 |
public int getKind() { |
1366 |
return Constants.MODE_KIND_VIEW; |
1367 |
} |
1368 |
|
1340 |
} // End of class FreeAreaDroppable. |
1369 |
} // End of class FreeAreaDroppable. |
1341 |
|
1370 |
|
1342 |
/** |
1371 |
/** |
Lines 1533-1538
Link Here
|
1533 |
} |
1562 |
} |
1534 |
return rect; |
1563 |
return rect; |
1535 |
} |
1564 |
} |
|
|
1565 |
|
1566 |
@Override |
1567 |
public int getKind() { |
1568 |
return Constants.MODE_KIND_SLIDING; |
1569 |
} |
1536 |
} |
1570 |
} |
1537 |
|
1571 |
|
1538 |
} |
1572 |
} |