|
|
@ -90,29 +90,31 @@ public class CellHintPopupListener<T extends JComponent, I> extends MouseInputAd |
|
|
|
final boolean isEditing = cellContainer.isEditingCell(index); |
|
|
|
final boolean isEditing = cellContainer.isEditingCell(index); |
|
|
|
final Rectangle allocation = cellContainer.getAllocation(); |
|
|
|
final Rectangle allocation = cellContainer.getAllocation(); |
|
|
|
final Rectangle cellBounds = cellContainer.getCellBoundsAt(index, isEditing); |
|
|
|
final Rectangle cellBounds = cellContainer.getCellBoundsAt(index, isEditing); |
|
|
|
final Rectangle visibleBounds = allocation.intersection(cellBounds); |
|
|
|
if (cellBounds != null && allocation != null) { |
|
|
|
if (visibleBounds.contains(p)) { |
|
|
|
final Rectangle visibleBounds = allocation.intersection(cellBounds); |
|
|
|
final Component comp = cellContainer.getEffectiveCellRendererComponent(index, isEditing); |
|
|
|
if (visibleBounds.contains(p)) { |
|
|
|
final Dimension prefSize = isEditing |
|
|
|
final Component comp = cellContainer.getEffectiveCellRendererComponent(index, isEditing); |
|
|
|
? comp.getBounds().getSize() |
|
|
|
final Dimension prefSize = isEditing |
|
|
|
: comp.getPreferredSize(); |
|
|
|
? comp.getBounds().getSize() |
|
|
|
if (!(visibleBounds.width >= prefSize.width && visibleBounds.height >= prefSize.height)) { |
|
|
|
: comp.getPreferredSize(); |
|
|
|
Point popupLocation = cellContainer.getComponent().getLocationOnScreen(); |
|
|
|
if (!(visibleBounds.width >= prefSize.width && visibleBounds.height >= prefSize.height)) { |
|
|
|
Rectangle rect = calculatePopupBounds(cellBounds, visibleBounds, !isEditing); |
|
|
|
Point popupLocation = cellContainer.getComponent().getLocationOnScreen(); |
|
|
|
if (!visibleBounds.contains(rect)) { |
|
|
|
Rectangle rect = calculatePopupBounds(cellBounds, visibleBounds, !isEditing); |
|
|
|
cellBounds.x = rect.x - cellBounds.x; |
|
|
|
if (!visibleBounds.contains(rect)) { |
|
|
|
cellBounds.y = rect.y - cellBounds.y; |
|
|
|
cellBounds.x = rect.x - cellBounds.x; |
|
|
|
rect.x += popupLocation.x; |
|
|
|
cellBounds.y = rect.y - cellBounds.y; |
|
|
|
rect.y += popupLocation.y; |
|
|
|
rect.x += popupLocation.x; |
|
|
|
enter(index, rect, cellBounds); |
|
|
|
rect.y += popupLocation.y; |
|
|
|
return; |
|
|
|
enter(index, rect, cellBounds); |
|
|
|
} else { |
|
|
|
return; |
|
|
|
lastIndex = index; |
|
|
|
} else { |
|
|
|
|
|
|
|
lastIndex = index; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
lastIndex = null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
lastIndex = null; |
|
|
|
leave(); |
|
|
|
leave(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|