private void repaintDragRepresentation() { DragSource dragSource = dragDescendant.getDragSource(); Visual dragRepresentation = dragSource.getRepresentation(); if (dragRepresentation != null) { Point dragOffset = dragSource.getOffset(); repaint(dragLocation.x - dragOffset.x, dragLocation.y - dragOffset.y, dragRepresentation.getWidth(), dragRepresentation.getHeight()); } }
private void repaintDragRepresentation() { DragSource dragSource = dragDescendant.getDragSource(); Visual dragRepresentation = dragSource.getRepresentation(); if (dragRepresentation != null) { Point dragOffset = dragSource.getOffset(); repaint(dragLocation.x - dragOffset.x, dragLocation.y - dragOffset.y, dragRepresentation.getWidth(), dragRepresentation.getHeight()); } }
Point dragOffset = dragSource.getOffset(); int tx = dragLocation.x - dragOffset.x; int ty = dragLocation.y - dragOffset.y;
Point dragOffset = dragSource.getOffset(); int tx = dragLocation.x - dragOffset.x; int ty = dragLocation.y - dragOffset.y;
} else { if (dragSource.getRepresentation() != null && dragSource.getOffset() == null) { throw new IllegalStateException("Drag offset is required when a " + " respresentation is specified.");
} else { if (dragSource.getRepresentation() != null && dragSource.getOffset() == null) { throw new IllegalStateException("Drag offset is required when a " + "representation is specified.");