Browse Source

Check parent path isn't null. Fixes #203

pull/214/head
weisj 4 years ago
parent
commit
cb3e8c2b4f
  1. 3
      core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java
  2. 4
      core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java

3
core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java

@ -115,9 +115,6 @@ public class CellHintPopupListener<T extends JComponent, I> extends MouseInputAd
cellBounds.y = rect.y - cellBounds.y; cellBounds.y = rect.y - cellBounds.y;
rect.x += popupLocation.x; rect.x += popupLocation.x;
rect.y += popupLocation.y; rect.y += popupLocation.y;
System.out.println("Allocation " + allocation);
System.out.println("CellBounds " + cellBounds);
System.out.println("PreffeSize " + prefSize);
enter(index, rect, cellBounds); enter(index, rect, cellBounds);
return; return;
} else { } else {

4
core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java

@ -600,7 +600,9 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C
if (p == null) return false; if (p == null) return false;
if (Objects.equals(p, path)) return true; if (Objects.equals(p, path)) return true;
if (tree.isExpanded(p)) return false; if (tree.isExpanded(p)) return false;
return Objects.equals(p.getParentPath().getLastPathComponent(), path.getLastPathComponent()); TreePath parent = p.getParentPath();
if (parent == null) return false;
return Objects.equals(parent.getLastPathComponent(), path.getLastPathComponent());
} }
protected boolean isDashedLine() { protected boolean isDashedLine() {

Loading…
Cancel
Save