int (@NotNull MouseEvent e, boolean cutFullScreen) { Insets insets = getInsets(); int x = insets.left; int y = insets.top; int width = getFullWidth() - insets.left - insets.right; int height = getHeight() - insets.top - insets.bottom; int offset = JBUI.scale(28); int offset2 = offset * 2; int actionOffset = JBUI.scale(8); int actionSize = getActionSize(); int leftActionX = x + actionOffset; int rightActionX = x + width - actionOffset - actionSize; int actionY = y + (height - offset - actionSize) / 2; int mouseX = e.getX(); int mouseY = e.getY(); if (new Rectangle(leftActionX, actionY, actionSize, actionSize).contains(mouseX, mouseY)) { return PrevImage; } if (new Rectangle(rightActionX, actionY, actionSize, actionSize).contains(mouseX, mouseY)) { return NextImage; } if (new Rectangle(x + offset, y, width - offset2, height - offset).contains(mouseX, mouseY)) { if (cutFullScreen && !new Rectangle(x + offset2, y, width - 2 * offset2, height - offset).contains(mouseX, mouseY)) { return None; } return FullScreen; } int count; synchronized (myLock) { if (ContainerUtil.isEmpty(myImages)) { return None; } count = myImages.size(); } if (count < 2) { return None; } int ovalSize = JBUI.scale(myShowFullContent ? 8 : 6); int ovalGap = JBUI.scale(14); int ovalsWidth = count * ovalSize + (count - 1) * ovalGap; int ovalX = x + (width - ovalsWidth) / 2; int ovalY = insets.top + height - (offset + ovalSize) / 2; Rectangle bounds = new Rectangle(ovalX, ovalY, ovalSize, ovalSize); for (int i = 0; i < count; i++) { if (bounds.contains(mouseX, mouseY)) { return i; } bounds.x += ovalSize + ovalGap; } return None; }