Browse Source

CHART-21418 fix:颜色控件弹框 如果是从displayComponent上面离开的,隐藏弹出界面。

zheng-1641779399395
shine 3 years ago
parent
commit
0a6bbd3517
  1. 16
      designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java

16
designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java

@ -6,7 +6,11 @@ import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
@ -94,6 +98,18 @@ public abstract class AbstractSelectBox<T> extends AbstractPopBox implements Mou
hidePopupMenu(); hidePopupMenu();
} }
}); });
displayComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
Rectangle rectangle = displayComponent.getBounds();
if (e.getY() < rectangle.y) {
//如果是从displayComponent上面离开的,隐藏弹出界面。
hidePopupMenu();
}
}
});
} }
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {

Loading…
Cancel
Save