mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
5677 attempts to reduce cyclomatic complexity
This commit is contained in:
parent
495682ca79
commit
5efe34235c
@ -175,9 +175,9 @@ public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellR
|
|||||||
public String getToolTipText(MouseEvent event) {
|
public String getToolTipText(MouseEvent event) {
|
||||||
if (event != null) {
|
if (event != null) {
|
||||||
//gets tooltip of internal panel item mouse is over
|
//gets tooltip of internal panel item mouse is over
|
||||||
Point p = event.getPoint();
|
Point point = event.getPoint();
|
||||||
for (Component comp : getComponents()) {
|
for (Component comp : getComponents()) {
|
||||||
if (comp instanceof JComponent && p.x >= comp.getX() && p.x <= comp.getX() + ICON_SIZE && p.y >= comp.getY() && p.y <= comp.getY() + ICON_SIZE) {
|
if (isPointInComponent(comp, point)) {
|
||||||
String toolTip = ((JComponent) comp).getToolTipText();
|
String toolTip = ((JComponent) comp).getToolTipText();
|
||||||
if (toolTip == null || toolTip.isEmpty()) {
|
if (toolTip == null || toolTip.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
@ -190,4 +190,8 @@ public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellR
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isPointInComponent(Component comp, Point point) {
|
||||||
|
return comp instanceof JComponent && point.x >= comp.getX() && point.x <= comp.getX() + ICON_SIZE && point.y >= comp.getY() && point.y <= comp.getY() + ICON_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -209,13 +209,8 @@ final class VideoThumbnailPanel extends javax.swing.JPanel implements ListCellRe
|
|||||||
//gets tooltip of internal panel item mouse is over
|
//gets tooltip of internal panel item mouse is over
|
||||||
Point p = event.getPoint();
|
Point p = event.getPoint();
|
||||||
for (Component comp : getComponents()) {
|
for (Component comp : getComponents()) {
|
||||||
if (comp instanceof JComponent && p.x >= comp.getX() && p.x <= comp.getX() + ICON_SIZE && p.y >= comp.getY() && p.y <= comp.getY() + ICON_SIZE) {
|
if (comp instanceof JComponent && p.x >= comp.getX() && p.x <= comp.getX() + ICON_SIZE && p.y >= comp.getY() && p.y <= comp.getY() + ICON_SIZE && ((JComponent) comp).getToolTipText() != null && !((JComponent) comp).getToolTipText().isEmpty()) {
|
||||||
String toolTip = ((JComponent) comp).getToolTipText();
|
return ((JComponent) comp).getToolTipText();
|
||||||
if (toolTip == null || toolTip.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
return toolTip;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user