Browse Source

REPORT-58589 【主题切换】单元格样式很多时,多次选择样式以后会概率遇到样式没有选中的情况

【问题原因】
偶尔会出现点击手势回调在选中前执行,导致获取到的被选中样式是错误的。
使用新的列表项选中监听方法

【改动思路】
同上
fix-lag
Starryi 3 years ago
parent
commit
6d2f45cd04
  1. 22
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java

22
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java

@ -22,11 +22,11 @@ import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import java.util.List;
@ -44,21 +44,17 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<NameStyle> imp
styleList.setCellRenderer(new RadioButtonListCellRenderer());
styleList.setOpaque(false);
styleList.setBackground(null);
setLayout(FRGUIPaneFactory.createBorderLayout());
add(styleList, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
styleList.addMouseListener(new MouseAdapter() {
styleList.addListSelectionListener(new ListSelectionListener() {
@Override
public void mouseClicked(MouseEvent e) {
int clickedNumber = e.getClickCount();
if (clickedNumber == 1) {
if (changeListener != null) {
changeListener.stateChanged(new ChangeEvent(styleList));
}
public void valueChanged(ListSelectionEvent e) {
if (changeListener != null) {
changeListener.stateChanged(new ChangeEvent(styleList));
}
}
});
setLayout(FRGUIPaneFactory.createBorderLayout());
add(styleList, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
DesignerContext.setDesignerBean("predefinedStyle", this);
}

Loading…
Cancel
Save