use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.
the class DefaultDropTargetListener method dragOperationChanged.
public void dragOperationChanged(DropTargetEvent event) {
updatePopupPosition(event);
detectPressedKeys(event);
AbstractUIManager uiManager = mapperManager.getUiManager();
DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
if (uiManager.isCtrlPressed()) {
draggingInfosPopup.setOverwriteMode(true);
} else {
draggingInfosPopup.setOverwriteMode(false);
}
if (uiManager.isShiftPressed()) {
draggingInfosPopup.setMapOneToOneMode(true, true);
} else {
draggingInfosPopup.setMapOneToOneMode(false, true);
}
int detail = DND.DROP_NONE;
if (uiManager.isCtrlPressed() && uiManager.isShiftPressed()) {
detail |= DND.DROP_COPY;
} else if (uiManager.isCtrlPressed()) {
detail |= DND.DROP_LINK;
} else if (uiManager.isShiftPressed()) {
detail |= DND.DROP_COPY;
} else {
detail |= DND.DROP_COPY;
}
uiManager.setCurrentDragDetail(detail);
event.detail = DND.DROP_NONE;
}
use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.
the class DefaultDropTargetListener method updatePopupPosition.
private void updatePopupPosition(DropTargetEvent event) {
Point cursorPosition = new Point(event.x, event.y);
if (!cursorPosition.equals(lastCursorPosition)) {
AbstractUIManager uiManager = mapperManager.getUiManager();
DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
draggingInfosPopup.setCursorPosition(event.x, event.y);
}
// System.out.println("updatePopupPosition:" + lastCursorPosition + "-->" + cursorPosition);
lastCursorPosition = cursorPosition;
}
use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.
the class CompleteDropTargetTableListener method updateInsertionIndicator.
/**
*
* DOC amaumont Comment method "updateInsertionIndicator".
*
* @param event
* @return true if droppable
*/
private void updateInsertionIndicator(DropTargetEvent event) {
AbstractUIManager uiManager = mapperManager.getUiManager();
DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
// ////////////////////////////////
// to resolve graphical bug between popupInfos and InsertionIndicator
InsertionIndicator insertionIndicator = retrieveInsertionIndicator();
Rectangle popupBounds = draggingInfosPopup.getBounds();
Point positionPopupFromMapperShellOrigin = draggingInfosPopup.getPositionFromMapperShellOrigin();
Rectangle boundsPopupFromMapperShellOrigin = new Rectangle(positionPopupFromMapperShellOrigin.x, positionPopupFromMapperShellOrigin.y, popupBounds.width, popupBounds.height);
boolean intersect = insertionIndicator.isLeftArrowMustBeRefreshed(boundsPopupFromMapperShellOrigin);
Point eventPosition = new Point(event.x, event.y);
// int itemIndexTarget = getItemIndexWhereInsertFromPosition(eventPosition);
int itemIndexTarget = TableUtils.getItemIndexWhereInsertFromPosition(draggableTargetControl, eventPosition);
insertionIndicator.updatePosition(draggableTargetControl, itemIndexTarget);
if (WindowSystem.isGTK()) {
if (insertionIndicator.isRightArrowVisible() && !eventPosition.equals(lastDragPosition)) {
insertionIndicator.setRightArrowVisible(false);
insertionIndicator.setLefArrowVisible(false);
} else {
insertionIndicator.setRightArrowVisible(insertionIndicator.isVisible());
insertionIndicator.setLefArrowVisible(insertionIndicator.isVisible());
}
} else {
if (isIntersectAtPreviousDragOver || intersect) {
insertionIndicator.setLefArrowVisible(false);
isIntersectAtPreviousDragOver = false;
} else {
insertionIndicator.setLefArrowVisible(insertionIndicator.isVisible());
}
}
isIntersectAtPreviousDragOver = intersect;
lastDragPosition = eventPosition;
}
use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.
the class CompleteDropTargetListener method dragLeave.
@Override
public void dragLeave(DropTargetEvent event) {
// System.out.println("\n>>dragLeave");
// System.out.println(event);
super.dragLeave(event);
DraggedData draggedData = TableEntriesTransfer.getInstance().getDraggedData();
DropContextAnalyzer analyzer = analyzeDropTarget(event, draggedData);
UIManager uiManager = getUiManager();
if (!analyzer.isTableSourceAndTargetAreSame()) {
draggableTable.deselectAll();
}
retrieveInsertionIndicator().setVisible(false);
DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
draggingInfosPopup.setExpressionContext(false);
draggingInfosPopup.setInsertionEntryContext(false);
uiManager.setDragging(false);
}
use of org.talend.designer.abstractmap.ui.dnd.DraggingInfosPopup in project tdi-studio-se by Talend.
the class CompleteDropTargetListener method dragOperationChanged.
@Override
public void dragOperationChanged(DropTargetEvent event) {
// System.out.println("\n>>dragOperationChanged");
// showInfos(event);
// super.dragOperationChanged(event);
DraggedData draggedData = TableEntriesTransfer.getInstance().getDraggedData();
detectPressedKeys(event);
DropContextAnalyzer analyzer = analyzeDropTarget(event, draggedData);
configurePopupInfos(analyzer);
UIManager uiManager = getUiManager();
DraggingInfosPopup draggingInfosPopup = uiManager.getDraggingInfosPopup();
draggingInfosPopup.updateVisibleLabels();
fillEvent(event, analyzer);
getUiManager().setCurrentDragDetail(event.detail);
}
Aggregations